plinss / flake8-noqa

flake8 plugin to validate #noqa comments - Mirror of https://gitlab.linss.com/open-source/flake8/flake8-noqa
GNU Lesser General Public License v3.0
40 stars 6 forks source link

False positives when running with `--stdin-display-name` #24

Closed bryanforbes closed 1 year ago

bryanforbes commented 1 year ago

Given the following file (blah.py):

print(
    'Lorem ipsum lorem ipsum Lorem ipsum lorem ipsum Lorem ipsum lorem ipsum Lorem ipsum lorem ipsum '  # noqa: E501
)

And the following .flake8:

[flake8]
max-line-length = 80
extend-select = NQA1
noqa-require-code = True

The following invocations result in two different outcomes:

$ flake8 blah.py

$ cat blah.py | flake8 --stdin-display-name blah.py -
blah.py:2:105: NQA102 "# noqa: E501" has no matching violations
plinss commented 1 year ago

It's actually failing on any input from stdin, easy fix. Thanks for the report. Fixed in v1.3.1, up on PyPI shortly.