Skip to content

RuboCop: Use the current Ruby version as target

Peter Leitzen requested to merge pl-rubocop-target-version into master

What does this MR do and why?

Instead of hardcoding the version we use the current Ruby version so we want easily switch between Ruby 2.7 and 3.0.

Refs #363013 (comment 1102472627).

How to set up and validate locally

asdf local ruby 2.7.5
bundle exec ruby  -e "require 'rubocop'; p RuboCop::ConfigStore.new.for_pwd.target_ruby_version"
# => 2.7
bundle exec rubocop --parallel

asdf local ruby 3.0.4
bundle exec ruby  -e "require 'rubocop'; p RuboCop::ConfigStore.new.for_pwd.target_ruby_version"
# => 3.0
bundle exec rubocop --parallel

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