def merge_with_default(config, config_file)
      default_configuration = ConfigLoader.default_configuration

      disabled_by_default = config.for_all_cops['DisabledByDefault']
      enabled_by_default = config.for_all_cops['EnabledByDefault']

      if disabled_by_default || enabled_by_default
        default_configuration = transform(default_configuration) do |params|
          params.merge('Enabled' => !disabled_by_default)
        end
      end

      if disabled_by_default
        config = handle_disabled_by_default(config, default_configuration)
      end

      opts = { inherit_mode: config['inherit_mode'] || {}, unset_nil: true }
      Config.new(merge(default_configuration, config, opts), config_file)
    end
def merge_with_default(config, config_file)
      default_configuration = ConfigLoader.default_configuration

      disabled_by_default = config.for_all_cops['DisabledByDefault']
      enabled_by_default = config.for_all_cops['EnabledByDefault']

      if disabled_by_default || enabled_by_default
        default_configuration = transform(default_configuration) do |params|
          params.merge('Enabled' => !disabled_by_default)
        end
      end

      if disabled_by_default
        config = handle_disabled_by_default(config, default_configuration)
      end

      opts = { inherit_mode: config['inherit_mode'] || {}, unset_nil: true }
      Config.new(merge(default_configuration, config, opts), config_file)
    end
Merges the given configuration with the default one. If
 AllCops:DisabledByDefault is true, it changes the Enabled params so that
 only cops from user configuration are enabled. If
 AllCops::EnabledByDefault is true, it changes the Enabled params so that
 only cops explicitly disabled in user configuration are disabled.