Skip to content

chore: update rubocop gem - #628

Open
dpep wants to merge 1 commit into
ElMassimo:mainfrom
dpep:chore/update-rubocop-standard
Open

dpep wants to merge 1 commit into
ElMassimo:mainfrom
dpep:chore/update-rubocop-standard

Conversation

@dpep

@dpep dpep commented Sep 18, 2026

Copy link
Copy Markdown

Description 📖

This pull request brings the lint gems current — rubocop 1.70.0 → 1.88.2 and standard 1.44.0 → 1.56.0 — and fixes the one offense the upgrade surfaces.

TargetRubyVersion and the standard: config/ruby-3.0.yml inherit are deliberately left alone, so this is a tool bump only and no new cops are gated on the Ruby target.

Background 📜

Both gems are declared unversioned in the Gemfile, so this is a Gemfile.lock update. The dependency changes are confined to rubocop's own tree: rubocop-ast, rubocop-minitest, rubocop-performance, standard-performance, parser, json, ast, parallel, regexp_parser, language_server-protocol and unicode-display_width. standard 1.56.0 requires rubocop ~> 1.88.0, which is what pulls rubocop forward.

The upgrade reports exactly one offense, Style/RedundantArrayFlatten in ViteRuby::CLI::FileUtils.write:

vite_ruby/lib/vite_ruby/cli/file_utils.rb:17:34: C: Style/RedundantArrayFlatten: Remove the redundant flatten.

It is a true positive — Array#join already joins nested arrays recursively, so flattening first is redundant.

The Fix 🔨

By dropping the flatten, and adding a test that pins the nested-content contract of write.

The cop is marked Safe: false, so rubocop -a skips it and rubocop -A was not used; the one-line change is applied by hand.

Verified rather than assumed:

  • The new test_write_nested_content passes both with and without the flatten, so it pins the documented behaviour of write rather than the implementation.
  • Checked the two expressions agree across the shapes this call site can receive — flat strings, nested arrays, deeper nesting, nil elements, an empty list and a hash.
  • bundle exec rubocop is clean: 101 files, no offenses (it reported 1 before the fix).
  • bin/rake test passes on Ruby 4.0.6: 115 tests, 437 assertions, 0 failures.

Two pre-existing notices now surface with the newer rubocop, left out to keep this focused: Naming/PredicateName has been renamed to Naming/PredicatePrefix, and rubocop-performance / rubocop-minitest now prefer plugins: over require:. Both are warnings only and the run still exits 0. Happy to fold either in, or follow up separately, whichever you prefer.

Brings the lint gems current (rubocop 1.70.0 -> 1.88.2, standard
1.44.0 -> 1.56.0) and fixes the one offense the upgrade surfaces.
@dpep
dpep marked this pull request as draft September 18, 2026 01:25
@dpep dpep changed the title chore: update rubocop and standard chore: update rubocop gem Sep 18, 2026
@dpep
dpep marked this pull request as ready for review September 18, 2026 14:30
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.

1 participant