Add Rubocop, adopt rubyfmt, and move CI to shared config#64
Merged
Conversation
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.
Fixes a new Sorbet/RedundantTLetForLiteral offense from the rubocop-sorbet bump.
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.rubocop.ymlinheriting fromrubocop-gusto(the shared rubyatscale/Gusto Rubocop config), with only two local overrides: enablingRSpec/NotToNotandStyle/BlockDelimiters.rubyfmtvia therubocop-rubyfmtplugin (default config, loaded afterrubocop-gusto) and reformats the codebase to conform.raise StandardError.new(...)→raise StandardError, ..., redundantT.leton string constants, an unused loop-local array literal, and aT.unsafecall.spec/pack_stats/to satisfyRSpec/SpecFilePathFormat, rewordedcontext/shared_contextdescriptions to start withwhen/withforRSpec/ContextWording, and deleted a byte-for-byte duplicatecontextblock caught byRSpec/RepeatedExampleGroupBody..rubocop_todo.yml: gemspec dev-dependency placement, one method's parameter count, and one loop that can't safely be combined with its predecessor..github/workflows/ci.ymlto call the sharedrubyatscale/shared-configCI workflow (tests, type check, andrubocoplint), bumpsactions/checkouttov7, and adds arubyfmt --checkjob (installs the Linux release binary, since there's no publishedrubyfmtgem).~> 3.0version pin on therspecdev dependency in the gemspec.bundle update --alland regenerates the tapioca RBI shims to match.Test plan
bundle exec rspec— all specs passbundle exec srb tc— no errorsbundle exec rubocop— no offensesrubyfmt --check— verified locally against a Linux x86_64 binary in Docker (matches the CI job)Closes #47