Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Formatting proposal: Ensure empty line between method definitions#461

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
molawson wants to merge1 commit intoruby-syntax-tree:main
base:main
Choose a base branch
Loading
frommolawson:empty-line-between-method-defs
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletionslib/syntax_tree/node.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9981,6 +9981,11 @@ def format(q)
q.breakable_force
q.breakable_force
q.format(statement)
elsif statement.is_a?(DefNode) && previous.is_a?(DefNode) &&
(statement.location.start_line - line) == 1
q.breakable_force
q.breakable_force
q.format(statement)
elsif statement.location.start_line != line
q.breakable_force
q.format(statement)
Expand Down
11 changes: 11 additions & 0 deletionstest/fixtures/def.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,3 +29,14 @@ def foo( # comment
=end
a
end
%
def foo
end
def bar
end
-
def foo
end

def bar
end
11 changes: 11 additions & 0 deletionstest/fixtures/defs.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,3 +29,14 @@ def foo::foo
-
def foo.foo
end
%
def foo.foo
end
def foo.bar
end
-
def foo.foo
end

def foo.bar
end
Loading

[8]ページ先頭

©2009-2025 Movatter.jp