-
Notifications
You must be signed in to change notification settings - Fork 753
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
ignored?
#924
Comments
After digging a bit more in the documentation, I see that only certain checks can be disabled with So I guess this is an enhancement request: allow E201 to be disabled with |
for what it's worth, flake8 works properly on this example: $ flake8 t.py
$ echo $?
0 |
I haven't been following the development of the style checkers. Is flake8 a superset of pycodestyle? Should the projects I work on that do limited continuous testing for style switch from pycodestyle to flake8? |
|
Thanks for the quick response to the issue. Looking forward to (Edited--the first version of this comment was heading off-topic.) |
pycodestyle is more opinionated in what it provides so it doesn't implement support for There's a potential future where some of how Flake8 handles these things gets pulled out into a shared resource for pycodestyle but there hasn't been time or enough interest to do it. |
Being opinionated is probably a good thing, but in this case, I'd like to suggest that not having the option to disable E201 and E241 is not desirable, because it can prevent us from improving the readability of our code. The primary goal of PEP 8 is "readability":
About "breaking the rules", PEP 8 says
and
"Readability", in general, cannot be encoded in a formatting algorithm. The checks implemented in In NumPy and SciPy, we often have arrays defined with literal data. This is especially common in our unit tests. An array is a grid of values, and the most natural and readable format for such an array is a grid of aligned columns. I gave one example above. Here's another. I find this format
much more readable than this
When I read that code, I want it to be easy to see which values are in any row or column. With the compressed spacing enforced, it is difficult to keep track of which numbers make up a column. I think any style checker that forces us to use the latter format is making a mistake. Using |
Using |
For completeness: I just found #289, which was motivated by the same issue that I described above. |
Opened an issue with |
As a follow-up since @larsoner revived this issue... This tool implements the checks suggested by PEP 8 but doesn't implement all of them and doesn't have to align itself with all of the constantly changing opinions there. There's not enough time in the day to keep up with that style guide's every whim and concession. Maybe we need to make it clearer that this tool isn't the thing that checks for what the PEP 8 document says today because no tool could reasonably ever do that. |
I consider the
No one is asking for that. To implement a true PEP-8 checker in software, you'd probably need a "Jarvis-level" AI that understood the concept of "readability". All I was asking for was a way to manually override a few of the checks, using markup that is already handled by |
Here's an example:
pycodestyle reports problems on lines 4 and 6:
I want to ignore those, so I tried
but pycodestyle 2.5.0 seems to ignore those comments. I get the same report when I run pycodestyle on the edited file. Is it possible to get pycodestyle to ignore these whitespace issues?
The text was updated successfully, but these errors were encountered: