Skip to content
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

Merged

Conversation

mhashizume
Copy link
Contributor

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.

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.
@mhashizume mhashizume added the maintenance Maintenance chores are excluded from changelogs label Jan 22, 2024
@mhashizume mhashizume requested a review from a team as a code owner January 22, 2024 23:03
Enabled: true

Performance/ReverseFirst: # new in 1.7
Enabled: true
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah cool, makes sense

@joshcooper joshcooper merged commit 5508ab3 into puppetlabs:main Jan 23, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance chores are excluded from changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants