Unable to ignore error codes which are the entry point names
As it seems it is not possible to ignore error codes when they are provided as entry point names (like you suggested in #183 (closed)) as they are selected explicitly and thus cannot be ignored:
$ echo 'this_should_be_linted = "double quote string"' | flake8 --ignore=Q000 -
stdin:1:25: Q000 Remove bad quotes.
$ echo 'this_should_be_linted ="double quote string"' | flake8 --ignore=Q000 -
stdin:1:24: Q000 Remove bad quotes.
stdin:1:24: E225 missing whitespace around operator
$ echo 'this_should_be_linted ="double quote string"' | flake8 --ignore=Q000,E225 -
stdin:1:24: Q000 Remove bad quotes.
$ echo 'this_should_be_linted ="double quote string"' | flake8 --ignore=Q000,E225 --select=E225 -
stdin:1:24: E225 missing whitespace around operator
This is using Flake8 3.0.2 installed via pip and flake8-quotes
0.8.1.
As you see E225
is explicitly selected so ignoring it has no effect (that it doesn't show Q000
is because it isn't selected). But Q000
is never explicitly selected in the command line. If I increase verbosity though I get the following output (in any of the first three commands):
flake8.style_guide MainProcess 495 DEBUG Deciding if "Q000" should be reported
flake8.style_guide MainProcess 495 DEBUG The user configured "Q000" to be "Selected.Explicitly", "Ignored.Explicitly"
flake8.style_guide MainProcess 495 DEBUG "Q000" will be "Decision.Selected"
But the select list are the following:
flake8.options.aggregator MainProcess 439 DEBUG Extended default select list: ['C90', 'Q000', 'F']
[…]
flake8.options.aggregator MainProcess 439 DEBUG Merged default select list: ['C90', 'Q000', 'W', 'E', 'F']
If I modify the plugin to report C90
instead of Q000
, so it exactly matches one of the default select list, I cannot disable it anymore (I did not modify the entry point, so it'll still think it's Q000
).
I guess that Selected.Explicitly
is not correctly used. If I explicitly select E225
for example it'll report for Q000
that it should be "Ignored.Implicitly", "Ignored.Explicitly"
. So there shouldn't be a difference between Selected.Explicitly
and Selected.Implicitly
if the user didn't select any codes. And if the user specified any codes it is either Ignored.Implicitly
or Selected.Explicitly
.