RSpec/InvalidFeatureCategory: Suggest an alternative for typos
What does this MR do and why?
This MR enhances RSpec/InvalidFeatureCategory
to suggest an alternative (via did_you_mean
stdlib) for simple typos:
For example:
Inspecting 1 file
C
Offenses:
spec/rubocop/cop/rspec/invalid_feature_category_spec.rb:8:79: C: RSpec/InvalidFeatureCategory: Please use a valid feature category. Did you mean :tooling? See https://docs.gitlab.com/ee/development/feature_categorization/#rspec-examples.
RSpec.describe RuboCop::Cop::RSpec::InvalidFeatureCategory, feature_category: :toolnig do
^^^^^^^^
1 file inspected, 1 offense detected
This helps spotting typos like in !105783 (comment 1264713201).
Screenshots or screen recordings
Did you mean? |
---|
How to set up and validate locally
- Make a typo in
feature_category
somewhere in a spec. - Run
rubocop spec/rubocop/cop/rspec/invalid_feature_category_spec.rb <file>
- Enjoy the suggestion
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Peter Leitzen