Class: RuboCop::Cop::Style::Documentation

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/style/documentation.rb

Constant Summary collapse

YAYOI_MSG =
"ζ*'ヮ')ζ<うっうー!%<type>sのドキュメントのコメントを書きましょうねー".freeze

Instance Method Summary collapse

Methods inherited from Cop

#message

Instance Method Details

#check(node, body, type) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/rubocop/cop/style/documentation.rb', line 9

def check(node, body, type)
  return if namespace?(body)
  return if documentation_comment?(node) || nodoc_comment?(node)
  return if compact_namespace?(node) &&
            nodoc_comment?(outer_module(node).first)

  add_offense(node,
              location: :keyword,
              message: format(YAYOI_MSG, type: type))
end