Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: pre-commit-update as an alternative to autoupdate #9716

Merged
merged 4 commits into from
Oct 7, 2024
Merged
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
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.
Loading