Skip to content

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

[lint.rules.document-end]
level = "error"
present = true
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)

---
this: is the only document
...

❌ Reported (with present: true)

---
this: is the only document

✅ Allowed (with present: false)

---
this: is the only document

🔧 After ryl check --fix (with present: true)

---
this: is the only document
...

Automatic fixing

ryl check --fix adds a ... end marker to every document that lacks one when present: true: before the --- that opens the next document, and at the end of the stream. The present: false case (removing existing ... markers) is never auto-fixed. A block scalar header or body at EOF gains the newline and marker when the YAML 1.2 reference value is preserved. Spaces on a final blank block-scalar line are removed only when they are indentation. A root explicit-indent scalar with value-bearing final spaces keeps those spaces; if its chomping indicator makes a marker unsafe, the final marker is left unfixed.

Disable with:

[lint]
fixable = ["ALL"]
unfixable = ["document-end"]

ryl format adds ... the same way only when [format] document-end is "add", and then conflicts with present = false; see Conflicting lint rules.