wcl validate
Parse and validate a WCL document through all pipeline phases.
Usage
wcl validate <file> [options]
Options
| Flag | Description |
|---|---|
--strict | Treat warnings as errors |
--schema <file> | Load an additional external schema file |
--var KEY=VALUE | Set an external variable (may be repeated) |
Description
wcl validate runs the document through the full 11-phase pipeline:
- Parse
- Macro collection
- Import resolution
- Macro expansion
- Control flow expansion
- Partial merge
- Scope construction and evaluation
- Decorator validation
- Schema validation
- ID uniqueness
- Document validation
All diagnostics (errors and warnings) are printed to stderr. If any errors are produced, the command exits with a non-zero status code.
Exit Codes
| Code | Meaning |
|---|---|
0 | Document is valid |
1 | One or more errors (or warnings with --strict) |
2 | Argument error |
Examples
Validate a file:
wcl validate config.wcl
Validate strictly (warnings are errors):
wcl validate --strict config.wcl
Validate against an external schema:
wcl validate --schema schemas/service.wcl config.wcl
Validate with external variables:
wcl validate --var PORT=8080 config.wcl
Diagnostic Output
error[E070]: missing required field `port`
--> config.wcl:12:3
|
12 | service svc-api {
| ^^^^^^^^^^^^^^^ missing field `port`
|
= required by schema `ServiceSchema`