@@ -7,6 +7,7 @@ In version 2.x:
77
88 - `RSpec/InvalidPredicateMatcher` cop is removed
99 - `CustomIncludeMethods` configuration option for `RSpec/EmptyExampleGroup` is removed
10+ - cop departments are nested for cops with a department that doesn't match the extension name (`Capybara`, `FactoryBot`, `Rails`)
1011
1112[discrete]
1213=== Adjust the configuration of `RSpec/EmptyExampleGroup`
@@ -29,6 +30,42 @@ AllCops:
2930 - include_tests
3031----
3132
33+ === Add a top-level `RSpec` department
34+
35+ RuboCop extensions had cops with clashing names and departments, e.g. both `rspec-rails` and `rubocop-rspec` had `Rails::HttpStatus` cops.
36+ To avoid issues, e.g. inability to disable just one of the cops, each extension now has its own uber-department.
37+ Expectedly, RuboCop RSpec's uber-department name is `RSpec`.
38+ Changes are only applied to cops that don't already have the department set to `RSpec`, i.e. `Capybara`, `FactoryBot` and `Rails`.
39+
40+ [source,yaml]
41+ ----
42+ # .rubocop.yml
43+
44+ # Before
45+ Capybara/CurrentPathExpectation:
46+ Enabled: false
47+
48+ FactoryBot/AttributeDefinedStatically:
49+ Enabled: false
50+
51+ # remains the same
52+ RSpec/EmptyExampleGroup:
53+ Enabled: false
54+
55+ # After
56+ RSpec/Capybara/CurrentPathExpectation:
57+ Enabled: false
58+
59+ RSpec/FactoryBot/AttributeDefinedStatically:
60+ Enabled: false
61+
62+ # remains the same
63+ RSpec/EmptyExampleGroup:
64+ Enabled: false
65+ ----
66+
67+ https://github.com/rubocop-hq/rubocop/pull/8490[Learn more about this change].
68+
3269== Custom Cop Update Guide
3370
3471Due to significant API changes custom cops will break.
0 commit comments