-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Enable Additional Rubocop Extensions #9216
Enable Additional Rubocop Extensions #9216
Conversation
This commit adds the rubocop-performance extension to Puppet as part of its Gemfile and .rubocop.yml configuration file. I've specified version 1.13.3 as it's the last version compatible with Ruby 2.5, which mirrors the version of Rubocop we have pinned and the version of Ruby that is targeted in the Rubocop configuration file. This commit also regenerates the Rubocop todo file and manually adds pending Performance cops to both the configuration and todo files.
This commit adds the rubocop-rake extension to Puppet's Gemfile and Rubocop configuration file, pinning it at 0.6.0 as it's the most recent version, and still supports Ruby 2.5 (which the rest of our Rubocop configuration is set up to support).
This commit adds the rubocop-rspec extension to Puppet's Gemfile and Rubocop configuration file, pinning it at 2.10.0 as it's the last version to support Ruby 2.5 (which the rest of our Rubocop configuration is set up to support). This work includes explicitly adding all pending RSpec cops to the Rubocop config file and enabling them.
Enabled: true | ||
|
||
Performance/ReverseFirst: # new in 1.7 | ||
Enabled: true |
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.
Some of these cops would be good to fix like the RedundantSortBlock
. Should they go in the todo file instead?
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.
My understanding is that the pending cops (including RedundantSortBlock
) that I've added here in .rubocop.yml are enabled but found no offenses.
I wanted to specify pending cops in .rubocop.yml that didn't require any changes so that we wouldn't need to come back later to enable them.
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.
ah cool, makes sense
This PR enables the performance, Rake, and RSpec Rubocop extensions and configures them in the Rubocop configuration and todo files. This does not involve any code changes.
Note that I have pinned all of these gems at the last version that supported Ruby 2.5, matching with where we have Rubocop itself pinned and the version of Ruby we target in the Rubocop configuration file. We will update this in a future PR.