-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
Support restricting file-level noq (# flake8: noqa) to certain errors #1079
Comments
In GitLab by @sigmavirus24 on Oct 20, 2018, 10:18 There is no such support for file-level ignores |
In GitLab by @sigmavirus24 on Oct 20, 2018, 10:18 closed |
In GitLab by @diekhans on Oct 20, 2018, 14:28 This is an enhancement request. Hence, "no such support for file-level ignores" doesn't address the ticket. That is the requested change. Maybe there are good reasons for not doing it, but there is support for its usefulness. |
In GitLab by @diekhans on Oct 21, 2018, 11:40 reopened as enhancement request |
In GitLab by @diekhans on Oct 21, 2018, 11:40 reopened |
In GitLab by @asottile on Oct 21, 2018, 16:44 There's a plugin which takes an attempt at implementing this: flake8-per-file-ignores -- I think it makes sense to support this in flake8 directly given the demonstrated demand. I'll see what I can do about this (or if you want to attempt a PR that would be great!) :) |
In GitLab by @sigmavirus24 on Oct 21, 2018, 17:01 There's already an accepted proposal to allow per-file ignores in config |
In GitLab by @asottile on Oct 21, 2018, 17:06 I assume you mean https://gitlab.com/pycqa/flake8/issues/156 (though that also mentions the |
In GitLab by @sigmavirus24 on Oct 24, 2018, 08:49 #156 is about adding it to configuration files which is what I'm implementing. Allowing it in So in some ways this is a duplicate of #156 and in others it's a rejected feature. Feel free to chose your own view of the glass |
In GitLab by @sigmavirus24 on Oct 24, 2018, 08:49 closed |
In GitLab by @ssbarnea on Jan 26, 2020, 01:35 I find hard to understand the reasons for closing this as there is an already BFG that nukes all checks at file level: So basically the feature is refused because it could be used wrongly, when at the same time a much more dangerous option is the only workaround left to the users. This also reminds me of another refused feature, the one that would allow use of the closest config file. So you could have different set of rules for different directories, something extremely useful when you try to improve checks on a big codebase. And yes, I know about calling tool multiple times in each directory, a recipe for failing to miss newly added files. |
In GitLab by @blueyed on Jan 26, 2020, 05:26
A reference link might be good, but it is rather a bit offtopic anyway. Just wanted to mention that there are per-file-ignores by now (but be aware of https://gitlab.com/pycqa/flake8/issues/517 then). |
In GitLab by @sigmavirus24 on Jan 26, 2020, 08:19 mentioned in commit f277610 |
In GitLab by @ssbarnea on Jan 26, 2020, 10:02 Thanks. I also created !410 to improve the docs. |
In GitLab by @asottile on Feb 18, 2020, 08:07 mentioned in merge request !412 |
@asottile Hi. Could you help me find where https://gitlab.com/pycqa/flake8/issues/517 was moved after github migration. I see mentions of it in other issues like this one, but can't find what it's current issue id. |
@asottile Thank you) |
I feel this should be re-opened as an enhancement request (again) because of the expanded use of VS Code as a development environment for Python (e.g., by ca. 75% of [a tiny number of of survey-responding] developers according to Wikipedia). Specifically, I have the following use case:
I've tried to follow the discussion above despite the outdated links, and I appreciate what appears to be pasting in comments from relevant GitLab posts. The primary issue I can find with implementing this feature seems to be:
It seems like this should be handled under a My preference is to enable a useful feature for experienced developers instead of protecting everyone from hypothetical misuse by poor developers. |
per-file-ignores is the intended mechanism for this -- also looks like the gitlab migration didn't bring over the locked status, annoying |
In GitLab by @diekhans on Jan 12, 2018, 16:11
Please describe how you installed Flake8
flake8: noqa: E731,E123
The text was updated successfully, but these errors were encountered: