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

ignore autoupdate for specific hook/s #1959

Closed
digitronik opened this issue Jul 1, 2021 · 11 comments
Closed

ignore autoupdate for specific hook/s #1959

digitronik opened this issue Jul 1, 2021 · 11 comments
Labels

Comments

@digitronik
Copy link

Take it as RFE or question

Recently, mypi latest version creating problems for my projects. I want to avoid mypi hook in autoupdate.

Do we have anything which helps me to ignore just a specific hook and allow auto update for all other hooks as per YAML?

I think we can add one tag in yaml like autoupdate=false default pre-commit will consider autoupdate=true for all hooks.

@digitronik
Copy link
Author

digitronik commented Jul 1, 2021

@asottile please help me with this ^^

@asottile
Copy link
Member

asottile commented Jul 1, 2021

if you don't want to auto update then don't run auto update

you can use --repo to update individual repositories

@digitronik
Copy link
Author

I think, I failed to explain importance. @asottile think about bot sending PR/MR to n number of projects and user just don't want update for specific hook/repo.

@asottile
Copy link
Member

asottile commented Jul 1, 2021

you need to upgrade at some point

@digitronik
Copy link
Author

Exactly, but sometimes project want to support like in my case py36 and mypi latest version creating problem. We need to take hard decision on this but need some time as ecosystem 😃.

If pre-commit provide option to ignore autoupdate for specific hook just like pinning version then it will give freedom to users.

It's just my opinion/Idea.

@asottile
Copy link
Member

asottile commented Jul 1, 2021

I'm using latest mypy (you're spelling it wrong) with py36 just fine

@digitronik
Copy link
Author

digitronik commented Jul 1, 2021

My bad. In mypy doc they provided awesome note.
Users need to fix it but definitely need some time.

Starting in mypy 0.900, most third-party package stubs must be installed explicitly. This decouples mypy and stub versioning, allowing stubs to updated without updating mypy. This also allows stubs not originally included with mypy to be installed. Earlier mypy versions included a fixed set of stubs for third-party packages.

@asottile
Copy link
Member

asottile commented Jul 1, 2021

that has nothing to do with python3.6 and if you want to restore all of typeshed without thinking about it see https://github.com/asottile/types-all

@digitronik
Copy link
Author

Woot... intresting definitely this will solve problem 🙌. I would like to apply this with TODO note.
Thanks!

@ssbarnea
Copy link

ssbarnea commented Dec 9, 2021

I think that the ability to disable autoupdate for a specific hook entry is needed as I recently faced one such case with https://github.com/ansible/ansible-navigator/blob/main/.pre-commit-config.yaml#L224-L235

This repo has 15+ repos to update but one of the hooks cannot be updated because ones of flake8 extensions does not support flake 4.0 yet and I suspect it may take even 6 months for it to be updated. Updating ~15 hook versions by hand is no joy.

What is even more interesting is that --repo would not be usable in this case because we list flake8 twice, once as normal hook and once as manual, with a slightly different setup. One of them is safe to auto-update, the other one is not.

@asottile
Copy link
Member

asottile commented Dec 9, 2021

sorry but as above:

if you don't want to auto update then don't run auto update

@pre-commit pre-commit locked as resolved and limited conversation to collaborators Dec 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants