From 86b55a455a42645d7b981199dce0401b3fc5f6d0 Mon Sep 17 00:00:00 2001 From: Aljoscha Gerber Date: Fri, 18 Aug 2023 14:57:27 +0200 Subject: [PATCH] docs: change name of the hook and add the hook to minimal example --- docs/pre-commit-hooks.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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