Skip to content

Commit

Permalink
docs: pre-commit-update as an alternative to autoupdate (python-poetr…
Browse files Browse the repository at this point in the history
  • Loading branch information
voxify-dev authored and Secrus committed Oct 27, 2024
1 parent e531a7b commit c0ac860
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/pre-commit-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,30 @@ 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 explicitly list repositories that should be updated. An option to explicitly exclude
repositories [will not be implemented](https://github.com/pre-commit/pre-commit/issues/1959) into `pre-commit`.

### Are there any alternatives to `pre-commit autoupdate`?

You may use [pre-commit-update](https://pypi.org/project/pre-commit-update/) as an alternative to
`pre-commit autoupdate`.

Since `pre-commit-update` can be used as a pre-commit hook itself, the easiest way
to make use of it would be to include it inside `.pre-commit-config.yaml`:

```yaml
repos:
- repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
rev: v0.5.1post1
hooks:
- id: pre-commit-update
- repo: https://github.com/python-poetry/poetry
rev: 1.8.3
hooks:
- id: poetry-check
- id: poetry-lock
- id: poetry-export
- id: poetry-install
```

Your `.pre-commit-config.yaml` repos will be checked and updated every time pre-commit hooks run.

For more advanced configuration, please check the `pre-commit-update` documentation.

0 comments on commit c0ac860

Please sign in to comment.