Repository navigation
CI: lint with RuboCop - #5
Merged
Merged
Conversation
CI now also runs `bundle exec rubocop` on Ruby 3.3 for every PR and push to main. RuboCop 1.91.0 is pinned as a gemspec development dependency, and .rubocop.yml (TargetRubyVersion 3.0, NewCops enabled) is set to the style the code already follows: double quotes, trailing commas on literals whose closing bracket sits on its own line, alias_method, consistent indentation, dev dependencies in the gemspec. Safe autocorrections only (rubocop -a): %w/%i for 8 literal word/symbol arrays and 3 missing trailing commas. Cops whose rewrites would change behavior for some inputs (HashExcept, CollectionCompact, MutableConstant) are disabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What CI now runs
The existing
testmatrix (Ruby 3.0–3.3, rspec +gem build) is unchanged. A newlintjob runsbundle exec rubocopon Ruby 3.3 for every PR and every push to main.RuboCop 1.91.0 is pinned exactly as a gemspec development dependency, matching the repo's convention (the Gemfile is just
gemspec, andGemfile.lockstays uncommitted). That lets Dependabot's bundler updates bump it..rubocop.ymlusesTargetRubyVersion: 3.0andNewCops: enable, and is set to the style the code already follows: double quotes,alias_method,consistenthash and argument indentation,[key, table]hash-rocket alignment, and dev deps in the gemspec. Trailing commas usediff_comma, meaning a comma whenever the closing bracket is on its own line. Runbundle exec rubocoplocally (-afor safe fixes).I picked plain RuboCop over
standard. Standard hard-codes{a: 1}hash braces, which would reformat ~370 places in this{ a: 1 }codebase, and it can't be configured otherwise.Code changes
These are safe autocorrections only (
rubocop -a, never-A), and every one is syntax-only:lib/millionsend/contacts.rb:[:id, :email]becomes%i[id email].lib/millionsend/request.rb: adds a trailing comma in the multilineTRANSPORT_ERRORSarray.spec/resources_spec.rb: 7 string arrays become%w[...], plus 2 trailing commas.No public method, constant, signature or behavior changes. All 68 specs pass.
Deliberately disabled
ENV[...]nil fallback without catching bugs.excepton a HashWithIndifferentAccess also drops string keys that the currentrejectkeeps.compactkeeps[key, nil]pairs.USER_AGENTbreaks anyone appending to it, which is currently the only way to customize the UA.🤖 Generated with Claude Code