struct

Krikri::Lint::LintTask

Inherits Struct < Value < Object

View over one task mapping node, shared by all task-oriented rules. Resolves the action module the way Ansible does: the first key that is not a task modifier keyword, with ansible.builtin. / ansible.legacy. prefixes stripped for the bare module name.

Constructors

new(node : YAML::Nodes::Mapping, file : Krikri::Lint::PositionedFile, module_name : String, action_node : YAML::Nodes::Node, action_key_node : YAML::Nodes::Node, handlers_section : Bool = false)
Source

Instance methods

action_column
Source
action_key_node

The module-name key node; upstream matchtask rules report violations at this key's line/column.

Source
action_line
Source
action_node

The module's parameters node (mapping or scalar)

Source
args_node

Task-level args: mapping (Ansible merges it into module params).

Source
bare_module

Module name with ansible.builtin./ansible.legacy. prefix stripped.

Source
builtin_alias

Resolved canonical module, or nil when not a known builtin.

Source
display_name

Upstream's Task.str: the task's name, falling back to the module it calls plus its free-form arguments. Used for the "Task/Handler: ..." detail the default formatter appends.

Source
end_line(covered : Set(Int32) | Nil = nil) : Int32

Last line belonging to this task, as a human reads it: the task's body runs until a blank line or a dedent back to its own indentation. Node end marks cannot be used - a scalar's end mark points at the next token, so neighbouring tasks would come out overlapping.

Blank lines inside a block scalar belong to the task and do not end it; covered (see YamlText.scalar_continuation_lines) marks them.

Source
file
Source
handlers_section?
Source
has_param?(key : String) : Bool
Source
has_task_key?(key : String) : Bool
Source
line
Source
module_name

Module name as written (e.g. "apt", "ansible.builtin.shell")

Source
name
Source
name_node

The name: value node, for rules that point at the name text (upstream's name[casing]/name[template] do).

Source
node
Source
param(key : String) : String | Nil
Source
path
Source
task_value(key : String) : String | Nil
Source