Skip to content

Commit

Permalink
docs: change name of the hook and add the hook to minimal example
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljoscha Gerber authored and alsmnn committed Aug 21, 2023
1 parent 113ab14 commit 6345c54
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/pre-commit-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 6345c54

Please sign in to comment.