Skip to content

Commit 2442239

Browse files
committed
docs: added note about pre-commit autoupdate
1 parent 844a720 commit 2442239

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/pre-commit-hooks.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@ the defaults are overwritten. You must fully specify all arguments for
2424
your hook if you make use of `args:`.
2525
{{% /note %}}
2626

27+
{{% note %}}
28+
**A note about `pre-commit autoupdate`:**
29+
30+
`pre-commit autoupdate` updates the `rev` for each repository defined in your `.pre-commit-config.yaml`
31+
to the latest available tag in the default branch.
32+
33+
Poetry follows a branching strategy, where the default branch is the active developement branch
34+
and fixes gets back ported to stable branches. New tags are assigned in these stable branches.
35+
36+
`pre-commit` does not support such a branching strategy and has decided to not implement
37+
an option, either on the [user side](https://github.com/pre-commit/pre-commit/issues/2512)
38+
or [hook author side](https://github.com/pre-commit/pre-commit/issues/2508), to define a branch for lookup the latest
39+
available tag.
40+
41+
Thus, `pre-commit autoupdate` is not usable for the hooks described here.
42+
43+
You can avoid changing the `rev` to an unexpected value, by using the `--repo` parameter (may be specified multiple
44+
times), to explicit list repositories that should be updated. An option to explicit exclude
45+
repositories [will not be implemented](https://github.com/pre-commit/pre-commit/issues/1959).
46+
{{% /note %}}
2747

2848
## poetry-check
2949

0 commit comments

Comments
 (0)