Skip to content

Add Rubocop, adopt rubyfmt, and move CI to shared config#64

Merged
dduugg merged 5 commits into
mainfrom
add-rubocop
Jul 24, 2026
Merged

Add Rubocop, adopt rubyfmt, and move CI to shared config#64
dduugg merged 5 commits into
mainfrom
add-rubocop

Conversation

@dduugg

@dduugg dduugg commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds .rubocop.yml inheriting from rubocop-gusto (the shared rubyatscale/Gusto Rubocop config), with only two local overrides: enabling RSpec/NotToNot and Style/BlockDelimiters.
  • Adopts rubyfmt via the rubocop-rubyfmt plugin (default config, loaded after rubocop-gusto) and reformats the codebase to conform.
  • Fixes real Rubocop violations in the code:
    • raise StandardError.new(...)raise StandardError, ..., redundant T.let on string constants, an unused loop-local array literal, and a T.unsafe call.
    • Moved specs into spec/pack_stats/ to satisfy RSpec/SpecFilePathFormat, reworded context/shared_context descriptions to start with when/with for RSpec/ContextWording, and deleted a byte-for-byte duplicate context block caught by RSpec/RepeatedExampleGroupBody.
    • Defers the remaining lower-priority/judgment-call violations to .rubocop_todo.yml: gemspec dev-dependency placement, one method's parameter count, and one loop that can't safely be combined with its predecessor.
  • Updates .github/workflows/ci.yml to call the shared rubyatscale/shared-config CI workflow (tests, type check, and rubocop lint), bumps actions/checkout to v7, and adds a rubyfmt --check job (installs the Linux release binary, since there's no published rubyfmt gem).
  • Drops the ~> 3.0 version pin on the rspec dev dependency in the gemspec.
  • Runs bundle update --all and regenerates the tapioca RBI shims to match.

Test plan

  • bundle exec rspec — all specs pass
  • bundle exec srb tc — no errors
  • bundle exec rubocop — no offenses
  • rubyfmt --check — verified locally against a Linux x86_64 binary in Docker (matches the CI job)

Closes #47

Pulls in rubocop-gusto for linting and rubocop-rubyfmt/rubyfmt for
formatting, fixes the resulting violations, and moves CI onto the
shared-config reusable workflow with an added rubyfmt check.
@dduugg
dduugg requested a review from a team as a code owner July 23, 2026 21:32
@github-project-automation github-project-automation Bot moved this to Triage in Modularity Jul 23, 2026
dduugg added 2 commits July 23, 2026 14:35
Fixes a new Sorbet/RedundantTLetForLiteral offense from the rubocop-sorbet bump.
@dduugg dduugg changed the title Add Rubocop and move to shared config Add Rubocop, adopt rubyfmt, and move CI to shared config Jul 23, 2026
dduugg added 2 commits July 23, 2026 14:52
Syncs sorbet/rbi with the current Gemfile.lock (new rubocop-gusto/
rubocop-rubyfmt dev deps and the bundle update) and excludes the
tapioca-managed sorbet/tapioca/require.rb from rubocop/rubyfmt.
- Move specs under spec/pack_stats/ to satisfy RSpec/SpecFilePathFormat.
- Reword context/shared_context descriptions to start with when/with
  per RSpec/ContextWording.
- Delete a byte-for-byte duplicate context block in pack_stats_spec.rb
  (RSpec/RepeatedExampleGroupBody).
@dduugg
dduugg merged commit 3a81cb4 into main Jul 24, 2026
7 checks passed
@dduugg
dduugg deleted the add-rubocop branch July 24, 2026 00:09
@github-project-automation github-project-automation Bot moved this from Triage to Done in Modularity Jul 24, 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.

Add Rubocop and move to shared config

1 participant