lib/rubocop/rspec/config_formatter.rb in rubocop-rspec-2.31.0 vs lib/rubocop/rspec/config_formatter.rb in rubocop-rspec-3.0.0.pre
- old
+ new
@@ -5,33 +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)
- EXTRACTED_COPS = %(
- RSpec/Capybara/CurrentPathExpectation
- RSpec/Capybara/MatchStyle
- RSpec/Capybara/NegationMatcher
- RSpec/Capybara/SpecificActions
- RSpec/Capybara/SpecificFinders
- RSpec/Capybara/SpecificMatcher
- RSpec/Capybara/VisibilityMatcher
- RSpec/FactoryBot/AttributeDefinedStatically
- RSpec/FactoryBot/ConsistentParenthesesStyle
- RSpec/FactoryBot/CreateList
- RSpec/FactoryBot/FactoryClassName
- RSpec/FactoryBot/FactoryNameStyle
- RSpec/FactoryBot/SyntaxMethods
- RSpec/Rails/AvoidSetupHook
- RSpec/Rails/HaveHttpStatus
- RSpec/Rails/HttpStatus
- RSpec/Rails/InferredSpecType
- RSpec/Rails/MinitestAssertions
- RSpec/Rails/NegationBeValid
- RSpec/Rails/TravelAround
- )
+ SUBDEPARTMENTS = [].freeze
AMENDMENTS = %(Metrics/BlockLength)
COP_DOC_BASE_URL = 'https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/'
def initialize(config, descriptions)
@config = config
@@ -49,10 +27,9 @@
private
def unified_config
cops.each_with_object(config.dup) do |cop, unified|
next if SUBDEPARTMENTS.include?(cop) || AMENDMENTS.include?(cop)
- next if EXTRACTED_COPS.include?(cop)
replace_nil(unified[cop])
unified[cop].merge!(descriptions.fetch(cop))
unified[cop]['Reference'] = reference(cop)
end