You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect that within the app3 directory rubocop would use TargetRubyVersion 2.7 specified in the .rubocop.yml there and overriding the value from the inherited .rubocop.yml
Actual behavior
% bundle exec rubocop --debug
For /Users/rlooby/ruby_projects/app3: configuration from /Users/rlooby/ruby_projects/app3/.rubocop.yml
Inheriting configuration from /Users/rlooby/ruby_projects/.rubocop.yml
configuration from /Users/rlooby/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rubocop-performance-1.11.4/config/default.yml
configuration from /Users/rlooby/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rubocop-performance-1.11.4/config/default.yml
Default configuration from /Users/rlooby/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rubocop-1.18.3/config/default.yml
configuration from /Users/rlooby/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rubocop-rspec-2.4.0/config/default.yml
configuration from /Users/rlooby/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rubocop-rspec-2.4.0/config/default.yml
Error: RuboCop found unsupported Ruby version 2.4 in `TargetRubyVersion` parameter (in /Users/rlooby/ruby_projects/.rubocop.yml). 2.4-compatible analysis was dropped after version 1.12.
Supported versions: 2.5, 2.6, 2.7, 3.0, 3.1
Steps to reproduce the problem
Set up directory structure and configs as stated above and try to run rubocop commands.
RuboCop version
Initially this gives the same error. Changing the upper .rubocop.yml to 2.7:
When RuboCop validates configuration, it does it file by file. Usually this is a good strategy since it allows us to show the right file name when there is a validation error. But the above description show us that for TargetRubyVersion, we need to skip the validation in each file and only validate the final merged configuration after inheritance has been resolved.
Given a directory structure like:
app1
andapp2
are using Ruby 2.4 and rubocop 1.12.1. The.rubocop.yml
inruby_projects
hasapp3
is using Ruby 2.7 and rubocop 1.18.3. The.rubocop.yml
inruby_projects/app3
hasExpected behavior
I would expect that within the
app3
directory rubocop would useTargetRubyVersion
2.7 specified in the.rubocop.yml
there and overriding the value from the inherited.rubocop.yml
Actual behavior
Steps to reproduce the problem
Set up directory structure and configs as stated above and try to run rubocop commands.
RuboCop version
Initially this gives the same error. Changing the upper
.rubocop.yml
to 2.7:The text was updated successfully, but these errors were encountered: