From 4c2e03e3aebaa128995374b6f47492e98b1f6006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20S=C3=B8rensen?= Date: Mon, 24 Jun 2024 09:07:02 +0200 Subject: [PATCH] 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. --- CHANGELOG.md | 2 ++ config/obsoletion.yml | 27 +++++---------------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f35c9f367..a932dab9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fix wrong autocorrect for `RSpec/ScatteredSetup` when hook contains heredoc. ([@earlopain]) - Fix false negative for `RSpec/PredicateMatcher` when expectation contains custom failure message. ([@earlopain]) +- Facilitate the 3.0 upgrade flow with proper extracted cop messages. ([@jeppester]) ## 3.0.1 (2024-06-11) @@ -936,6 +937,7 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features. [@jaredmoody]: https://github.com/jaredmoody [@jdufresne]: https://github.com/jdufresne [@jeffreyc]: https://github.com/jeffreyc +[@jeppester]: https://github.com/jeppester [@jessieay]: https://github.com/jessieay [@jfragoulis]: https://github.com/jfragoulis [@johnny-miyake]: https://github.com/johnny-miyake diff --git a/config/obsoletion.yml b/config/obsoletion.yml index 5669cc85b..530bd0ed4 100644 --- a/config/obsoletion.yml +++ b/config/obsoletion.yml @@ -13,28 +13,6 @@ changed_parameters: alternative: AllowedPatterns severity: warning -renamed: - RSpec/Capybara/CurrentPathExpectation: Capybara/CurrentPathExpectation - RSpec/Capybara/MatchStyle: Capybara/MatchStyle - RSpec/Capybara/NegationMatcher: Capybara/NegationMatcher - RSpec/Capybara/SpecificActions: Capybara/SpecificActions - RSpec/Capybara/SpecificFinders: Capybara/SpecificFinders - RSpec/Capybara/SpecificMatcher: Capybara/SpecificMatcher - RSpec/Capybara/VisibilityMatcher: Capybara/VisibilityMatcher - RSpec/FactoryBot/AttributeDefinedStatically: FactoryBot/AttributeDefinedStatically - RSpec/FactoryBot/ConsistentParenthesesStyle: FactoryBot/ConsistentParenthesesStyle - RSpec/FactoryBot/CreateList: FactoryBot/CreateList - RSpec/FactoryBot/FactoryClassName: FactoryBot/FactoryClassName - RSpec/FactoryBot/FactoryNameStyle: FactoryBot/FactoryNameStyle - RSpec/FactoryBot/SyntaxMethods: FactoryBot/SyntaxMethods - RSpec/Rails/AvoidSetupHook: RSpecRails/AvoidSetupHook - RSpec/Rails/HaveHttpStatus: RSpecRails/HaveHttpStatus - RSpec/Rails/HttpStatus: RSpecRails/HttpStatus - RSpec/Rails/InferredSpecType: RSpecRails/InferredSpecType - RSpec/Rails/MinitestAssertions: RSpecRails/MinitestAssertions - RSpec/Rails/NegationBeValid: RSpecRails/NegationBeValid - RSpec/Rails/TravelAround: RSpecRails/TravelAround - split: RSpec/FilePath: alternatives: @@ -45,3 +23,8 @@ removed: RSpec/Capybara/FeatureMethods: reason: > this cop has migrated to `RSpec/Dialect`. Please use `RSpec/Dialect` instead + +extracted: + RSpec/Rails/*: rubocop-rspec_rails + RSpec/FactoryBot/*: rubocop-factory_bot + RSpec/Capybara/*: rubocop-capybara