Pylint: PyLint Ignore comments do not work if Flake8 Comment is Present

Created on 4 Sep 2018  路  3Comments  路  Source: PyCQA/pylint

Steps to reproduce

  1. Create a block of code (like a function) that has an issue detected by both Flake8 and PyLint.
  2. Put the "noqa" comment first, then the needed PyLint ignore comment.

Current behavior

PyLint will not see ignore comments that come after Flake8 comments. Such as # noqa: C901 # pylint: disable=R0912,R0915

Expected behavior

PyLint should still ignore the error by scanning through the whole line for a PyLint comment.

pylint --version output

pylint 2.1.1 astroid 2.0.4 Python 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0]

Most helpful comment

Hi, thanks for creating an issue. You can rewrite your comment something along the lines of # pylint: disable=<msg ids>; # noqa, this should make it work.

All 3 comments

Hi, thanks for creating an issue. You can rewrite your comment something along the lines of # pylint: disable=<msg ids>; # noqa, this should make it work.

@PCManticore True, but then Flake8 will not see its comment. Both syntax checkers only look for the first comment.

What was the verdict here? Is there any way of ignore one line for both pylint and flake8?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GergelyKalmar picture GergelyKalmar  路  3Comments

jrial picture jrial  路  3Comments

lancelote picture lancelote  路  3Comments

DGalt picture DGalt  路  3Comments

adamtheturtle picture adamtheturtle  路  3Comments