You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/upgrade_to_version_2.adoc
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ In version 2.x:
7
7
8
8
- `RSpec/InvalidPredicateMatcher` cop is removed
9
9
- `CustomIncludeMethods` configuration option for `RSpec/EmptyExampleGroup` is removed
10
-
- cop departments are nested
10
+
- cop departments are nested for cops with a department that doesn't match the extension name (`Capybara`, `FactoryBot`, `Rails`)
11
11
12
12
[discrete]
13
13
=== Adjust the configuration of `RSpec/EmptyExampleGroup`
@@ -33,33 +33,35 @@ AllCops:
33
33
=== Add a top-level `RSpec` department
34
34
35
35
RuboCop extensions had cops with clashing names and departments, e.g. both `rspec-rails` and `rubocop-rspec` had `Rails::HttpStatus` cops.
36
-
Also, in some circumstances RuboCop was complaining that some cops have wrong departments specified in the config file, e.g. `RSpec::FilePath` and `Rails::FilePath`, `RSpec/VariableName` and `Naming/VariableName`.
37
36
To avoid issues, e.g. inability to disable just one of the cops, each extension now has its own uber-department.
38
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
39
40
40
[source,yaml]
41
41
----
42
42
# .rubocop.yml
43
43
44
44
# Before
45
-
RSpec/EmptyExampleGroup:
46
-
Enabled: false
47
-
48
45
Capybara/CurrentPathExpectation:
49
46
Enabled: false
50
47
51
48
FactoryBot/AttributeDefinedStatically:
52
49
Enabled: false
53
50
54
-
# After
55
-
RSpec/RSpec/EmptyExampleGroup:
51
+
# remains the same
52
+
RSpec/EmptyExampleGroup:
56
53
Enabled: false
57
54
55
+
# After
58
56
RSpec/Capybara/CurrentPathExpectation:
59
57
Enabled: false
60
58
61
59
RSpec/FactoryBot/AttributeDefinedStatically:
62
60
Enabled: false
61
+
62
+
# remains the same
63
+
RSpec/EmptyExampleGroup:
64
+
Enabled: false
63
65
----
64
66
65
67
https://github.com/rubocop-hq/rubocop/pull/8490[Learn more about this change].
0 commit comments