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

Can't detect useless noqa in some cases #5

Closed
MightyCreak opened this issue Nov 25, 2021 · 1 comment
Closed

Can't detect useless noqa in some cases #5

MightyCreak opened this issue Nov 25, 2021 · 1 comment

Comments

@MightyCreak
Copy link

MightyCreak commented Nov 25, 2021

Hi!

Thanks for your flake8 extension, already saved me quite some time!

I've met an issue though: it fails to detect that the "# noqa: E501" is not necessary in some cases:

# OK, detects E501 is useless: line + comment <= 79
my_array1 = ['lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng string'],  # noqa: E501

# Fails to detect E501 is useless: line + comment > 79
my_array2 = ['lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng string'],  # noqa: E501
my_array2 = ['lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng string'],  # noqa: E501

# Fails to detect E501 is useless: the closing square bracket
my_array3 = [
    ['lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng string'],  # noqa: E501
]  # noqa: E501

My flake8 command-line:

flake8 test_file.py
@plinss plinss closed this as completed in 999b128 Jun 13, 2022
@plinss
Copy link
Owner

plinss commented Jun 13, 2022

I was unable to reproduce the first two listed issues (perhaps fixed by changes to pydocstyle's behavior wrt noqa comments).

The last should be fixed.

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

No branches or pull requests

2 participants