rubocop / rubocop/ruby-style-guide
New cop for surrounding multiline code blocks by empty lines
Open
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 16.5k
- Forks
- 3.3k
- PR merge metrics
- No merged PRs in 30d
Description
# bad
def foo
x = 1
y = 1
if bar
zoo
quux
end
false
end
# good
def foo
x = 1
y = 1
if bar # <--- multiline, should be separated by a blank line from its neighbors
zoo
quux
end
false
end
These extra spaces adds breathing room and makes code easier to read.
I am going to implement this in my app as a custom cop. If this is welcome in core, let me know.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the bad and good Ruby examples in this issue; no repository file or test entry point is identified. Confirm the intended cop scope and where such a rule belongs, then consider it done when surrounding multiline blocks are consistently separated by blank lines and the behavior is covered by the project's tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100