Skip to content

Commit 4c2e03e

Browse files
committed
Better assist rspec rails cop users when migrating to 3
Previously you would first get: ``` Error: The `RSpec/Rails/InferredSpecType` cop has been moved to `RSpecRails/InferredSpecType`. (obsolete configuration found in .rubocop.yml, please update it) ``` Then after renaming the cop, you would get: ``` Error: unrecognized cop or department RSpecRails/InferredSpecType found in .rubocop.yml Did you mean `RSpec/RepeatedDescription`? ``` Which would be a dead end.
1 parent 11f5cb8 commit 4c2e03e

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Fix wrong autocorrect for `RSpec/ScatteredSetup` when hook contains heredoc. ([@earlopain])
66
- Fix false negative for `RSpec/PredicateMatcher` when expectation contains custom failure message. ([@earlopain])
7+
- Facilitate the 3.0 upgrade flow with proper extracted cop messages. ([@jeppester])
78

89
## 3.0.1 (2024-06-11)
910

@@ -936,6 +937,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
936937
[@jaredmoody]: https://github.com/jaredmoody
937938
[@jdufresne]: https://github.com/jdufresne
938939
[@jeffreyc]: https://github.com/jeffreyc
940+
[@jeppester]: https://github.com/jeppester
939941
[@jessieay]: https://github.com/jessieay
940942
[@jfragoulis]: https://github.com/jfragoulis
941943
[@johnny-miyake]: https://github.com/johnny-miyake

config/obsoletion.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,6 @@ changed_parameters:
1313
alternative: AllowedPatterns
1414
severity: warning
1515

16-
renamed:
17-
RSpec/Capybara/CurrentPathExpectation: Capybara/CurrentPathExpectation
18-
RSpec/Capybara/MatchStyle: Capybara/MatchStyle
19-
RSpec/Capybara/NegationMatcher: Capybara/NegationMatcher
20-
RSpec/Capybara/SpecificActions: Capybara/SpecificActions
21-
RSpec/Capybara/SpecificFinders: Capybara/SpecificFinders
22-
RSpec/Capybara/SpecificMatcher: Capybara/SpecificMatcher
23-
RSpec/Capybara/VisibilityMatcher: Capybara/VisibilityMatcher
24-
RSpec/FactoryBot/AttributeDefinedStatically: FactoryBot/AttributeDefinedStatically
25-
RSpec/FactoryBot/ConsistentParenthesesStyle: FactoryBot/ConsistentParenthesesStyle
26-
RSpec/FactoryBot/CreateList: FactoryBot/CreateList
27-
RSpec/FactoryBot/FactoryClassName: FactoryBot/FactoryClassName
28-
RSpec/FactoryBot/FactoryNameStyle: FactoryBot/FactoryNameStyle
29-
RSpec/FactoryBot/SyntaxMethods: FactoryBot/SyntaxMethods
30-
RSpec/Rails/AvoidSetupHook: RSpecRails/AvoidSetupHook
31-
RSpec/Rails/HaveHttpStatus: RSpecRails/HaveHttpStatus
32-
RSpec/Rails/HttpStatus: RSpecRails/HttpStatus
33-
RSpec/Rails/InferredSpecType: RSpecRails/InferredSpecType
34-
RSpec/Rails/MinitestAssertions: RSpecRails/MinitestAssertions
35-
RSpec/Rails/NegationBeValid: RSpecRails/NegationBeValid
36-
RSpec/Rails/TravelAround: RSpecRails/TravelAround
37-
3816
split:
3917
RSpec/FilePath:
4018
alternatives:
@@ -45,3 +23,8 @@ removed:
4523
RSpec/Capybara/FeatureMethods:
4624
reason: >
4725
this cop has migrated to `RSpec/Dialect`. Please use `RSpec/Dialect` instead
26+
27+
extracted:
28+
RSpec/Rails/*: rubocop-rspec_rails
29+
RSpec/FactoryBot/*: rubocop-factory_bot
30+
RSpec/Capybara/*: rubocop-capybara

0 commit comments

Comments
 (0)