Add section for empty lines after module inclusion methods #960
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a section for keeping empty lines after module inclusion methods (
extend,includeandprepend). The term "module inclusion" has been borrowed from Layout/ClassStructure docs. I couldn't find a similar issue or PR (either here or for RuboCop).Under this style, code such as:
wouldn't be acceptable; there would have to be an empty line after
includeline:This style is suggested — though not made explicit — by Consistent Classes and module_function sections of the guide (Prefer public_send section's example also shows this practice).
This GH search shows examples where module inclusion methods have been followed by an empty line or the keyword
end(cca 2M at the time of writing). And this search shows examples where the methods have been followed by a non-empty line (cca 844k results; note that this search includes many false positives, like groupedincludelines, so there are even fewer actual examples).Some codebases where this style is mostly followed:
There's also no RuboCop cop for this style, so, if accepted, a new cop would have to be implemented.