fix rubocop config so CI does not scan vendored gems - #24
Merged
Conversation
The CI rubocop job failed with: Error: The `Style/MethodMissingSuper` cop has been removed since it has been superseded by `Lint/MissingSuper`. (obsolete configuration found in vendor/bundle/ruby/3.4.0/gems/protobuf-3.10.9/.rubocop_todo.yml) An `Exclude` key under `AllCops` replaces the default exclude list rather than adding to it. The default list contains `vendor/**/*`. Setting only `gemfiles/**/*` dropped that entry, so rubocop walked into `vendor/bundle`, found the `.rubocop.yml` of each installed gem, and inherited it. The protobuf gem pins a cop that rubocop 1.90 removed. `inherit_mode: merge: [Exclude]` keeps the defaults and adds `gemfiles/**/*` to them. The rubocop job installs gems into `vendor/bundle`, so this only appeared in CI. Also set `NewCops: disable`. That silences the pending cop list that made up the rest of the failure output. Enabling the new cops instead adds several hundred offenses, including cops that conflict with the deliberate `::` constant prefix style used throughout this gem. Co-Authored-By: Claude Opus 5 (1M context) <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.
The CI rubocop job failed with:
Error: The
Style/MethodMissingSupercop has been removed since it hasbeen superseded by
Lint/MissingSuper.(obsolete configuration found in
vendor/bundle/ruby/3.4.0/gems/protobuf-3.10.9/.rubocop_todo.yml)
An
Excludekey underAllCopsreplaces the default exclude list rather than adding to it. The default list containsvendor/**/*. Setting onlygemfiles/**/*dropped that entry, so rubocop walked intovendor/bundle, found the.rubocop.ymlof each installed gem, and inherited it. The protobuf gem pins a cop that rubocop 1.90 removed.inherit_mode: merge: [Exclude]keeps the defaults and addsgemfiles/**/*to them. The rubocop job installs gems intovendor/bundle, so this only appeared in CI.Also set
NewCops: disable. That silences the pending cop list that made up the rest of the failure output. Enabling the new cops instead adds several hundred offenses, including cops that conflict with the deliberate::constant prefix style used throughout this gem.