class

Krikri::Lint::YamlNewLineAtEndOfFileRule

Inherits Krikri::Lint::Rule < Reference < Object

Upstream parity: yaml[new-line-at-end-of-file] (from yamllint defaults; error level, MEDIUM here). Fires when the file's last line has content and no trailing newline, at that line with no column: "No new line character at the end of file".

Instance methods

applies_to
Source
check(file : PositionedFile, violations : Array(Violation)) : Nil
Source
fix(buffer : FixBuffer, file : PositionedFile, violation : Violation) : Bool
Source
fixable?

Autofix support, mirroring upstream's TransformMixin: a rule opts in by overriding fixable? (and carrying the "autofix" tag like upstream does) and implementing fix. fix must only make line-local edits through the FixBuffer (replace spans within existing lines, delete whole lines, add the final newline); returning true marks the violation fixed so the CLI drops it from the report.

Source
severity
Source
tags
Source
transformable?

Upstream's yaml transform is a documented no-op (the reformatting happens in the data dumper), so it never marks a match fixed; every yaml[*] match gets a "not applied" ERROR.

Source