Class: PackageProtections::RubocopProtectionInterface::CopConfig

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/package_protections/rubocop_protection_interface.rb

Instance Method Summary collapse

Instance Method Details

#to_rubocop_yml_compatible_formatObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/package_protections/rubocop_protection_interface.rb', line 16

def to_rubocop_yml_compatible_format
  cop_config = { 'Enabled' => enabled }

  if include_paths.any?
    cop_config['Include'] = include_paths
  end

  if exclude_paths.any?
    cop_config['Exclude'] = exclude_paths
  end

  if .any?
    cop_config.merge!()
  end

  { name => cop_config }.to_yaml.gsub("---\n", '')
end