-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
feature request: --force-exclude #368
Comments
In GitLab by @sigmavirus24 on Dec 28, 2020, 07:46 Soon: Feature request on pre-commit "I want a 'no really all-files' option to override Flake8 and Black's --force-exclude options" More seriously, this seems like a ridiculous escalation of tools fighting each other. Looking at the original black issue: psf/black#438 (comment) I can guess how @asottile will react to this (positively). Personally, if we're going to do this, I'd rather just cut a v4 that changes the behaviour of |
In GitLab by @neutrinoceros on Dec 28, 2020, 07:53
Honestly that would feel much better to me too ! I should note that I'm willing to contribute a patch for this, if you guys can agree on what feels like the most reasonable option. Of course I'm curious to read what @asottile thinks of this as a maintainer/creator of both conflicting tools. |
In GitLab by @asottile on Dec 28, 2020, 08:40 I've kinda changed my mind after thinking about this more. You're asking all the tools involved to do a bunch of extra work when you've misconfigured them in the first place. There's an easy solution which is to use The other thing I've noticed is flake8 already does what you want so you'll want to provide more information including an actual reproduction: $ echo -e $'[flake8]\nexclude=t.py' > setup.cfg
$ echo 'import os' > t.py
$ flake8 t.py
$ echo $?
0 you can also use |
In GitLab by @neutrinoceros on Dec 28, 2020, 09:38 Thanks a lot @asottile, indeed |
In GitLab by @neutrinoceros on Dec 28, 2020, 07:29
Please describe how you installed Flake8
Please provide the exact, unmodified output of
flake8 --bug-report
{
"dependencies": [],
"platform": {
"python_implementation": "CPython",
"python_version": "3.8.6",
"system": "Darwin"
},
"plugins": [
{
"is_local": false,
"plugin": "flake8-bugbear",
"version": "20.11.1"
},
{
"is_local": false,
"plugin": "mccabe",
"version": "0.6.1"
},
{
"is_local": false,
"plugin": "pycodestyle",
"version": "2.6.0"
},
{
"is_local": false,
"plugin": "pyflakes",
"version": "2.2.0"
}
],
"version": "3.8.4"
}
Please describe the problem or feature
I am trying to setup pre-commit-ci with a pre-commit hook for flake8. The problem I'm having is that the target project uses flake8's
exclude
flag (as configured insetup.cfg
).Because pre-commit-ci is running hooks against every file however (
pre-commit run --all-files
), this exclude list is de facto ignored and errors are being reported that we do not care about.A similar problem is solved for
black
as of version 20.8b0 (see https://black.readthedocs.io/en/stable/change_log.html#b0) with the introduction of a--force-exclude
flag which takes priority over pre-commit's--all-files
. I would like to propose that a similar flag be added to flake8.The text was updated successfully, but these errors were encountered: