class

Krikri::Lint::YamlIndentationRule

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

Upstream parity: yaml[indentation] (from yamllint defaults: spaces consistent, indent-sequences true, check-multi-line-strings false; error level, MEDIUM here). Covers the structural cases that occur in Ansible content:

  • the document root must start at column 0;
  • a mapping entry whose value starts on a later line must have that value at <mapping indent> + <unit>;
  • a sequence used as a mapping value at the key's own column is an unindented sequence (flagged; "expected at least N+1" when the unit is not known yet, mirroring yamllint); The indentation unit is learned from the first indented next-line value (yamllint's spaces: consistent behavior). Reported at the offending line with no column: "Wrong indentation: expected N but found M". Multi-line flow collections and bare-hyphen entries with their item on the next line are not checked (documented limitation).

Instance methods

applies_to
Source
check(file : PositionedFile, violations : Array(Violation)) : Nil
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