Class: Standard::CreatesConfigStore::MergesUserConfigExtensions

Inherits:
Object
  • Object
show all
Defined in:
lib/standard/creates_config_store/merges_user_config_extensions.rb

Constant Summary collapse

DISALLOWED_ALLCOPS_KEYS =
[
  "Include",
  "Exclude",
  "StyleGuideCopsOnly",
  "TargetRubyVersion",

  # The AllCops[Enabled] key is an unused artifact of #merge_with_default.
  # See: https://github.com/rubocop/rubocop/blob/master/lib/rubocop/config_loader_resolver.rb#L81-L85
  "Enabled"
].freeze

Instance Method Summary collapse

Instance Method Details

#call(options_config, standard_config) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/standard/creates_config_store/merges_user_config_extensions.rb', line 16

def call(options_config, standard_config)
  return unless standard_config[:extend_config]&.any?

  extended_config = load_and_merge_extended_rubocop_configs(options_config, standard_config).to_h
  merge_standard_and_user_all_cops!(options_config, extended_config)
  merge_extended_rules_into_standard!(options_config, extended_config)
end