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

Allow adjacent oneline method definitions #706

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

soulcutter
Copy link
Contributor

The purpose of oneline methods is a terser format for simple methods, similar to defining variables.

This rule change allows oneline methods to be grouped more-closely together, just as you might group variables to convey meaning. This also accomplishes terser class definitions that don't have mandatory double-spacing between oneline methods.

This permits code like:

def one = "one"
def two = "two"

def number? = true
def animal? = false

Fixes #695

@soulcutter soulcutter changed the title Allow adjacent online method definitions Allow adjacent oneline method definitions Mar 25, 2025
The purpose of oneline methods is a terser format for simple methods,
similar to defining variables. This rule change allows oneline methods
to be grouped more-closely together, just as you might group variables
to convey meaning. This also accomplishes terser class definitions that
don't have mandatory double-spacing between oneline methods.
@soulcutter soulcutter force-pushed the gh-695-adjacent-oneline-defs branch from c4ad2dd to 5f62103 Compare March 25, 2025 15:54
Copy link

@kmcphillips kmcphillips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

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

Successfully merging this pull request may close these issues.

Add AllowAdjacentOneLineDefs: true to Layout/EmptyLineBetweenDefs
2 participants