Class: RuboCop::Cop::Elegant::NoComments

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Defined in:
lib/rubocop/cop/elegant/no_comments.rb

Overview

SPDX-FileCopyrightText: Copyright © 2019-2026 Yegor Bugayenko SPDX-License-Identifier: MIT

Constant Summary collapse

MSG =
'Comment is not allowed, unless it is SPDX, magic, rubocop directive, or docblock'

Instance Method Summary collapse

Instance Method Details

#on_new_investigationObject



12
13
14
15
16
# File 'lib/rubocop/cop/elegant/no_comments.rb', line 12

def on_new_investigation
  processed_source.comments.each do |comment|
    register(comment) unless allowed?(comment)
  end
end