Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
STYLE use types_or in pre-commit #38022
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"] |
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]