Class: RuboCop::Cop::Sane::OutdatedComments
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Sane::OutdatedComments
- Defined in:
- lib/rubocop/cop/sane/outdated_comments.rb
Overview
Detects TODO/NOTE/FIXME comments with dates that are in the past.
This cop helps ensure that dated comments are reviewed when their target date has passed.
Constant Summary collapse
- COMMENT_PATTERN =
/^#\s*(NOTE|TODO|FIXME)\[(\d{4}-\d{2}-\d{2})\]:/i- MSG =
"Review or remove this outdated comment dated %<date>s"
Instance Method Summary collapse
Instance Method Details
#on_new_investigation ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/rubocop/cop/sane/outdated_comments.rb', line 26 def on_new_investigation return unless processed_source.valid_syntax? processed_source.comments.each do |comment| check_comment(comment) end end |