Class: MetzScan::Commands::Scan::ProjectConfigScope::ConfigLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/metz_scan/commands/scan/project_config_scope.rb

Instance Method Summary collapse

Instance Method Details

#default_for(dir) ⇒ Object



110
111
112
113
114
# File 'lib/metz_scan/commands/scan/project_config_scope.rb', line 110

def default_for(dir)
  path = File.join(File.expand_path(dir), ".rubocop.yml")
  config = RuboCop::Config.new({}, path)
  RuboCop::ConfigLoader.merge_with_default(config, path)
end

#load(path) ⇒ Object



116
117
118
119
120
121
122
123
# File 'lib/metz_scan/commands/scan/project_config_scope.rb', line 116

def load(path)
  return RuboCop::ConfigLoader.default_configuration if path == DEFAULT_FILE

  config = RuboCop::Config.new(scope_hash(path), path)
  config.deprecation_check { |_message| nil }
  config.make_excludes_absolute
  RuboCop::ConfigLoader.merge_with_default(config, path)
end