-
-
Notifications
You must be signed in to change notification settings - Fork 414
Closed
Labels
help wantedExtra attention is neededExtra attention is neededlevel:starterGood for newcomersGood for newcomersrule requestAdding a new ruleAdding a new rule
Milestone
Description
Rule request
Thesis
We all know that if len(x) > 0 is an anti-pattern.
It should be replaced with if x or if not x: for if len(x) == 0 or if len(x) <= 0
So, the rule is when we find len(...) and its compare with zero or >= 1, then we raise a violation.
Reasoning
That's simply not pythonic, it is also shorter to write correctly.
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededlevel:starterGood for newcomersGood for newcomersrule requestAdding a new ruleAdding a new rule