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
Couldn't mute E731 errors via noqa #379
Comments
And yeah, I can exclude all E731 errors by ignoring them as command-line arg or setup.cfg directive, but I don't want to do this, I just want to mute some error lines in code |
This is one of the stronger recommendations in PEP-0008 that was only recently added to the tool. If you're going to modify those files anyway to add |
Thanks for explanation, closing this as invalid |
what about things like: _ = lambda x: x which is a very common pattern in Django when translations are not ready and so using from django.utils.translation import ugettext as _ in such a case I think it makes sense to enforce |
So you write, _ = lambda x: x In every file you need it in? That seems like an anti-pattern more than a pattern. Why wouldn't you have some module where, while translations are not read, you do: def ugettext(text):
return text And then do from my_app.fake_mod import ugettext as _ Then you can very simply rewrite imports with a search for |
What about: This also not works and is a verry usefull pattern. |
Because code wins. The authors of pep8 decided to only allow |
Ok, then where can one fill the controversial form for a specific rule ? :-) |
There isn't one. Flake8 3.0 is in the works and will support people using |
Excellent news! Thanks! |
I'm not sure that this is proper place, but will try.
Updating to 1.6.1 introduces new E731 errors for "do not assign a lambda expression, use a def" and results that
flake8
(as well aspep8
) check failed in several places.As failed code belongs to other dev, I've tried to mute those errors by adding
# noqa
comments to end of failed lines, but nothing happened.So is there any way to mute E731 errors?
The text was updated successfully, but these errors were encountered: