Aller au contenu principal

Conformance Flags

The generate command exposes a set of flags that control how diagnostic messages (errors, warnings, and style hints) are reported. These are useful for integrating opcua-modeler into CI pipelines or enforcing stricter model quality standards.

Diagnostic levels

The tool produces three categories of diagnostics:

Code prefixSeverityShown by defaultDescription
DSL-E-*Error✅ AlwaysMust be fixed — invalid or illegal model construct. Causes non-zero exit code.
DSL-W-*Warning✅ YesPotentially incorrect. Does not fail the build by default.
DSL-I-*Info❌ NoStyle / conformance hints. Hidden unless --style is set.

Flags

--quiet / -q

Suppress all DSL-W-* warning messages. Errors are still shown.

opcua-modeler generate -i model.yaml --quiet

Use this when you want clean output in CI and warnings are already known / accepted.


--strict

Escalate all DSL-W-* warnings to errors. The command exits with a non-zero code if any warning is produced.

opcua-modeler generate -i model.yaml --strict

Recommended for CI pipelines where you want to enforce zero-warning models.


--style

Show DSL-I-* info-level conformance hints. These are hidden by default as they are style suggestions rather than correctness issues.

opcua-modeler generate -i model.yaml --style

--silence <code>

Suppress a specific diagnostic code or prefix. Can be repeated.

# Suppress a single code
opcua-modeler generate -i model.yaml --silence DSL-W-042

# Suppress all warnings of a category (prefix match)
opcua-modeler generate -i model.yaml --silence DSL-W

# Suppress multiple codes
opcua-modeler generate -i model.yaml --silence DSL-W-042 --silence DSL-I-010

Useful when a specific warning is expected and intentional in your model.


--show-yaml-path

Print the YAML path (e.g. objectTypes[0].components[2].browseName) alongside each diagnostic message. Helps locate the exact YAML node responsible for an error when the model is large.

opcua-modeler generate -i model.yaml --show-yaml-path

Combining flags

# CI: strict mode, suppress one known acceptable warning
opcua-modeler generate -i model.yaml --strict --silence DSL-W-010

# Debugging: all diagnostics including style hints, with YAML paths
opcua-modeler generate -i model.yaml --style --show-yaml-path

Exit codes

ConditionExit code
Success, no errors0
One or more DSL-E-* errors1
One or more warnings (with --strict)1
YAML parse error1