mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-07 11:22:31 +00:00
Restructures tests/lint/ansible/ into five concern-keyed subdirectories (jinja/, modules/, services/, shell/, sql/) plus the pre-existing roles/ and variables/. Each new subdir ships its own __init__.py exporting PROJECT_ROOT and a scope-focused README.md following the project's documentation conventions (RFC 2119 keywords, emoji-after-headline, one-sentence-per-line, no historical context). 12 existing tests move into their concern bucket via git mv so history follows the file. Adds tests/lint/ansible/variables/test_dotted_path_keys_exist.py which catches the bug class where a Jinja dotted path's head resolves via group_vars/all/ or the consuming role's own vars/defaults but a deeper segment does not exist as a key in the dict tree (e.g. the previous `LDAP.SERVER.REACH_DOMAIN` typo in web-app-odoo). Touches three external references so cross-links keep resolving: - docs/contributing/actions/testing/suppression.md (run-once, shared) - roles/sys-svc-compose/tasks/utils/network/README.md (network-via-util) - tests/lint/ansible/sql/test_no_inline_multiline_sql.py (self-path exclude)
11 lines
726 B
Markdown
11 lines
726 B
Markdown
# Jinja Lints 🪄
|
|
|
|
Lint tests that enforce correct Jinja2 filter and lookup composition in Ansible templates and task definitions.
|
|
|
|
Tests in this directory MUST only cover Jinja2 expression composition rules.
|
|
Rules that validate where dotted-path targets are declared live in the sibling `../variables/` directory.
|
|
|
|
- `test_no_lookup_config_jinja_default.py` forbids `lookup('config', application_id, 'path') | default(X)`. The two-term `config` lookup raises on a missing key, so the Jinja `default(...)` filter never fires; the fallback MUST be passed as the lookup's third argument instead.
|
|
|
|
For framework, directory layout, and `make test-lint` usage see [lint.md](../../../../docs/contributing/actions/testing/lint.md).
|