-
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
E241 not supported with noqa comment #996
Comments
pycodestyle does not interpret |
@asottile
|
…estyle" doesn't respect them via "noqa" notation (see PyCQA/pycodestyle#996)
…estyle" doesn't respect them via "noqa" notation (see PyCQA/pycodestyle#996)
there are a few codes in pycodestyle which (intentionally) do not support noqa from pycodestyle's side -- E241 appears to be one of them (the reasoning predates me so I don't know) |
Yes. I am aware that support is intentionally removed in that case. But why? Many "visual indentation" related codes are supported (E121-E131 marked by I believe |
@asottile It ran for |
I'm fairly certain some of the reasoning is in the issue tracker as this wasn't arbitrarily pulled out of thin air. I would guess that part of the reasoning was that all As to the PR, it's tiny and doesn't harm anything, and at the same time (if we had telemetry, I could be certain) I would guess fewer than 1% of our users know about or use |
@sigmavirus24 |
sounds like you can get what you want by disabling that rule in autopep8? |
@asottile I can disable it globally, but not locally. |
The
# noqa: E241
comment notation is not respected bypycodestyles
.This is extremely inconvenient for following reasons:
It is not obvious at first glance that
pycodestyle
discriminates between some codes and not others when using# noqa
(as described in intro). This causes harder interpretation of# noqa
cross the code.pycodestyle
allows and already correctly handlesignore = E241
via the config or corresponding input argument when applied globally. So on one side it advertises some form of control of ignored/selected errors, but on the other enforces for no specific reason to not support# noqa: E241
locally (although some other# noqa
codes work).The doc seems to somewhat contradict itself by not allowing
# noqa
specifically forE241
. It is said thatE241
is among codes that are ignored by default:But then, if I need to provide more/other codes to ignore than the defaults (
--ignore
or configignore =
), I loose the flexibility to control which lines they apply to, although it is agreed that PEP8 don't enforce them.I am aware that issue #924 was closed saying that
flake8
can be used instead to respect that notation, and this is "fine", as I use it also that way and it works. The problem arises when trying "fix" those issues.I am using tool
autopep8
, which under the covers usespycodestyle
to apply fixes.flake8
does not provide fixing feature, so I have to go withautopep8
which respects whatpycodestyle
tells it.I also do not want to apply
ignore = E241
globally, because I want to catch cases where incorrect indents and spaces where added by mistake. I want onlyE241
to be ignored for explicit cases where indentation provides more readability (e.g.: in tests with many aligned columns of corresponding values), whereE241
should be disabled explicitly and only for those lines. This also follows PEP8 mentality that one should be allowed to bypass recommendations especially for cases of improving readability.For all these reasons, I would like to request that
pycodestyle
increases the number of error codes it supports via# noqa
and let the user customize local overrides, but with my main concern aroundE241
specifically if all codes makes the change scope too big.The text was updated successfully, but these errors were encountered: