module

Krikri::Lint::Imports

Resolves the files a playbook or task file pulls in, mirroring upstream's HandleChildren traversal (ansiblelint/utils.py, reached from Runner#find_children). ansible-lint walks this graph before linting, so imported task files, imported playbooks and role content are linted and counted in the "on N files" summary; without it krikri-lint silently skipped them and under-counted.

Dynamic inclusions (a path containing {{ }}) are skipped, same as upstream: they cannot be resolved statically.

Constants

INCLUSION_ACTIONS = ["include", "include_tasks", "import_tasks", "ansible.builtin.include", "ansible.builtin.include_tasks", "ansible.builtin.import_tasks"] of ::String
PLAY_KEYS = ["import_playbook", "ansible.builtin.import_playbook"] of ::String
ROLE_IMPORT_ACTIONS = ["include_role", "import_role", "ansible.builtin.include_role", "ansible.builtin.import_role"] of ::String
ROLE_LIST_KEYS = ["roles", "dependencies"] of ::String
ROLE_SUBDIRS = ["tasks", "meta", "handlers", "vars", "defaults"] of ::String

Upstream walks a role's well-known subdirectories only.

TASK_LIST_KEYS = ["tasks", "pre_tasks", "post_tasks", "handlers", "block", "rescue", "always"] of ::String

Class methods

children(path : String) : Array(String)

Files reachable from one playbook or task file.

Source
expand(paths : Array(String)) : Array(String)

Breadth-first closure over paths, each file appearing once, in discovery order followed by the order its children were found. Paths are reported relative to the working directory when they live under it, the way upstream's Lintable normalizes them, so both tools print the same file names.

Source
relative(path : String) : String

Relative to the working directory when under it, absolute otherwise (upstream's Lintable keeps an outside-cwd path as-is). Symlinks are resolved: a role discovered through a symlinked roles/<name> entry is reported by its real path, as upstream does.

Source