MAINT Update pre-commit setup for black #20292
Conversation
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] |
ogrisel
Jun 17, 2021
Member
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?
rth
Jun 17, 2021
Author
Member
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.
ogrisel
Jun 17, 2021
•
Member
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. |
bf0da87
into
scikit-learn:main
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 ?