Class: RuboCop::Cop::Chef::Modernize::FoodcriticComments
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/chef/modernize/foodcritic_comments.rb
Overview
Remove legacy code comments that disable Foodcritic rules. These comments are no longer necessary if you’ve migrated from Foodcritic to Cookstyle for cookbook linting.
Constant Summary collapse
- MSG =
'Remove legacy code comments that disable Foodcritic rules'
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_new_investigation ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/rubocop/cop/chef/modernize/foodcritic_comments.rb', line 34 def on_new_investigation processed_source.comments.each do |comment| next unless comment.text.match?(/#\s*~FC\d{3}.*/) add_offense(comment, severity: :refactor) do |corrector| corrector.remove(comment) end end end |