module

Krikri::Lint::YamlText

Shared helpers for the line-oriented yaml[*] rules (comments, hyphens): they scan raw text, so lines that are continuation content of multi-line scalars (block scalars, quoted scalars spanning lines) must be excluded - inside them, "#" and "-" are scalar text, not comments/indicators.

Instance methods

physical_lines(path : String) : Array(String)

Split file content into physical lines (without line terminators). A trailing empty element for a file ending in "\n" is dropped, so index 0 is line 1 and lines.size is the real line count.

Source
scalar_continuation_lines(file : PositionedFile) : Set(Int32)

Lines (1-based) that are continuation content of a multi-line scalar. Block scalars report their content via the scalar value itself (the node's end mark points at the next token, not the content end); quoted scalars end at their closing quote.

Source