Model validation output from CLI

This note is about the example at https://docs.sensmetry.com/automator/first_example.html#automator-first-example .

The text reads:

Model Validation

Before working with the model, it’s important to validate it. To validate your model, open a terminal in the directory containing your model and run:

python -m syside check example_model.sysml

This command will check for any semantic errors or warnings in your model. After running, you should see the following output:

Checks passed!

While the python invocation works, no output is produced the “Checks passed!” does not occur.

To ensure I was actually having the check executed, I made some errors in the file

part Chassis {

part Suspension : xxxMechanical;

part Body : Mechanical;

}

and the python -m syside check example_model.sysml invocation returned:

python -m syside check example_model.sysml
example_model.sysml:12:29: ←[38;2;220;080;080merror←[0m (reference-error): No Type named 'xxxMechanical' found.
12 |           part Suspension : xxxMechanical;
   |                             ←[38;2;220;080;080m^^^^^^^^^^^^^←[0m

Which was expected. Does the web page need updating or is there some user error that suppressed the “Checks passed!” message?

Cheers,

Richard Wallace

Hi Richard,

Thanks for the suggestion. Indeed, there is currently no default output on success, while failures only print diagnostics. Success and failure are determined by the exit code instead. Otherwise, you can pass -s/--stats option to print per file diagnostic counts and totals.

I will add a minimal output for the next release.

Hi Daumantas,

Try as I might, I don’t see a way to pass “-s/–stats” from the CLI. Could you please expand your answer to show this as a complete command line? Thank you.

It is a CLI option, e.g.

syside check --stats

It can be passed anywhere on the command line, before, after, or in between positional paths.

Thank you Daumantas,

What was tripping me up was the -s/ in the original reply. I didn’t realize you meant for the trailing slash as an “or” between the two. From CLI Commands , the option after check was either-s, or --stats. I’ve verified that this does work. Best to point to that web page for answers to silly CLI questions, like mine.

Also note that the output from the command is using ANSI terminal encoding. It would be best to document that for the CLI.

For Windows systems, the command, as administrator, would be:

REG ADD HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1

There is a --color no option which does not use the ANSI encoding which would preclude the Windows Registry edit.

Cheers,
Richard

Up to date help is also available on the CLI through either syside <command>... -h/--help or syside help <command>....

Technically, the colour output is chosen automatically based on what the standard streams point to, e.g. coloured if stdout is a terminal (TTY), and plain text otherwise.