Skip to content

verdict validate

Check policy syntax, semantics and lint warnings without publishing it.

Runs locally. Effects: none declared.

ArgumentTypeRequiredDefaultDescription
<file>positionalnoNo parser defaultPolicy file override, relative to the current directory
--configstringnoNo parser defaultProject configuration path; otherwise discover it
--jsonbooleannofalsePrint a machine-readable validation result
--skip-warningsbooleannofalseOmit warnings and exclude them from the exit status
--allow-warningsbooleannofalseReport warnings without failing validation

--help (-h) shows command help without executing the command. Boolean flags support --no-<flag>. Defaults stated in descriptions may be resolved by the handler or configuration rather than the argument parser.

Optional UTF-8 file path; defaults to the configured policy or policy.vd. ’-’ is an ordinary path.

File input: supported. Standard input: unsupported.

{
"kind": "json-schema",
"schema": {
"type": "object",
"required": [
"file",
"valid",
"ruleCount",
"diagnostics"
],
"additionalProperties": false,
"properties": {
"file": {
"type": "string"
},
"valid": {
"type": "boolean"
},
"ruleCount": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null",
"nullable": true
}
]
},
"diagnostics": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message",
"range"
],
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"severity": {
"type": "string",
"enum": [
"error",
"warning"
]
},
"message": {
"type": "string"
},
"range": {
"anyOf": [
{
"type": "object",
"required": [
"start",
"end"
],
"additionalProperties": false,
"properties": {
"start": {
"type": "object",
"required": [
"line",
"character"
],
"additionalProperties": false,
"properties": {
"line": {
"type": "integer"
},
"character": {
"type": "integer"
}
}
},
"end": {
"type": "object",
"required": [
"line",
"character"
],
"additionalProperties": false,
"properties": {
"line": {
"type": "integer"
},
"character": {
"type": "integer"
}
}
}
}
},
{
"type": "null",
"nullable": true
}
]
}
}
}
}
}
},
"example": {
"file": "policy.vd",
"valid": true,
"ruleCount": 1,
"diagnostics": []
}
}

By default, the command renders human-readable records. --json writes one JSON result to stdout. Operational failures use status 1; JSON failures contain an error object with code and message. See shared output semantics.

  • 0: no errors and no disallowed warnings.
  • 1: errors, or warnings without —allow-warnings; —skip-warnings omits warnings.

Argument, I/O, and other failures handled by the CLI runner use status 1.

verdict validate policy.vd --json
verdict validate policy.vd --allow-warnings