Comments (8)
Thanks for the info, found the issue and fixed it. A new version will be available shortly.
While I was there I found some other tweaks I never landed, so picked up those too.
from flake8-noqa.
Thanks for the report, can you give example code that generates the NQA102 errors that don't have don't have # noqa
comments? I don't need the whole file, but a few lines before and after would be helpful as well.
Looking at the bugbear code it appears that it doesn't send violations for line based checks with # noqa
comments (but should send them for AST based checks), so it will also suffer from the same issue as #1 for those. I left a comment on an existing issue in bugbear about this.
from flake8-noqa.
I noticed the same issue today. It looks like a reporting issue rather than an issue with the checks. Here is one example.
membership.py:307:35: NQA102 (flake8-noqa) "# noqa: N805" has no matching violations
membership.py:388:35: NQA102 (flake8-noqa) "# noqa: N805" has no matching violations
project.py:307:35: NQA102 (flake8-noqa) "# noqa: N805" has no matching violations
project.py:388:35: NQA102 (flake8-noqa) "# noqa: N805" has no matching violations
propose.py:307:35: NQA102 (flake8-noqa) "# noqa: N805" has no matching violations
propose.py:388:35: NQA102 (flake8-noqa) "# noqa: N805" has no matching violations
The first two lines are correct but the subsequent lines are incorrect. They appear to be repeated reporting of the first file's errors attributed to the other files - notice that the line numbers are the same across all 3 files?
from flake8-noqa.
Interesting, can you give an example file that has the errors? I don't need your entire source files, just enough to reproduce the error.
from flake8-noqa.
A simple example is a module with just this:
def my_func():
pass # noqa: W605
Any file checked after will have the same error reported, even if it's empty.
Edit: add environment info
$ flake8 --version
3.8.3 (flake8-noqa: 1.0.5, mccabe: 0.6.1, pycodestyle: 2.6.0, pyflakes: 2.2.0)
CPython 3.6.12 on Linux
from flake8-noqa.
Thanks @plinss it is working very nicely now.
from flake8-noqa.
I'm experiencing the same with flake8-noqa==1.1.0 (from PyPI). Code:
print(f"Downloading {filename}...") # NOQA: T001
flake8 (with flake8-print==4.0.0, which causes the T001):
file.py:135:42: NQA102 "# NOQA: T001" has no matching violations
from flake8-noqa.
Oh I see the flake8-print
issue has been reported in #1 already. I'm also experiencing this with codes B902
(flake8-blind-except), A003 (flake8-builtins), S105 and S106 (flake8-bandit).
from flake8-noqa.
Related Issues (20)
- Issue with picking up noqa issues after other comment HOT 3
- require-code option should respect ignored codes
- Feature request: add option to warn about ignored codes
- Idea: "allowed_noqa" Config Option HOT 8
- Issue with noqa comment & commented out code w/ flake8-eradicate HOT 3
- multiline string with trailing comma causes false positive
- Support flake8==5 HOT 2
- Feature/rule request: require reason/description
- Superfluous and incorrect NQA102 errors
- Incorrect NQA102 error HOT 5
- Is there a way to ignore `NQA` errors? HOT 1
- LICENSE vs. COPYING.LESSER inconsistency HOT 4
- False positives when running with `--stdin-display-name` HOT 1
- Suggestion: deduplicate codes in example
- Misses comments within multi-line strings and comments HOT 3
- [Feature] Detect # noqa comments inside multiline strings
- flake8-noqa slow with VSCode HOT 2
- Allow ignoring T000 (TODO marker) HOT 2
- Support flake8==7.0.0 HOT 4
- Sometimes noqa is not on the Exact Same Line HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flake8-noqa.