Skip to content
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

New rule: Redundant Blank Lines #296

Open
paulo-ferraz-oliveira opened this issue Mar 1, 2023 · 2 comments
Open

New rule: Redundant Blank Lines #296

paulo-ferraz-oliveira opened this issue Mar 1, 2023 · 2 comments
Labels
Milestone

Comments

@paulo-ferraz-oliveira
Copy link
Collaborator

paulo-ferraz-oliveira commented Mar 1, 2023

Name

redundant_blank_lines

Brief Description

Files should not have two or more consecutive blank lines.

Reasoning

This is not a technical concern, but you can improve the odds of others reading and liking your code by making it easier to follow.

Refactoring Proposal

elvis should warn that multiple blank lines are found in a given file (even if they are made up of trailing whitespace)

Options

max_lines (defaults to 1) should determine the number of consecutive blank lines that are allowed (1 means that a warning would occur for 2 blank lines in a row).

Note: if you're using a formatter, this could/should be a concern for it, also.

Origin (#281)

Inspired by Credo's https://hexdocs.pm/credo/Credo.Check.Readability.RedundantBlankLines.html.

@paulo-ferraz-oliveira paulo-ferraz-oliveira changed the title Credo.Check.Readability.RedundantBlankLines Redundant Blank Lines Mar 1, 2023
@paulo-ferraz-oliveira paulo-ferraz-oliveira changed the title Redundant Blank Lines New rule: Redundant Blank Lines Mar 1, 2023
@elbrujohalcon
Copy link
Member

Don't forget to put an option to specify how many lines are too many lines ;)

@elbrujohalcon elbrujohalcon added this to the 3.1.0 milestone Mar 1, 2023
@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Mar 1, 2023

Oh, Ok. I though two lines in a row would be too many already. (edit: edited the description, above)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants