mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
Three classes of drift cleaned up across 85 .md files:
- Em-dashes: replaced ` — ` with the contextually correct separator
(colon for `term: explanation`, period to split clauses across
sentences/source lines, parentheses for asides, semicolon for
tight-linked continuations). Two intentional exceptions remain
in `docs/contributing/documentation.md` (the rule literal) and
inside a fenced ```sh block in `docs/contributing/actions/debugging/ci.md`.
- SPOT self-labels: rewrote "This is the SPOT for X" to describe
the subject directly ("This directory holds X" / "This file
describes X"). Cross-references to other artefacts' canonical
role remain unchanged.
- Heading-emoji position: moved leading-emoji headings (`# 🧩 Title`)
to trailing position (`# Title 🧩`) per the headline rule that
emojis MUST come after the title text.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.8 KiB
1.8 KiB
Ansible Variable Lints 🪪
Lint tests that enforce variable-lifecycle invariants across the Ansible tree: every name a role declares MUST be consumed somewhere, and every name a role passes MUST be referenced by the play / template stack that receives it.
Tests in this directory MUST only cover variable definition / consumption checks. Four orthogonal scopes live here:
test_role_and_group_vars_used.pyscans top-level keys ofroles/<role>/{vars,defaults}/main.ymlandgroup_vars/**/*.ymlagainst every project.yml/.yaml/.j2file. The suppression rule key isunused-var(see suppression.md).test_vars_usage_in_yaml.pyscans task-levelvars:blocks against the same consumer set. The two scanners never overlap because their declaration shapes differ.test_no_jinja_default_on_spot_path.pyforbids| default(...)on Jinja expressions whose path resolves viagroup_vars/all/*.yml. Those keys are loaded unconditionally, so the default is dead code at best and silent SPOT decoupling at worst. Per-line suppression:# nocheck: spot-default.test_dotted_path_keys_exist.pyvalidates that every Jinja dotted path (FOO.BAR.BAZ) whose head is ingroup_vars/all/or the consuming role's ownvars/defaultsresolves to an existing key in that dict tree, catching typos / renamed / removed sub-keys. Per-line suppression:# nocheck: dotted-path.
Both tests route every read through the project caches (utils.cache.files, utils.cache.yaml); contributors adding a new variable scanner MUST do the same instead of calling yaml.safe_load* or open() directly.
For framework, directory layout, and make test-lint usage see lint.md.