Syntax Validation
Cheat sheet · https://pcornel.dk/topic.php?topic=5915
Answer
Syntax Validation proves that an automation artifact conforms to the grammar and parser rules expected by the exact interpreter, tool or format version.
Remember
- Parseable ≠ deployable or semantically correct.
- Syntax accepted by one version ≠ accepted by another version.
- Formatter success ≠ parser success.
- No syntax error ≠ referenced names, resources or values exist.
First checks
yamllint . && ansible-playbook site.yml --syntax-check— YAML/Ansibleterraform validate— HCLshellcheck *.sh— shell
Commands
bash -n <script.sh>- Read-only/validation observation for Bash parser/syntax result without executing the script body.
Verify in this order
code → linters/syntax checks → pass/fail
Where it usually breaks
Syntax Validation proves grammar acceptance by a named parser version; it does not prove schema conformity, semantic correctness, dependency resolution or successful execution.
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Syntax Validation validation proof-boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Criteria / input | Criteria, source revision, validator and exact target identity are explicit | A generic pass exists without versioned criteria or target correlation |
| Preconditions / operation | Current authoritative facts are bound to the exact operation | Stale preflight or requested state substitutes for execution-time facts |
| Effective outcome | Authoritative state/read-back and service-relevant evidence match the expected result | Tool/test/validator success substitutes for effective target or workload proof |
| Limits / next action | Coverage limits, unknowns and failures drive the next narrower check | Unknown evidence becomes pass, retries hide failures or broad success is inferred from one check |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5915