-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
STYLE use types_or in pre-commit #38022
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
Comments
Can I work on this issue? |
take |
sure! the pre-commit docs may be useful here. You'll need to specify |
Hi @rkc007 - I've unassigned you so others can take this up if they wish, but if you're stil interseted in working on it do let me know and I'll re-assign you |
Hi @MarcoGorelli - Sorry I wasn't able to work on this issue as I was working on another issue #32073 and it is now approved. So, I would love to work on this issue now. I have a quick doubt regarding this issue. I saw the documentation and your PR (pre-commit/pre-commit#1677) on the repository. Does the change here is like this -
will be converted to
but what about the Thanks. |
Hey - no worries, I've re-assigned you 😄 For flake8, we run it with different options on each type of file, so I'd leave it as it is. For isort, we could overwrite
For some of the local hooks, we can To check what type a file is, you can use identify. E.g.: $ identify-cli pandas/_libs/tslibs/conversion.pxd
["cython", "file", "non-executable", "text"]
$ identify-cli pandas/_libs/tslibs/parsing.pyx
["cython", "file", "non-executable", "text"]
$ identify-cli pandas/io/formats/info.py
["file", "non-executable", "python", "text"] |
Thank you @MarcoGorelli for your guidance. I have created a PR for this issue. Can you please review it and let me know if I need to change anything in the PR. |
pre-commit 2.9 adds support for types_or, which would help clear up some of the less readable regexes like
\.(py|pyx|rst)$
, replacing them withtypes_or: [python, cython, rst]
The text was updated successfully, but these errors were encountered: