lib/rubocop/rspec/config_formatter.rb in rubocop-rspec-2.5.0 vs lib/rubocop/rspec/config_formatter.rb in rubocop-rspec-2.6.0
- old
+ new
@@ -5,10 +5,11 @@
module RuboCop
module RSpec
# Builds a YAML config file from two config hashes
class ConfigFormatter
EXTENSION_ROOT_DEPARTMENT = %r{^(RSpec/)}.freeze
+ SUBDEPARTMENTS = %(RSpec/Capybara RSpec/FactoryBot RSpec/Rails)
STYLE_GUIDE_BASE_URL = 'https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/'
def initialize(config, descriptions)
@config = config
@descriptions = descriptions
@@ -22,9 +23,11 @@
private
def unified_config
cops.each_with_object(config.dup) do |cop, unified|
+ next if SUBDEPARTMENTS.include?(cop)
+
unified[cop] = config.fetch(cop)
.merge(descriptions.fetch(cop))
.merge('StyleGuide' => STYLE_GUIDE_BASE_URL + cop.sub('RSpec/', ''))
end
end