-
-
Notifications
You must be signed in to change notification settings - Fork 25.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
MAINT Update pre-commit setup for black #20292
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.
LGTM
hooks: | ||
- id: flake8 | ||
types: [file, python] | ||
# only check for unused imports for now, as long as | ||
# the code is not fully PEP8 compatible | ||
args: [--select=F401] |
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.
This might be a problem when working on the examples which allow delayed import statements when using the notebook style code layout and the non-blackified files such as benchmark scripts, no?
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.
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.
Hmm, because we don't want to use # noqa
in examples? I think we should come up with a config that would make flake8 .
just work; related #20296 .
But since this requires more discussion, let me revert the flake8 change, here having black setup would be already good.
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.
OK, then with per-file-ignores
it should be fine.
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.
I approved the PR. Feel free to merge it assuming you tested it and it does not yield spurious rejections when working on the examples.
This reverts commit 2a11521.
It runs flake8 on examples, and overall we currently have around 50 flake8 errors there #20296 . However it only runs on the modified files on commit. So it will only tell you to fix the included flake8 errors, if you edit one of those examples. |
I opened #20298 to make sure that |
Thanks @thomasjpfan ! Merging this then as it would be quite useful to have the black pre-commit on PRs currently. |
Update pre-commit setup for black
Also run all flake8 checks enabled in config using pre-commit
Unless you had it in some other PR @thomasjpfan ?