Skip to content

Add rubocop-gusto - #69

Merged
dduugg merged 2 commits into
mainfrom
add-rubocop-gusto
Nov 30, 2026
Merged

dduugg merged 2 commits into
mainfrom
add-rubocop-gusto

Conversation

@dduugg

@dduugg dduugg commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds rubocop-gusto, the shared RuboCop config that packs, pack_stats, packwerk-extensions, rubocop-packs, singed, bigrails-redis and danger-migrations already use, to this repo.

What changed

  • Adds rubocop-gusto as a development dependency (spec.add_development_dependency "rubocop-gusto"); Gemfile.lock only gains the new gems, nothing is bumped.
  • .rubocop.yml inherits config/default.yml from rubocop-gusto, loads its plugin, and keeps the existing cop overrides. .rubocop_todo.yml records the 8 remaining cops whose offenses have no safe autocorrection, generated with rubocop --auto-gen-config --exclude-limit 10000.
  • Enforces double-quoted strings (Style/StringLiterals, EnforcedStyle: double_quotes) and converts the codebase to match.
  • Enables RSpec/NotToNot (rubocop-gusto leaves it off by default); autocorrects the to_not calls in 1 spec file.
  • The cop configurations in .rubocop.yml are sorted alphabetically. A comment that introduced a group of cops is repeated on each cop in the group.
  • Applies every safe autocorrection. With the todo emptied, rubocop --display-only-safe-correctable reports nothing, so the todo hides no safe fix.
  • Gemspec/RequireMFA is disabled, as in the other repos on rubocop-gusto. Its autocorrect would add rubygems_mfa_required to the gemspec, which changes how the gem is published, so that is left for a separate decision.
  • bin/ is excluded (generated binstubs).
  • In spec/support/have_matching_package.rb the package_todo: if-expression inside the hash literal is hoisted into a local variable (hashified_package_todo); rubocop-gusto's indentation cops cannot be satisfied inside the literal. Behavior is unchanged.
  • The gemspec pins bundler ~> 2.2 but the lockfile was written by Bundler 4, so adding a gem needs Bundler 2.x to resolve. The lockfile was resolved with 2.6.9 and BUNDLED WITH is left at 4.0.15. The pin itself is untouched.
  • Tapioca gem RBIs are not regenerated (it would delete 3 tracked RBIs and add about 49 new ones).

Verification

  • rubocop: 14 files, 0 offenses (same as main, which used default RuboCop config)
  • rspec: 68 examples, 0 failures (same as main)
  • srb tc: no errors

CI

This repo's CI calls shared-config's workflow, whose linter job runs bundle exec rubocop, so CI exercises the new config. CI is unchanged.

Inherit the shared rubocop-gusto config, as packs, pack_stats and
packwerk-extensions already do.

- Add rubocop-gusto as a development dependency
- Inherit rubocop-gusto's config/default.yml and load its plugin
- Exclude bin/ and stop suggesting extensions
- Enforce double-quoted strings (Style/StringLiterals) and convert the
  codebase
- Apply safe autocorrections (sigils, trailing commas, let ordering,
  memoization form) and record the remaining unsafe-correctable and
  non-correctable offenses in .rubocop_todo.yml
- Hand-format a few multi-line autocorrects that came out flush-left
@dduugg
dduugg requested a review from a team as a code owner November 30, 2026 21:16
@github-project-automation github-project-automation Bot moved this to Triage in Modularity Nov 30, 2026
- Enable RSpec/NotToNot, which rubocop-gusto leaves off by default
- Autocorrect the `to_not` calls it flags (1 spec file)
- Sort the cop configurations in .rubocop.yml alphabetically; a comment
  that introduced a group of cops is repeated on each cop in the group
@dduugg
dduugg merged commit b88a8c6 into main Nov 30, 2026
11 checks passed
@dduugg
dduugg deleted the add-rubocop-gusto branch November 30, 2026 21:34
@github-project-automation github-project-automation Bot moved this from Triage to Done in Modularity Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant