Class: Yard::Lint::Validators::Documentation::OrphanedDocComment::Parser
- Inherits:
-
Parsers::Base
- Object
- Parsers::Base
- Yard::Lint::Validators::Documentation::OrphanedDocComment::Parser
- Defined in:
- lib/yard/lint/validators/documentation/orphaned_doc_comment/parser.rb
Overview
Parses validator output into structured offense hashes.
Constant Summary collapse
- LINE_REGEX =
Returns parses “file:line: @tag1,@tag2” collector output lines.
/^(.+):(\d+): ([@a-z,_]+)$/.freeze
Instance Method Summary collapse
-
#call(validator_output) ⇒ Array<Hash>
Array of orphaned comment offense hashes.
Methods inherited from Parsers::Base
Instance Method Details
#call(validator_output) ⇒ Array<Hash>
Returns array of orphaned comment offense hashes.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/yard/lint/validators/documentation/orphaned_doc_comment/parser.rb', line 17 def call(validator_output) validator_output .split("\n") .map(&:strip) .reject(&:empty?) .filter_map do |line| match = line.match(LINE_REGEX) next unless match { location: match[1], line: match[2].to_i, tags: match[3].split(',') } end end |