Skip to content

Commit c2105b0

Browse files
committed
fixup! Clean up config formatter
1 parent b3bd0ee commit c2105b0

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

config/default.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
RSpec:
43
Include:
54
- "**/*_spec.rb"

lib/rubocop/rspec/config_formatter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module RuboCop
66
module RSpec
77
# Builds a YAML config file from two config hashes
88
class ConfigFormatter
9-
NAMESPACES = /^(RSpec|Capybara|FactoryBot|Rails)/.freeze
9+
EXTENSION_ROOT_DEPARTMENT = %r{^(RSpec/)}.freeze
1010
STYLE_GUIDE_BASE_URL = 'https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/'
1111

1212
def initialize(config, descriptions)
@@ -15,7 +15,7 @@ def initialize(config, descriptions)
1515
end
1616

1717
def dump
18-
YAML.dump(unified_config).gsub(NAMESPACES, "\n\\1")
18+
YAML.dump(unified_config).gsub(EXTENSION_ROOT_DEPARTMENT, "\n\\1")
1919
end
2020

2121
private
@@ -29,7 +29,7 @@ def unified_config
2929
end
3030

3131
def cops
32-
(descriptions.keys | config.keys).grep(NAMESPACES) - ['RSpec']
32+
(descriptions.keys | config.keys).grep(EXTENSION_ROOT_DEPARTMENT)
3333
end
3434

3535
attr_reader :config, :descriptions

0 commit comments

Comments
 (0)