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
WPS111 too strict inside comprehensions #1321
Comments
Thanks a lot for the report, @webknjaz! I get your point. But. Sometimes these comprehensions can grow. And its final form can be Moreover, I still don't know what Sadly, I cannot draw a good line to separate really simple cases from not so simple ones. And that's why I don't think that we will be adding a support for comprehensions in this rule. Do you agree with me on this one? 🙂 |
I agree that comprehensions can grow but in such cases, Jones Complexity rule hits me instead. So I'd say this case is covered. I can easily rewrite this as |
Also, this rule forces me to multiline the expression just because naming vars cause the line to not fit within limits while the cognitive complexity of the original line doesn't really require it. |
Not really, if you use
Yes, I agree. Anyway, does two letter names work for you in this case? Like |
Well, I think that most of the time unimportant var should be one-char. Sometimes it's
|
Related:
|
I am going to decline this feature. I really don't like short variable names. Sorry 😓 |
Hello! You have a very good plugin! I fell in love with this at first sight, but your uncooperative approach is frustrating. I think it would be possible to make a parameter whether to check a variable in a loop that defaults to True |
Bug report
I think that WPS111 is too restrictive with vars that are only used in comprehension-like expressions.
What's wrong
It says that
s
is too short here:How is that should be
it doesn't make sense for throwaway vars in list/dict/set comprehensions or generator expressions to be long.
The text was updated successfully, but these errors were encountered: