Skip to content

Commit

Permalink
docs: added note about pre-commit autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
finswimmer committed Sep 13, 2022
1 parent 844a720 commit 2442239
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/pre-commit-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ the defaults are overwritten. You must fully specify all arguments for
your hook if you make use of `args:`.
{{% /note %}}

{{% note %}}
**A note about `pre-commit autoupdate`:**

`pre-commit autoupdate` updates the `rev` for each repository defined in your `.pre-commit-config.yaml`
to the latest available tag in the default branch.

Poetry follows a branching strategy, where the default branch is the active developement branch
and fixes gets back ported to stable branches. New tags are assigned in these stable branches.

`pre-commit` does not support such a branching strategy and has decided to not implement
an option, either on the [user side](https://github.com/pre-commit/pre-commit/issues/2512)
or [hook author side](https://github.com/pre-commit/pre-commit/issues/2508), to define a branch for lookup the latest
available tag.

Thus, `pre-commit autoupdate` is not usable for the hooks described here.

You can avoid changing the `rev` to an unexpected value, by using the `--repo` parameter (may be specified multiple
times), to explicit list repositories that should be updated. An option to explicit exclude
repositories [will not be implemented](https://github.com/pre-commit/pre-commit/issues/1959).
{{% /note %}}

## poetry-check

Expand Down

0 comments on commit 2442239

Please sign in to comment.