diff --git a/docs/pre-commit-hooks.md b/docs/pre-commit-hooks.md index 1d1e3baa7e8..2b1eb86f705 100644 --- a/docs/pre-commit-hooks.md +++ b/docs/pre-commit-hooks.md @@ -83,9 +83,9 @@ hooks: args: ["--dev", "-f", "requirements.txt", "-o", "requirements.txt"] ``` -## poetry-update +## poetry-sync -The `poetry-update` hook calls the `poetry install --sync` command +The `poetry-sync` hook calls the `poetry install --sync` command to make sure the installed dependencies match the packages defined in `poetry.lock`. In order to install this hook, you either need to specify `default_install_hook_types`, or you have to install it via `pre-commit install --install-hooks -t post-checkout -t post-merge`. @@ -109,6 +109,7 @@ repos: - id: poetry-check - id: poetry-lock - id: poetry-export + - id: poetry-sync ``` A `.pre-commit-config.yaml` example for a monorepo setup or if the `pyproject.toml` file is not in the root directory: @@ -124,6 +125,8 @@ repos: args: ["-C", "./subdirectory"] - id: poetry-export args: ["-C", "./subdirectory", "-f", "requirements.txt", "-o", "./subdirectory/requirements.txt"] + - id: poetry-sync + args: ["-C", "./subdirectory"] ``` ## FAQ