| SDML(1) | User Commands | SDML(1) |
sdml validate - Validate that a module is correct.
sdml validate [OPTIONS] [MODULE]
Validate that a module is correct.
This command provides deep validation of a module's content, including errors, warnings, and linter-like advice. Checks are run not only on the initial module, but it's transitively loaded dependencies.
By default the command only shows diagnostics with severity `bug` and `error`, but `warning`, `notes`, and `help` can be output with the `--level` argument. This argument also takes the values `none` and `all`.
```text ??? sdml validate --level all -i examples/errors/i0506.sdm note[I0506]: identifier not using preferred casing ?????? examples/errors/i0506.sdm:1:8 ??? 1 ??? module Example <https://example.com/api> is ??? ^^^^^^^ this identifier ??? = expected snake case (snake_case) = help: for more details, see <https://sdml.io/errors/#I0506>
note[I0506]: identifier not using preferred casing ?????? examples/errors/i0506.sdm:3:13 ??? 3 ??? structure access_record is ??? ^^^^^^^^^^^^^ this identifier ??? = expected upper camel case (UpperCamelCase) = help: for more details, see <https://sdml.io/errors/#I0506> ```
The `check-constraints` option turns on (it's default is off) the checking of constraints for correctness.
Additionally, a `short-form` option will generate diagnostics using a CSV format that is easier for tools to parse. The fields in this format are: severity, file name, start line, start column, end line, end column, error code, and message.
```text ??? sdml validate --level all --short-form -i examples/errors/i0506.sdm note,examples/errors/i0506.sdm,1,8,1,15,I0506,identifier not using preferred casing note,examples/errors/i0506.sdm,3,13,3,26,I0506,identifier not using preferred casing ```
-l, --level <LEVEL>
-c, --check-constraints
-s, --short-form
-o, --output <OUTPUT>
-i, --input <INPUT>
-h, --help
-V, --version
| October 2024 | sdml validate 0.3.1+20241014 |