class

Krikri::Lint::FqcnCanonicalRule

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

Upstream parity: ansible-lint's fqcn[canonical] sub-rule. When a fully-qualified module name resolves through Ansible's redirect chain to a different canonical FQCN, flag the written name. Redirects observed with the installed collections; new ones land here when the parity corpus finds them.

Constants

REDIRECTS = {"ansible.builtin.acl" => "ansible.posix.acl", "ansible.builtin.cronvar" => "community.general.cronvar", "community.mysql.mysql_query" => "ansible.mysql.mysql_query", "community.mysql.mysql_variables" => "ansible.mysql.mysql_variables", "community.mysql.mysql_user" => "ansible.mysql.mysql_user", "community.mysql.mysql_info" => "ansible.mysql.mysql_info", "community.mysql.mysql_db" => "ansible.mysql.mysql_db"}

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
marks_fixed?(violation : Violation) : Bool

Upstream's fqcn transform rewrites the action key and marks the match fixed. so no "not applied" is logged for it.

Source
severity
Source
tags
Source
task_scoped?

Task-oriented: violations belong to an enclosing task, so a # noqa: anywhere in that task's body suppresses them.

Source
transformable?

Upstream's TransformMixin: the --fix transformer attempts a rule-specific transform for matches of these rules, even when krikri has no line fix of its own (upstream's yaml transform is a documented no-op, yet every yaml[*] match gets a "Rule specific fix not applied for" ERROR from it).

Source