-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add pyi file support to .pre-commit-hooks.yaml #1875
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, many thanks for informing us of the types_or
config option! Didn't know that the issue was fixed at last :D
Perhaps it would be good to also put
|
Agree with @MarcoGorelli, I'd be worried this causes issues for people running an earlier version of pre-commit. |
Since pre-commit 2.9.0 (2020-11-21), the types_or key can be used to match multiple disparate file types. For more upstream details, see: pre-commit/pre-commit#607 Add the minimum_pre_commit_version to require pre-commit 2.9.0+. Fixes #402
Thank you for this suggestion. I like it. Included in the latest revision. The quotes are not necessary as having multiple "." is an invalid number so YAML automatically interprets it as a string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix.
@@ -8,8 +8,9 @@ repos: | |||
name: black | |||
language: system | |||
entry: black | |||
minimum_pre_commit_version: 2.9.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.9.2 would be ever so slightly better -- there was some breaking in 2.9.0-flat related to types_or
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing and suggesting this. Updated in #1895.
Since pre-commit 2.9.0 (2020-11-21), the types_or key can be used to match multiple disparate file types. For more upstream details, see: pre-commit/pre-commit#607 Add the minimum_pre_commit_version to require pre-commit 2.9.0+. Fixes psf#402
The PR which led to 2.9.0 was made by a data scientist and so it contains a bug in the default types for `types_or`, it'd be better to have 2.9.2 as the minimum version - at least, that's what Anthony Sottile suggested be done in `black` psf/black#1875 (comment)
Since pre-commit 2.9.0 (2020-11-21), the types_or key can be used to
match multiple disparate file types. For more upstream details, see:
pre-commit/pre-commit#607
Fixes #402