-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
Empty lines in method body #2486
Comments
Interesting, I think we can say that there must a maximum of empty lines in a function's body. I think we need to come up with a ratio 🤔 |
@sobolevn Thank you for answer! I agree with you. Maybe made this functional configurable (like |
Would you like to open a PR for this? |
@sobolevn Yes, of course. But I don't have experience in develop plugins for At the end of the month, I will make a report linter at the "X5 Group" internal meetup (greetings from Artem Kalinin). I would like to add a slide about the extension of this tool to my presentation |
Awesome! So, basically you need to take a look at Next, collect all lines that have 0 nodes on it to find empty ones. And collect the final number of lines. Finally, decide should we raise a violation or not. |
@sobolevn I have increment: create class for checking empty lines in functions or method body. In the next commit I planning add parameter for configuration this rule. Please check my PR |
@sobolevn I'm push changes that make this rule configurable, please check it |
Rule request
Empty lines in the method body are bad. I propose prohibit their use or limit it count in method body
Thesis
I received a PR with the same code
Reasoning
I think, if method have few empty lines, it not holistic, and it makes sense to divide the method into several. Yegor Bugaenko's post about empty lines
The text was updated successfully, but these errors were encountered: