class RuboCop::ConfigLoaderResolver
def merge(base_hash, derived_hash, **opts)
with the addition that any value that is a hash, and occurs in both
Return a recursive merge of two hashes. That is, a normal hash merge,
been replaced by parameters returned by the given block.
Returns a new hash where the parameters of the given config hash have
def merge(base_hash, derived_hash, **opts) result = base_hash.merge(derived_hash) keys_appearing_in_both = base_hash.keys & derived_hash.keys keys_appearing_in_both.each do |key| if base_hash[key].is_a?(Hash) result[key] = merge(base_hash[key], derived_hash[key], **opts) elsif should_union?(base_hash, key, opts[:inherit_mode]) result[key] = base_hash[key] | derived_hash[key] elsif opts[:debug] warn_on_duplicate_setting(base_hash, derived_hash, key, opts) end end result end