Skip to content
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

PyLint Ignore comments do not work if Flake8 Comment is Present #2470

Closed
DevynCJohnson opened this issue Sep 4, 2018 · 3 comments
Closed

Comments

@DevynCJohnson
Copy link

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]

@PCManticore
Copy link
Contributor

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.

@DevynCJohnson
Copy link
Author

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

DevynCJohnson added a commit to DevynCJohnson/pylint that referenced this issue Oct 7, 2018
DevynCJohnson added a commit to DevynCJohnson/pylint that referenced this issue Oct 7, 2018
DevynCJohnson added a commit to DevynCJohnson/pylint that referenced this issue Oct 7, 2018
DevynCJohnson added a commit to DevynCJohnson/pylint that referenced this issue Oct 7, 2018
DevynCJohnson added a commit to DevynCJohnson/pylint that referenced this issue Oct 7, 2018
@deanhoperobertson
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants