Skip to content

RuboCop: Tweaking cop rules per Ruby version

Peter Leitzen requested to merge pl-rubocop-ruby32-cops into master

What does this MR do and why?

  • Disable Lint/RedundantRequireStatement for Ruby 3.2
  • Skip short-hand syntax for Style/HashSyntax for Ruby 3.2

Follow-up of !132439 (merged).

How to set up and validate locally

unset REVEAL_RUBOCOP_TODO
asdf local ruby 3.0.5

bundle exec rubocop app/model/compare.rb # Based on https://gitlab.com/gitlab-org/gitlab/-/jobs/4638615454
Inspecting 1 file
.

1 file inspected, no offenses detected

asdf local ruby 3.1.4

bundle exec rubocop app/models/compare.rb
Inspecting 1 file
.

1 file inspected, no offenses detected

asdf local ruby 3.2.2
bundle exec rubocop app/models/compare.rb

Inspecting 1 file
.

1 file inspected, no offenses detected

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports