Skip to content

Commit ab7ef16

Browse files
committed
Suppress redundant configuration logging for rubocop-performace
`rubocop-performance-1.23.1/config/default.yml` is being output twice: ```console $ bundle exec rubocop -d path/to/example.rb (snip) For /Users/koic/src/github.com/rubocop/rubocop-rails: configuration from /Users/koic/src/github.com/rubocop/rubocop-rails/.rubocop.yml configuration from /Users/koic/src/github.com/rubocop/rubocop-rails/config/default.yml configuration from /Users/koic/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/bundler/gems/rubocop-da31e5acaa98/config/internal_affairs.yml configuration from /Users/koic/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/bundler/gems/rubocop-da31e5acaa98/config/internal_affairs.yml Default configuration from /Users/koic/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/bundler/gems/rubocop-da31e5acaa98/config/default.yml configuration from /Users/koic/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubocop-performance-1.23.1/config/default.yml configuration from /Users/koic/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubocop-performance-1.23.1/config/default.yml ``` Since it is already logged by `ConfigLoader.load_yaml_configuration`: https://github.com/rubocop/rubocop/blob/v1.71.2/lib/rubocop/config_loader.rb#L71-L82 The unnecessary code on the caller side will be removed.
1 parent 2c00726 commit ab7ef16

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/rubocop/performance/inject.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ def self.defaults!
99
path = CONFIG_DEFAULT.to_s
1010
hash = ConfigLoader.load_yaml_configuration(path)
1111
config = Config.new(hash, path).tap(&:make_excludes_absolute)
12-
puts "configuration from #{path}" if ConfigLoader.debug?
13-
config = ConfigLoader.merge_with_default(config, path)
14-
ConfigLoader.instance_variable_set(:@default_configuration, config)
12+
new_config = ConfigLoader.merge_with_default(config, path)
13+
ConfigLoader.instance_variable_set(:@default_configuration, new_config)
1514
end
1615
end
1716
end

0 commit comments

Comments
 (0)