Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
name: poetry-install
description: run poetry install to install dependencies from the lock file
entry: poetry install
language: python
language: system
args: ["--sync"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unlucky because we deprecated --sync in favor of poetry sync.

pass_filenames: false
stages: [post-checkout, post-merge]
always_run: true
9 changes: 9 additions & 0 deletions docs/pre-commit-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,20 @@ The `poetry-install` hook calls the `poetry install` command to make sure all lo
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`.

{{% warning %}}
Versions up to and including 2.2.1 incorrectly configured the `poetry-install` hook with `language: python`.
Starting from 2.2.2, the hook uses `language: system` and includes `args: ["--sync"]` by default.
If you are upgrading from an earlier version, you may need to update your `.pre-commit-config.yaml` accordingly.
{{% /warning %}}

### Arguments

The hook takes the same arguments as the poetry command.
For more information, see the [install command]({{< relref "cli#install" >}}).

The default arguments are `args: ["--sync"]`, which ensures that the environment is synchronized
with the lock file by removing any packages not in the lock file.

## Usage

For more information on how to use pre-commit, please see the [official documentation](https://pre-commit.com/).
Expand Down
Loading