document-end¶
What this rule does¶
Requires or forbids the YAML document end marker (...).
Why this matters¶
- Streaming consumers. Producers that emit multiple YAML documents benefit from explicit end markers so consumers know each document is complete.
- Single-document files. Most single-document YAML files omit
...; forbidding it removes a trailing footer that adds no information.
Configuration¶
| Option | Default | Description |
|---|---|---|
present |
true |
When true, require a ... marker at the end of every document. When false, forbid it. |
Examples¶
Allowed (with present: true)¶
Reported (with present: true)¶
Allowed (with present: false)¶
After ryl --fix (with present: true)¶
Automatic fixing¶
ryl --fix appends a ... end marker when present: true and the
document does not already have one. The fix is partial by design:
it only runs when the buffer is a single document. A buffer is treated
as single-document when, after skipping leading blank lines, comments,
and %-directive lines:
- it contains at most one
---marker, and that marker is not preceded by real (non-comment, non-directive) content, and - it contains no
...marker anywhere.
Multi-document streams are left for manual intervention because each
document needs its own ... placed at the correct byte offset, and the
rule does not record per-document end positions. The present: false
case (removing existing ... markers) is never auto-fixed.
Disable with:
Related rules¶
document-start— the matching rule for the---start marker.new-line-at-end-of-file— controls the final newline character.