Check command

Validates models for semantic errors and warnings. This is the command a pipeline runs to keep a broken model out of review: point it at files, directories or glob patterns, and it reports what it finds. With --warnings-as-errors a warning is enough to fail the run.

Basic usage

  • Validate specific files

    syside check /path/to/analyzed_model.sysml /path/to/analyzed_model_2.sysml
    
  • Validate all files in current directory recursively

    syside check
    

    Note

    When using syside check without explicitly listing out the files, Syside ignores hidden files and files from hidden directories (starting with ., e.g. .venv or .git). To analyze files from these directories, list them explicitly.

  • Validate files matching a glob pattern

    syside check "models/**/*.sysml"
    

    Path arguments can be files, directories, or glob patterns (*, **, ?, {a,b}, [a-z]), mixed freely. Every syside command discovers files with the same rules.

Output

If Syside does not find any errors or warnings, there will be no output. If Syside does find anything, the output will look similar to this:

/path/to/analyzed_model.sysml:5:28: error (type-error): 'Non-Conforming Types 1'::a does not conform to ScalarValues::String
   5 |     attribute b : String = a;
     |                            ^
/path/to/analyzed_model.sysml:12:30: error (type-error): ScalarValues::Integer does not conform to ScalarValues::Positive
   12 |     attribute b : Positive = -42;
      |                              ^^^
/path/to/analyzed_model.sysml:30:27: error (type-error): Collect::A does not conform to Collect::B
   30 |     attribute b : B [*] = (1..10)->collect { in attribute x : Positive; new A(x) };
      |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/path/to/analyzed_model.sysml:38:34: error (type-error): ScalarValues::Integer does not conform to ScalarValues::Positive
   38 |     attribute b : Positive [*] = (-1..10)->select { true };
      |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^

The output contains the source file path, line number, character number, diagnostic code, message, and code snippet.

Available options

Option

Description

-h, --help

Display the help message with all available flags and short descriptions

-d, --diagnose <VALUE>

Choose which files to validate: project (default, does not validate external libraries or standard library), external (also validates external libraries), all (also validates standard library), none (skip validation)

--warnings-as-errors

Treat warnings as errors, exiting with a non-zero code if any warning is found

-q, --quiet

Suppress main output

-s, --stats

Print all analyzed files and the number of diagnostics found in each

-t, --time

Print how long analysis took per file. Combine with --stats

-c, --colour <VALUE>

Colorize output: auto (default), yes, no

-o, --output <OUTPUT>

Write --stats / --time results to a file

--config <FILE>

Path to a syside.toml configuration file

-j <THREADS>

Concurrency level, 1 to 8 (default: 4)

-i, --include <PATTERN>

Additional paths to include as external libraries

-e, --exclude <PATTERN>

Paths or glob patterns to exclude from analysis

--sysand-dir <DIRECTORY>

Path to a .sysand directory. Defaults to <root>/.sysand, or .sysand in the current directory if no project root is found

--std <DIRECTORY>

Path to the sysml.library standard library directory. If omitted, Syside uses its bundled standard library

--crash-reports <ACTION>

Automatic crash report handling: ignore (default) or upload. More information at What data we collect

Usage examples

Run validation in CI/CD pipeline:

syside check