pre-commit-update instead of no auto-update at all
Issue Kind
Change in current behaviour
Description
As per this issue and docs, it is obvious that we can't use pre-commit autoupdate feature with poetry - but that means manual update every time we want the newest (stable) version of the repo.
Impact
As per description, the impact is very clear - pre-commit config that is not manually updated/revisited will get outdated sooner or later...
Workarounds
I came across a blog post that mentioned this with an alternative solution:
You may notice, I’m also using the third party pre-commit-update tool, since I find it works better than the built in pre-commit autoupdate command. Poetry in particular conflicts with this built-in command.
So I checked out pre-commit-update and it works perfectly for our use case. It is very configurable and you can even use it as a pre-commit hook itself.
Minimal example would be:
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.0 # add version here
hooks:
- id: poetry-check
- id: poetry-lock
- id: poetry-export
- id: poetry-install
Which - on commit - would produce:
✘ poetry - 1.8.0 -> 1.8.3
Changes detected and applied
You can even do all sorts of other things - such as excluding the repo, pin it to a certain tag, use unstable versions - etc.
So my proposal would be to perhaps offer that as an alternative in the docs :)
Contributions are welcome.
@Secrus thank you for the fast reply, did not expect and answer this quick :) Do you want me to raise a PR regarding this or you had something else in mind? Thanks!
@voxify-dev the fastest way to see docs changes is to submit a PR, so if you are up for it, just make one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.