Class: Yard::Lint::Validators::Warnings::SyntaxError::Result

Inherits:
Results::Base
  • Object
show all
Defined in:
lib/yard/lint/validators/warnings/syntax_error/result.rb

Overview

Result object for SyntaxError validation

Instance Attribute Summary

Attributes inherited from Results::Base

#config, #offenses

Instance Method Summary collapse

Methods inherited from Results::Base

#count, #each, #empty?, #initialize, #map, #validator_name

Constructor Details

This class inherits a constructor from Yard::Lint::Results::Base

Instance Method Details

#build_message(offense) ⇒ String

Build human-readable message for a SyntaxError offense

Parameters:

  • offense (Hash)

    offense data with :message key

Returns:

  • (String)

    formatted message



17
18
19
20
21
# File 'lib/yard/lint/validators/warnings/syntax_error/result.rb', line 17

def build_message(offense)
  base = 'File could not be parsed by YARD and was skipped'
  detail = offense[:message]
  detail && !detail.empty? ? "#{base}: #{detail}" : base
end