Class: Yard::Lint::Validators::Documentation::LineLength::MessagesBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/yard/lint/validators/documentation/line_length/messages_builder.rb

Overview

Builds human-readable messages for LineLength violations.

Class Method Summary collapse

Class Method Details

.call(offense) ⇒ String

Returns formatted message.

Parameters:

  • offense (Hash)

    offense details with :length, :object_name, and config :max_length

Returns:

  • (String)

    formatted message



13
14
15
16
17
18
19
# File 'lib/yard/lint/validators/documentation/line_length/messages_builder.rb', line 13

def call(offense)
  length = offense[:length]
  object_name = offense[:object_name]
  max_length = offense[:max_length]

  "Documentation line is too long [#{length} > #{max_length}] for '#{object_name}'"
end