Closed Gabriel-p closed 8 years ago
Hi @Gabriel-p yeah we changed some specific pep8 behavior in the last update.
Just to put you in context, the pep8
tool defines some errors as ignored by default, if you pass something in the --ignore
flag, it then overrides the default ignored list in pep8
and it gives you messages about those errors (as you are not ignoring them).
That is a weird behavior if you ask me, but if you have been using pep8
you expect that behavior to be part of anaconda (in fact you didn't had any way before to make pep8
to inform you about some ignored by default errors in anaconda, no way at all).
You can follow the discussion about that change here
You can read a bit more about which errors are ignored by default in pep8
here
The solution is easy, just add those errors to your ignore list.
Thanks for the explanation @DamnWidget.
One thing bothers me though. For example this line:
hypot2 = x*x + y*y
will be highlighted as a E226 violation, but in Guido's style guide that's actually the recommended use.
Who decides that this should be marked as a E226 violation? Can I change it? I definitely like Guido's style guide better.
The last word to accept a Python Enhancement Proposals is as far as I know, Guido Van Rossum one but if E226 is accepted part of PEP8 and that syntax is detected as a violation, I guess it's a violation doesn't matter if is suggested by Guido or not.
Is up to you to ignore that PEP8 violation or not I guess :)
I'd like to avoid having to ignore E226, but I also don't like the current interpretation.
Where does Anaconda get its PEP8 guidelines from? I'd like to go over there and propose Guido's interpretation of E226 which I prefer. Would you be so kind to point me to the right repo?
Thank you! Will got to complain over there :)
I submitted this on pycodestyle years go and it's still there! https://github.com/PyCQA/pycodestyle/issues/248#issuecomment-213658514
Gabriel - I recommend opening a new issue there.
@David-OConnor I'll wait a day or two to see if there's an answer, if not I'll open a new one.
I had to do a double take reading this issue, so to restate the problem:
If you decide to manually ignore checks by adding them to pep8_ignore
in Anaconda user settings, these and only these settings will be ignored by pycodestyle
.
Everything that used to be ignored by the default pycodestyle
configuration will be un-ignored, since we are passing a custom configuration now, and you'll have to manually add them to your pep8_ignore
list if you want the default pycodestyle
behaviour.
These checks are E121, E123, E126, E133, E226, E241, E242, E704 and W503 (can be found here).
Therefore your /User/Anaconda.sublime-settings
should look like this:
{
"pep8_ignore": [
<YOUR_STUFF_HERE>,
"E121",
"E123",
"E126",
"E133",
"E226",
"E241",
"E242",
"E704",
"W503",
]
}
Phew!
That sounds about right yeah
A line like the following:
started, I believe two days ago, to be highlighted as a a violation of PEP8 E226 (no space around operator). I'm 100% sure this wasn't the case before.
Did something change in Anaconda or did I inadvertently change something either in this or some other package?
To be clear, I never added E226 to Anaconda's
pep8_ignore"
setting.