Skip to content

Add rubocop-gusto - #133

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 and loads its plugin. .rubocop_todo.yml records the 24 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); no existing spec uses to_not, so nothing needed correcting.
  • 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).
  • This repo had no RuboCop setup, so .rubocop.yml is new. Sorbet cops stay on. Gemspec/DevelopmentDependencies is set to EnforcedStyle: gemspec because the repo keeps its dev dependencies in the gemspec.
  • Lint-driven code edits beyond autocorrect: options_parser.rb had a malformed #typed: strict sigil, now # typed: strict; and node_color_builder's lambda sig is now T.proc.params(arg0: T.nilable(String)).returns(T.nilable(String)), because graph.dot.erb calls it with a possibly-nil owner. Both are type-level only.
  • d3_graph_generator/parse_packwerk_integration.rb is hand-written Ruby, so it is linted too.
  • Most of the remaining todo is RSpec/InstanceVariable (33) and a handful of unsafe-autocorrect style cops. Tapioca gem RBIs are not regenerated (it would add about 207k lines).

Verification

  • rubocop: 11 files, 0 offenses (RuboCop was not set up before)
  • rspec: 181 examples, 0 failures (same as main)
  • srb tc: no errors
  • the 7 sample-app diagrams checked by spec/ci.sh regenerate byte-identical to the committed .dot files

CI

CI for this repo does not run rubocop, so these checks are local only. 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/ (generated binstubs)
- Keep development dependencies in the gemspec
  (Gemspec/DevelopmentDependencies: EnforcedStyle gemspec)
- Enforce double-quoted strings (Style/StringLiterals) and convert the
  codebase with safe autocorrect
- Disable Gemspec/RequireMFA, as other rubyatscale gems do, so the
  gemspec metadata (and release behaviour) is unchanged
- Apply safe autocorrections and record the remaining unsafe or
  non-correctable offenses in .rubocop_todo.yml
- Keep `# typed: strict` on options_parser.rb (fixing the malformed
  `#typed:` sigil) rather than letting autocorrect downgrade it
- Fix the node_color_builder sig: the proc is called with a nilable
  code owner and returns nil for it, so type both as T.nilable(String)
@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
- No existing spec uses `to_not`, so nothing needed correcting
- 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 enabled auto-merge (squash) November 30, 2026 21:33
@dduugg
dduugg disabled auto-merge November 30, 2026 21:40
@dduugg
dduugg merged commit 5476928 into main Nov 30, 2026
13 checks passed
@dduugg
dduugg deleted the add-rubocop-gusto branch November 30, 2026 21:40
@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