pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

Feature request: allow users to freeze a hook but still use autoupdate PRs #115

Closed sirosen closed 2 years ago

sirosen commented 2 years ago

I'd like to use autoupdate PRs without updating a particular hook. Specifically: I want to keep black at 21.12b0 for now.

It looks like pre-commit autoupdate --freeze puts # frozen: ... comments on lines, but these entries are updated all the same by the autoupdate PRs.

I'm not sure what flavor of YAML parser is being used, but if comments are already being read, I'd like to see

rev: f1d4e742c91dd5179d742b0db9293c4472b765f8  # frozen: 21.12b0

or

rev: 21.12b0  # frozen: 21.12b0

or even maybe

rev: 21.12b0  # frozen

result in no update.

asottile commented 2 years ago

frozen is for autoupdate --freeze -- you're asking for a "don't autoupdate" feature which is unrelated to freezing

holding back a version is intentionally not supported because it makes the system more costly to run -- see also #83

sirosen commented 2 years ago

Thanks for the link and speedy response. I hadn't seen the prior issue in my search and wasn't aware that this kind of usage was explicitly thought about and rejected.

I'll think about workarounds for my case. I suppose I could create a mirror repo with the exact version I need and no newer tags.

asottile commented 2 years ago

I think ideally at some point letting go of python 2 is probably your better bet ;)

sirosen commented 2 years ago

Yes, a hundred times yes! 😂 I've just been slow to do it because the project in question (nose2) is something I've inherited.