MartinThoma / flake8-simplify

❄ A flake8 plugin that helps you to simplify code
MIT License
185 stars 19 forks source link

[New Rule] Avoid 4 or more repeated empty print() #136

Open MartinThoma opened 2 years ago

MartinThoma commented 2 years ago

Explanation

3 elements are ok to recognize, but when you quickly have a look it's hard to distinguish 4 repeated lines from 5 repeated lines. Also, it clutters the code.

While I think an empty print statement after another print statement should be avoided, I can see why people might want to have that. I don't want to be too strict. But 4 statements are too much :smile:

Example

# Bad
print()
print()
print()
print()

# Good
print("\n" * 4)