Skip to content

Pre-commit hook for check and lock not working in subdirectories. #7247

@gnkow

Description

@gnkow
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

I've a multi-root project directory such as:

/api (poetry/python)
     /pyproject.toml
/api2 (non-python)
.pre-commit-config.yml

My .pre-commit-config.yml states:

repos:
  - repo: https://github.com/python-poetry/poetry
    rev: 1.3.1
    hooks:
      - id: poetry-check
      - id: poetry-lock

Whenever I try to use the pre-commit hook I get this:

poetry-check.........................................(no files to check)Skipped
poetry-lock..............................................................Failed
- hook id: poetry-lock
- exit code: 1

Poetry could not find a pyproject.toml file in <ROOT> or its parents

Is there a way to run the pre-commit from the api folder?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions