mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-07 05:26:53 +00:00
Allow disable-noqa to take a comma-separated list
A bare --disable-noqa option still sets the value to True, this adds boolean strings, e.g. --disable-noaq=true, as well as a comma-separated list of codes to disable noqa for. Changes the is_inline_ignored method to accept both the boolean and comma-separated list values and act appropriately. Fixes #667
This commit is contained in:
parent
b6d3fcacff
commit
f34b017963
5 changed files with 40 additions and 4 deletions
|
|
@ -64,6 +64,11 @@ All options available as of Flake8 3.1.0::
|
|||
E,F,W,C90)
|
||||
--disable-noqa Disable the effect of "# noqa". This will report
|
||||
errors on lines with "# noqa" at the end.
|
||||
May be a bare flag, a boolean value, or a
|
||||
comma-separated list of errors to disable "# noqa"
|
||||
for.
|
||||
A bare flag or a boolean true will disable all
|
||||
"# noqa"s.
|
||||
--show-source Show the source generate each error or warning.
|
||||
--statistics Count errors and warnings.
|
||||
--enable-extensions=ENABLE_EXTENSIONS
|
||||
|
|
|
|||
|
|
@ -621,11 +621,16 @@ Options and their Descriptions
|
|||
file. This option allows you to see all the warnings, errors, etc.
|
||||
reported.
|
||||
|
||||
In addition to a bare flag, this option also accepts a boolean value
|
||||
or a comma-separated list of codes to disable ``# NOQA`` for.
|
||||
|
||||
Command-line example:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
flake8 --disable-noqa dir/
|
||||
flake8 --disable-noqa=true dir/
|
||||
flake8 --disable-noqa=E432,E5,W dir/
|
||||
|
||||
This **can** be specified in config files.
|
||||
|
||||
|
|
@ -635,6 +640,10 @@ Options and their Descriptions
|
|||
|
||||
disable_noqa = True
|
||||
disable-noqa = True
|
||||
disable_noqa =
|
||||
E432,
|
||||
E5,
|
||||
W
|
||||
|
||||
|
||||
.. option:: --show-source
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue