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

"noqa: N802" ignored #104

Open
AstraLuma opened this issue Mar 27, 2017 · 3 comments
Open

"noqa: N802" ignored #104

AstraLuma opened this issue Mar 27, 2017 · 3 comments

Comments

@AstraLuma
Copy link

I have the method:

    def load_SPAM(self, data, sheet):  # noqa: N802

That's still producing:

flake8: N802 function name should be lowercase

Some quick googling shows that this should work, so I'm not sure what's up.

@evsasse
Copy link

evsasse commented Jun 22, 2017

Same here.

    def timerEvent(self, event):  # noqa: N802

@kkurian
Copy link

kkurian commented Aug 15, 2017

At first glance,

Flake8Lint/Flake8Lint.py

Lines 834 to 839 in 0317db6

# skip line if 'noqa' defined
if skip_line_lint(line_text):
log("skip '{0}' in line {1} due to 'noqa' comment".format(
error_text, error_line
))
continue
invokes

Flake8Lint/Flake8Lint.py

Lines 305 to 320 in 0317db6

def skip_line_lint(line):
"""Check if we need to skip line check.
Returns `True` if line ends with '# noqa' or '# NOQA' comment.
"""
def _noqa(line):
"""Check if line ends with 'noqa' comment."""
return line.strip().lower().endswith('# noqa')
skip = _noqa(line)
if not skip:
i = line.rfind(' #')
skip = _noqa(line[:i]) if i > 0 else False
return skip

Together they cause a line ending in '# noqa' to be skipped but without accommodation for in-line ignoring errors as specified in the flake8 documentation.

@frankhouzz
Copy link

#110

Made a pull request to fix.

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

4 participants