diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index d2662b8a420..13154790b87 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -5,7 +5,7 @@ language: python language_version: python3 pass_filenames: false - files: ^pyproject.toml$ + files: ^(.*/)?pyproject.toml$ - id: poetry-lock name: poetry-lock diff --git a/docs/pre-commit-hooks.md b/docs/pre-commit-hooks.md index 5fcbd62ef27..ab833dab3f3 100644 --- a/docs/pre-commit-hooks.md +++ b/docs/pre-commit-hooks.md @@ -34,6 +34,9 @@ to make sure the poetry configuration does not get committed in a broken state. The hook takes the same arguments as the poetry command. For more information see the [check command]({{< relref "cli#check" >}}). +{{% note %}} +If the `pyproject.toml` file is not in the root directory, you can specify `args: ["-C", "./subdirectory"]`. +{{% /note %}} ## poetry-lock