File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,7 @@ inherit_mode:
1818 - Exclude
1919
2020AllCops :
21- # TODO: This is the default parser in Ruby >= 3.4
22- # https://github.com/rubocop/rubocop-ast/blob/6b9136235219e9448ee4f369e17cf69bcd9db621/lib/rubocop/ast/processed_source.rb#L385
23- ParserEngine : parser_prism
24- TargetRubyVersion : 3.3
21+ TargetRubyVersion : 3.4
2522 NewCops : enable
2623 Include :
2724 - " **/*.rbi"
@@ -412,6 +409,10 @@ Style/InvertibleUnlessCondition:
412409 :zero? :
413410 :blank? : :present?
414411
412+ # Reconsider once sorbet supports "it": https://github.com/sorbet/sorbet/issues/8375
413+ Style/ItBlockParameter :
414+ Enabled : false
415+
415416Style/MutableConstant :
416417 # would rather freeze too much than too little
417418 EnforcedStyle : strict
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33require "open3"
4+ require "yaml"
45
56RSpec . describe "RuboCop" do
67 context "when calling `rubocop` outside of the Homebrew environment" do
2324 expect ( status ) . to be_a_success
2425 end
2526 end
27+
28+ context "with TargetRubyVersion" do
29+ it "matches .ruby-version" do
30+ rubocop_config_path = HOMEBREW_LIBRARY_PATH . parent /".rubocop.yml"
31+ rubocop_config = YAML . unsafe_load_file ( rubocop_config_path )
32+ target_ruby_version = rubocop_config . dig ( "AllCops" , "TargetRubyVersion" )
33+
34+ ruby_version_path = HOMEBREW_LIBRARY_PATH /".ruby-version"
35+ ruby_version = ruby_version_path . read . strip . to_f
36+
37+ expect ( target_ruby_version ) . to eq ( ruby_version )
38+ end
39+ end
2640end
You can’t perform that action at this time.
0 commit comments