Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ source "https://rubygems.org"
gemspec

# Development dependencies
gem "bundler", ">= 2.5.23"
gem "debug", ">= 1.11.1"
gem "guard-rspec", "~> 4.0"
gem "rake", "~> 13.0"
Expand Down
1 change: 1 addition & 0 deletions bin/verify-sample-code
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ repos = {
"spec/rspec/core/formatters/progress_formatter_spec.rb",
"spec/rspec/core/formatters_spec.rb",
"spec/rspec/core/formatters/documentation_formatter_spec.rb",
"spec/rspec/core/memoized_helpers_spec.rb",
].join(","),
},
},
Expand Down
1 change: 1 addition & 0 deletions lib/rufo/erb_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def format_affix(affix, levels, type)
end

CODE_BLOCK_KEYWORDS = %w[BEGIN END begin case class def do else elsif end ensure for if module rescue unless until while]
private_constant :CODE_BLOCK_KEYWORDS

def code_block_token?(token)
_, kind, value = token
Expand Down
8 changes: 4 additions & 4 deletions lib/rufo/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def format_simple_string(node)
def with_unmodifiable_string_lines
line = @line
yield
(line + 1..@line).each do |i|
((line + 1)..@line).each do |i|
@unmodifiable_string_lines[i] = true
end
end
Expand Down Expand Up @@ -4041,7 +4041,7 @@ def dedent_calls
next unless first_paren_end_line == last_line

diff = first_param_indent - indent
(first_line + 1..last_line).each do |line|
((first_line + 1)..last_line).each do |line|
@line_to_call_info.delete(line)

next if @unmodifiable_string_lines[line]
Expand All @@ -4068,7 +4068,7 @@ def indent_literals

modified_lines = []
@literal_indents.each do |first_line, last_line, indent|
(first_line + 1..last_line).each do |line|
((first_line + 1)..last_line).each do |line|
next if @unmodifiable_string_lines[line]

current_line = lines[line]
Expand Down Expand Up @@ -4117,7 +4117,7 @@ def do_align(components, scope)

# Move all lines affected by the assignment shift
if scope == :assign && (range = @assignments_ranges[line])
(line + 1..range).each do |line_number|
((line + 1)..range).each do |line_number|
lines[line_number] = "#{filler}#{lines[line_number]}"

# And move other elements too if applicable
Expand Down
Loading