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

Update Rubocop #9222

Merged
merged 12 commits into from
Jan 31, 2024
Merged

Conversation

mhashizume
Copy link
Contributor

This PR updates Rubocop, its extensions, and the TargetRubyVersion to reflect that Puppet 8's minimum required Ruby version is 3.1.

Additionally, this PR addresses any new Rubocop offenses that this update causes.

@mhashizume mhashizume added the maintenance Maintenance chores are excluded from changelogs label Jan 26, 2024
@mhashizume mhashizume requested review from a team as code owners January 26, 2024 00:52
@mhashizume mhashizume marked this pull request as draft January 26, 2024 21:36
@mhashizume mhashizume force-pushed the maint/main/rubocop-update branch from f475e8d to 17a8e46 Compare January 26, 2024 22:30
This was referenced Jan 29, 2024
@mhashizume mhashizume force-pushed the maint/main/rubocop-update branch from 17a8e46 to 66e0759 Compare January 30, 2024 01:05
@mhashizume mhashizume marked this pull request as ready for review January 30, 2024 17:24
This commit removes an unnecessary require statement of pp, which is a
default Gem. This offense was identified by the Rubocop
Lint/RedundantRequireStatement cop.
Prior to this commit, Rubocop was configured to use Ruby 2.5 syntax and
all Rubocop-related gems were pinned to the last version to support Ruby
2.5. This was carried over from the Puppet 7 series, which specifies
  Ruby 2.5 as its minimum Ruby version.

This commit sets Rubocop's TargetRubyVersion to 3.1, the same as the
minimum Ruby version set in Puppet 8's gemspec. Additionally, this
commit relaxes all Rubocop-related gem version specifiers in the Gemfile
to allow for newer versions of the gems.
Ruby 2.6 introduced endless ranges. This commit updates all ranges that
ended at -1 to instead by endless. This issue was identified by the
Rubocop Style/SlicingWithRange cop.
@mhashizume mhashizume marked this pull request as draft January 30, 2024 17:41
@mhashizume mhashizume force-pushed the maint/main/rubocop-update branch from 66e0759 to b00d968 Compare January 30, 2024 18:23
@mhashizume mhashizume marked this pull request as ready for review January 30, 2024 18:24
@joshcooper joshcooper merged commit e05d91c into puppetlabs:main Jan 31, 2024
9 checks passed
@mhashizume mhashizume deleted the maint/main/rubocop-update branch January 31, 2024 06:49
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