-
Notifications
You must be signed in to change notification settings - Fork 7
Upgrade RuboCop gems #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Upgrade RuboCop gems to latest compatible versions for Ruby 2.7.5: - rubocop: 0.85.0 → 1.82.0 - rubocop-rails: 2.3.2 → 2.34.2 - rubocop-rspec: 1.39.0 → 3.8.0 Regenerated .rubocop_todo.yml to capture new cops and violations. Note: This is a major version upgrade with several breaking changes: - Configuration parameters renamed (IgnoreCopDirectives → AllowCopDirectives, etc.) - Extension loading changed from 'require:' to 'plugins:' syntax - Many new cops and stricter checking introduced Changelogs: - https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md - https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md - https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughIntroduces RuboCop linting configuration by updating Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.rubocop_todo.yml (1)
9-12: Prioritize addressing the Gemspec/RequiredRubyVersion offense.The
Gemspec/RequiredRubyVersioncop ensures the gemspec declares minimum Ruby version requirements, which is important for compatibility. Since this PR targets Ruby 2.7.5 compatibility, consider addressing this offense early rather than deferring it.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
.rubocop.yml(1 hunks).rubocop_todo.yml(1 hunks)Gemfile(1 hunks)
🔇 Additional comments (3)
.rubocop_todo.yml (1)
14-20: Style violations can be addressed incrementally.The
Style/HashEachMethodsexclusions are reasonable to defer. These are style improvements that can be tackled separately without impacting functionality..rubocop.yml (1)
2-2: Todo file inheritance correctly configured.Adding
.rubocop_todo.ymlbeforeruby/rubocop.ymlensures exclusions are properly applied. The inheritance order is correct.Gemfile (1)
10-12: Gem versions are valid and have no known security vulnerabilities.rubocop 1.82.0 was released December 17, 2025, rubocop-rails 2.34.2 was released November 29, 2025, and rubocop-rspec 3.8.0 was released November 12, 2025. All specified versions exist and are publicly available. The version constraints using
~>are appropriately pessimistic, allowing only patch-level updates while protecting against incompatible minor and major version changes.
| inherit_from: | ||
| - .rubocop_todo.yml | ||
| - ruby/rubocop.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check RuboCop configuration files for deprecated parameters and extension loading syntax
echo "=== Checking for deprecated configuration parameters ==="
echo -e "\nSearching for deprecated parameter names..."
rg -n --type=yaml '(IgnoreCopDirectives|ExcludedMethods|IgnoredPatterns|IgnoredMethods):' \
.rubocop.yml ruby/rubocop.yml ruby/rubocop-ruby.yml 2>/dev/null || echo "No deprecated parameters found"
echo -e "\n=== Checking extension loading syntax ==="
echo -e "\nSearching for 'require:' (should be 'plugins:' in RuboCop 1.x)..."
rg -n --type=yaml '^require:' .rubocop.yml ruby/rubocop.yml ruby/rubocop-ruby.yml 2>/dev/null || echo "No 'require:' found"
echo -e "\nSearching for 'plugins:' (correct for RuboCop 1.x)..."
rg -n --type=yaml '^plugins:' .rubocop.yml ruby/rubocop.yml ruby/rubocop-ruby.yml 2>/dev/null || echo "No 'plugins:' found"
echo -e "\n=== Checking if ruby/rubocop-ruby.yml and ruby/rubocop.yml exist ==="
fd --type=f '^rubocop.*\.yml$' ruby/Repository: thanx/style-guide
Length of output: 723
Apply required RuboCop configuration changes before merge.
The PR has not applied the mandatory breaking changes needed for the major RuboCop upgrade:
In ruby/rubocop-ruby.yml:
- Line 144:
IgnoreCopDirectives→AllowCopDirectives - Line 148:
IgnoredPatterns→AllowedPatterns - Line 276:
IgnoredMethods→AllowedMethods - Line 425:
ExcludedMethods→AllowedMethods
In ruby/rubocop.yml:
- Line 22:
require:→plugins:
These parameter renames and syntax changes are required for RuboCop 1.x compatibility and will cause failures if left unchanged.
🤖 Prompt for AI Agents
In .rubocop.yml around lines 1-3 and in the referenced ruby config files, the
RuboCop 1.x breaking changes were not applied; update ruby/rubocop.yml to
replace the top-level `require:` key with `plugins:`, and update
ruby/rubocop-ruby.yml to rename the listed parameters: change
`IgnoreCopDirectives` to `AllowCopDirectives` at ~line 144, `IgnoredPatterns` to
`AllowedPatterns` at ~line 148, `IgnoredMethods` to `AllowedMethods` at ~line
276, and `ExcludedMethods` to `AllowedMethods` at ~line 425; make these exact
key renames (preserving values/formatting) and run RuboCop to verify no
remaining compatibility errors before merging.
Summary
Upgrades RuboCop gems to latest compatible versions for Ruby 2.7.5.
Changes
Changelogs
Testing
bundle updateexecuted successfully.rubocop_todo.ymlregeneratedNotes
This is a major version upgrade (0.85.0 → 1.82.0) with several important breaking changes:
Configuration Parameter Renames
IgnoreCopDirectives→AllowCopDirectivesExcludedMethods→AllowedMethodsand/orAllowedPatternsIgnoredPatterns→AllowedPatternsIgnoredMethods→AllowedMethodsand/orAllowedPatternsExtension Loading Changes
RuboCop now requires using
plugins:instead ofrequire:for extensions:require: rubocop-rspecplugins: rubocop-rspecImpact on Style Guide Configurations
The following configuration files will need updates to address obsolete parameters:
ruby/rubocop-ruby.ymlruby/rubocop.yml.rubocop.ymlRecommendations
.rubocop_todo.ymlfile for new cops that need attentionplugins:syntaxSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.