From 45d7f36cac13166174f8e6e26aa845203bb6f091 Mon Sep 17 00:00:00 2001 From: Kazuki Nishikawa Date: Thu, 28 May 2026 19:55:00 +0900 Subject: [PATCH 1/3] exclude flaky memoized_helpers_spec.rb from sample-code verification The threadsafety test in memoized_helpers_spec.rb intermittently fails with ThreadOrder::CannotResume due to thread scheduling timing, not because of rufo's formatting. Co-Authored-By: Claude Opus 4.7 (1M context) --- bin/verify-sample-code | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/verify-sample-code b/bin/verify-sample-code index b1c73a62..ad259441 100755 --- a/bin/verify-sample-code +++ b/bin/verify-sample-code @@ -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(","), }, }, From cbbf063527a6422e68adee98c021754e978f3a00 Mon Sep 17 00:00:00 2001 From: Kazuki Nishikawa Date: Thu, 28 May 2026 19:59:35 +0900 Subject: [PATCH 2/3] drop bundler from Gemfile development dependencies Bundler is the tool that loads the Gemfile itself, so pinning it as a gem dependency is unnecessary. With Gemfile requiring bundler >= 2.5.23, CI failed on Ruby 3.0/3.1/3.2/3.3 where the system-shipped bundler is older. Removing the entry lets each Ruby version use its bundled bundler. Co-Authored-By: Claude Opus 4.7 (1M context) --- Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile b/Gemfile index f1ca2274..e584ffa4 100644 --- a/Gemfile +++ b/Gemfile @@ -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" From 2976140c6723f7d9f2cfe34b8ae0dcedf66ae7f3 Mon Sep 17 00:00:00 2001 From: Kazuki Nishikawa Date: Thu, 28 May 2026 20:04:54 +0900 Subject: [PATCH 3/3] fix rubocop offenses introduced by 1.86 upgrade - Lint/AmbiguousRange (formatter.rb x4): wrap the lhs of complex range expressions in parens, e.g. (line + 1..@line) -> ((line + 1)..@line). - Lint/UselessConstantScoping (erb_formatter.rb): mark CODE_BLOCK_KEYWORDS with private_constant so its visibility matches the surrounding private section. Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/rufo/erb_formatter.rb | 1 + lib/rufo/formatter.rb | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/rufo/erb_formatter.rb b/lib/rufo/erb_formatter.rb index 3f146c45..2509c619 100644 --- a/lib/rufo/erb_formatter.rb +++ b/lib/rufo/erb_formatter.rb @@ -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 diff --git a/lib/rufo/formatter.rb b/lib/rufo/formatter.rb index 2a16febc..5adbbf39 100644 --- a/lib/rufo/formatter.rb +++ b/lib/rufo/formatter.rb @@ -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 @@ -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] @@ -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] @@ -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