Validate and format a WCL file

§ 1Purpose

Confirm a file conforms to its schema, then normalise its layout before committing.

§ 2Prerequisites

§ 3Flowchart

1. Check it parses and validates2. Format in place3. Re-check the formatted file

§ 4Steps

§ 4.11

§ 4.2Check it parses and validates

console
$ wcl check config.wcl
ok

Exit codes

0 = valid, 1 = parse error, 2 = schema violation. Script against these for CI gates.

Run wcl check config.wcl. A clean run prints ok and exits 0; fix any reported parse or schema errors before moving on.

§ 4.32

§ 4.4Format in place

console
$ wcl fmt config.wcl --in-place

Run wcl fmt config.wcl --in-place to rewrite the file in canonical form. Indentation, brace style, number radix and string delimiters are normalised; comments and blank-line groupings survive.

§ 4.53

§ 4.6Re-check the formatted file

console
$ wcl check config.wcl
ok

Formatting never changes meaning, but re-run wcl check as a cheap confirmation that the rewrite is still valid.

Verification

wcl check prints ok and exits 0, and a second wcl fmt run produces no further changes.