Why this matters
Long lines can make code harder to read, especially on smaller screens or in side-by-side comparisons. Keeping lines short improves readability and maintainability.
Check if lines exceed 80 characters (excluding comments and docstrings). Long lines reduce readability. Recommend breaking lines or using line continuations for better formatting.
Long lines can make code harder to read, especially on smaller screens or in side-by-side comparisons. Keeping lines short improves readability and maintainability.
Side-by-side examples engineers can pattern-match during review.
result = [mapping_expr for value in iterable if condition(value)]result = [
mapping_expr
for value in iterable
if condition(value)
]result = [mapping_expr for value in iterable if condition(value)]result = [
mapping_expr
for value in iterable
if condition(value)
]From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.