sysml-validate 0.11.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -27
- package/README.md +200 -200
- package/out/main.js +596 -141
- package/out/main.js.map +4 -4
- package/package.json +57 -57
- package/resources/sysml.dimension-table.json +1 -1
- package/resources/sysml.library/Domain Libraries/Analysis/.meta.json +9 -9
- package/resources/sysml.library/Domain Libraries/Analysis/.project.json +26 -26
- package/resources/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +33 -33
- package/resources/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +118 -118
- package/resources/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -143
- package/resources/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +170 -170
- package/resources/sysml.library/Domain Libraries/Cause and Effect/.meta.json +7 -7
- package/resources/sysml.library/Domain Libraries/Cause and Effect/.project.json +22 -22
- package/resources/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +82 -82
- package/resources/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -81
- package/resources/sysml.library/Domain Libraries/Geometry/.meta.json +7 -7
- package/resources/sysml.library/Domain Libraries/Geometry/.project.json +26 -26
- package/resources/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +898 -898
- package/resources/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +167 -167
- package/resources/sysml.library/Domain Libraries/Metadata/.meta.json +9 -9
- package/resources/sysml.library/Domain Libraries/Metadata/.project.json +18 -18
- package/resources/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +77 -77
- package/resources/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +142 -142
- package/resources/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +38 -38
- package/resources/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +99 -99
- package/resources/sysml.library/Domain Libraries/Quantities and Units/.meta.json +28 -28
- package/resources/sysml.library/Domain Libraries/Quantities and Units/.project.json +22 -22
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -42
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -439
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -2726
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -206
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -1991
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -1353
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -1223
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -2333
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -958
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -1537
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -1564
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -1169
- package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -1256
- package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -30
- package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -526
- package/resources/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -107
- package/resources/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -70
- package/resources/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -378
- package/resources/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -48
- package/resources/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +49 -49
- package/resources/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -274
- package/resources/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -260
- package/resources/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -62
- package/resources/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +7 -7
- package/resources/sysml.library/Domain Libraries/Requirement Derivation/.project.json +18 -18
- package/resources/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +62 -62
- package/resources/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +38 -38
- package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +8 -8
- package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +10 -10
- package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +176 -176
- package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -23
- package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +63 -63
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +22 -22
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +14 -14
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +79 -79
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -22
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -68
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -47
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +116 -116
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +42 -42
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -43
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -27
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +42 -42
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +153 -153
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -49
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -56
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +32 -32
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +110 -110
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -25
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +34 -34
- package/resources/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +272 -272
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +21 -21
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +14 -14
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +94 -94
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +155 -155
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +134 -134
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +189 -189
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -483
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +66 -66
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +57 -57
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -212
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +160 -160
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -992
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +292 -292
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +196 -196
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +144 -144
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +280 -280
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +65 -65
- package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +187 -187
- package/resources/sysml.library/LICENSE +276 -276
- package/resources/sysml.library/NOTICE.md +20 -20
- package/resources/sysml.library/Systems Library/Actions.sysml +556 -556
- package/resources/sysml.library/Systems Library/Allocations.sysml +28 -28
- package/resources/sysml.library/Systems Library/AnalysisCases.sysml +37 -37
- package/resources/sysml.library/Systems Library/Attributes.sysml +24 -24
- package/resources/sysml.library/Systems Library/Calculations.sysml +36 -36
- package/resources/sysml.library/Systems Library/Cases.sysml +70 -70
- package/resources/sysml.library/Systems Library/Connections.sysml +59 -59
- package/resources/sysml.library/Systems Library/Constraints.sysml +43 -43
- package/resources/sysml.library/Systems Library/Flows.sysml +125 -125
- package/resources/sysml.library/Systems Library/Interfaces.sysml +88 -88
- package/resources/sysml.library/Systems Library/Items.sysml +152 -152
- package/resources/sysml.library/Systems Library/Metadata.sysml +31 -31
- package/resources/sysml.library/Systems Library/Parts.sysml +80 -80
- package/resources/sysml.library/Systems Library/Ports.sysml +53 -53
- package/resources/sysml.library/Systems Library/Requirements.sysml +193 -193
- package/resources/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -123
- package/resources/sysml.library/Systems Library/States.sysml +102 -102
- package/resources/sysml.library/Systems Library/SysML.sysml +539 -539
- package/resources/sysml.library/Systems Library/UseCases.sysml +56 -56
- package/resources/sysml.library/Systems Library/VerificationCases.sysml +102 -102
- package/resources/sysml.library/Systems Library/Views.sysml +163 -163
- package/resources/sysml.library.index.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
SysML v2 Visual Studio Code Extension
|
|
2
|
-
Freeware License
|
|
3
|
-
|
|
4
|
-
Copyright (c) 2026 C. Ilie
|
|
5
|
-
|
|
6
|
-
Permission is granted to install and use this software free of charge.
|
|
7
|
-
|
|
8
|
-
The software is licensed, not sold.
|
|
9
|
-
|
|
10
|
-
You may:
|
|
11
|
-
- Use the software for personal purposes.
|
|
12
|
-
- Use the software for educational purposes.
|
|
13
|
-
- Use the software for commercial purposes.
|
|
14
|
-
|
|
15
|
-
You may not:
|
|
16
|
-
- Modify the software.
|
|
17
|
-
- Reverse engineer the software except where required by law.
|
|
18
|
-
- Redistribute the software.
|
|
19
|
-
- Sublicense the software.
|
|
20
|
-
- Sell the software.
|
|
21
|
-
- Create derivative works.
|
|
22
|
-
|
|
23
|
-
All intellectual property rights remain with the copyright holder.
|
|
24
|
-
|
|
25
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|
|
26
|
-
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
|
|
27
|
-
DAMAGES OR OTHER LIABILITY ARISING FROM THE USE OF THE SOFTWARE.
|
|
1
|
+
SysML v2 Visual Studio Code Extension
|
|
2
|
+
Freeware License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 C. Ilie
|
|
5
|
+
|
|
6
|
+
Permission is granted to install and use this software free of charge.
|
|
7
|
+
|
|
8
|
+
The software is licensed, not sold.
|
|
9
|
+
|
|
10
|
+
You may:
|
|
11
|
+
- Use the software for personal purposes.
|
|
12
|
+
- Use the software for educational purposes.
|
|
13
|
+
- Use the software for commercial purposes.
|
|
14
|
+
|
|
15
|
+
You may not:
|
|
16
|
+
- Modify the software.
|
|
17
|
+
- Reverse engineer the software except where required by law.
|
|
18
|
+
- Redistribute the software.
|
|
19
|
+
- Sublicense the software.
|
|
20
|
+
- Sell the software.
|
|
21
|
+
- Create derivative works.
|
|
22
|
+
|
|
23
|
+
All intellectual property rights remain with the copyright holder.
|
|
24
|
+
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|
|
26
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
|
|
27
|
+
DAMAGES OR OTHER LIABILITY ARISING FROM THE USE OF THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,200 +1,200 @@
|
|
|
1
|
-
# sysml-validate
|
|
2
|
-
|
|
3
|
-
Headless SysML v2 / KerML validation. Runs the same parser, linker, and
|
|
4
|
-
diagnostics as the
|
|
5
|
-
[SysML v2 VS Code extension](https://marketplace.visualstudio.com/items?itemName=voidaliot.vscode-sysml-v2)
|
|
6
|
-
— the Problems panel, in a terminal or a CI job. No VS Code, no browser, no
|
|
7
|
-
display server.
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npx sysml-validate models/
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
models/control.sysml
|
|
15
|
-
2:5 error SYN067 Import visibility is required by the Release syntax; use 'private import' unless re-export is intended.
|
|
16
|
-
|
|
17
|
-
models/vehicle.sysml
|
|
18
|
-
12:23 error RES001 Could not resolve reference to Element named 'Engien'.
|
|
19
|
-
|
|
20
|
-
✖ 2 problems (2 errors) in 2 of 2 files
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
…and when the model is healthy:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
✓ 2 files checked, no problems found
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Colour is used on a terminal and dropped everywhere else — a pipe, a log file,
|
|
30
|
-
or a coding agent's chat window gets exactly the plain text above. `--color` and
|
|
31
|
-
`--no-color` force it either way, and `NO_COLOR` is honoured.
|
|
32
|
-
|
|
33
|
-
## Usage
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
sysml-validate [paths...] [options]
|
|
37
|
-
|
|
38
|
-
--format <fmt> text | compact | json | sarif | github (default: text).
|
|
39
|
-
text grouped and aligned, colour on a terminal
|
|
40
|
-
compact file:line:col: severity [CODE]: message
|
|
41
|
-
--out <path> Write the report to a file instead of stdout.
|
|
42
|
-
--strict Fail on warnings as well as errors.
|
|
43
|
-
--max-warnings <n> Fail when more than n warnings are reported.
|
|
44
|
-
--all Report informational notices and hints too.
|
|
45
|
-
--lint-profile <p> Override sysml.lint.profile: default | quiet | strict.
|
|
46
|
-
--workspace <path> Index this project for cross-file reference resolution.
|
|
47
|
-
--no-config Ignore .vscode/settings.json and .vscode/sysml/project.json.
|
|
48
|
-
--library <path> Standard-library directory (default: the bundled library).
|
|
49
|
-
--color, --no-color Force ANSI colour on or off (default: on a terminal only).
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Paths may be files or directories; directories are searched recursively for
|
|
53
|
-
`.sysml` and `.kerml`, skipping `node_modules`, VCS directories, build output,
|
|
54
|
-
and vendored library trees. With no path, the working directory is checked.
|
|
55
|
-
By default, no model file outside the paths you name is discovered or indexed.
|
|
56
|
-
Use `--workspace <path>` only when references should resolve against other
|
|
57
|
-
project files.
|
|
58
|
-
|
|
59
|
-
The OMG standard library ships with the package, so `Real`, `ISQ::*`, `SI::*`
|
|
60
|
-
and the rest resolve with nothing else installed.
|
|
61
|
-
|
|
62
|
-
## Examples
|
|
63
|
-
|
|
64
|
-
**Check one file while you work.** Paths, positions, severity, and the
|
|
65
|
-
diagnostic code — everything needed to jump to the problem:
|
|
66
|
-
|
|
67
|
-
```console
|
|
68
|
-
$ sysml-validate models/vehicle.sysml
|
|
69
|
-
models/vehicle.sysml
|
|
70
|
-
12:23 error RES001 Could not resolve reference to Element named 'Engien'.
|
|
71
|
-
|
|
72
|
-
✖ 1 problem (1 error) in 1 of 1 file
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**See the advisory notices too.** Hints and info are out of the way by default —
|
|
76
|
-
`--all` brings them in:
|
|
77
|
-
|
|
78
|
-
```console
|
|
79
|
-
$ sysml-validate models/ --all
|
|
80
|
-
models/vehicle.sysml
|
|
81
|
-
5:19 hint RES016 'power' shadows a standard-library element of the same name; the library symbol is hidden in this scope.
|
|
82
|
-
16:21 hint SEM006 Requirement definition 'MassLimit' has no 'subject' declaration.
|
|
83
|
-
|
|
84
|
-
▲ 2 problems (2 hints) in 1 of 2 files
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
**One line per problem** for `grep`, an editor error matcher, or a coding agent
|
|
88
|
-
that wants to parse the output:
|
|
89
|
-
|
|
90
|
-
```console
|
|
91
|
-
$ sysml-validate models/ --format compact
|
|
92
|
-
models/control.sysml:2:5: error [SYN067]: Import visibility is required by the Release syntax; use 'private import' unless re-export is intended.
|
|
93
|
-
models/vehicle.sysml:12:23: error [RES001]: Could not resolve reference to Element named 'Engien'.
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Compact prints **nothing at all** on a clean run, so `[ -s report.txt ]` and
|
|
97
|
-
`if sysml-validate . --format compact | grep .` both behave.
|
|
98
|
-
|
|
99
|
-
**Structured output** for a script or a dashboard:
|
|
100
|
-
|
|
101
|
-
```console
|
|
102
|
-
$ sysml-validate models/ --format json | jq '.counts, .diagnostics[0].code'
|
|
103
|
-
{
|
|
104
|
-
"error": 2,
|
|
105
|
-
"warning": 0,
|
|
106
|
-
"info": 0,
|
|
107
|
-
"hint": 0
|
|
108
|
-
}
|
|
109
|
-
"SYN067"
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**Gate a commit hook** on errors, and allow a small warning budget:
|
|
113
|
-
|
|
114
|
-
```console
|
|
115
|
-
$ sysml-validate models/ --max-warnings 5 && echo "model is publishable"
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**Check just what changed**, without loading any model outside that list:
|
|
119
|
-
|
|
120
|
-
```console
|
|
121
|
-
$ git diff --name-only --diff-filter=d origin/main | grep -E '\.(sysml|kerml)$' | xargs -r sysml-validate
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
If those files need definitions elsewhere in the checkout, opt into workspace
|
|
125
|
-
indexing explicitly:
|
|
126
|
-
|
|
127
|
-
```console
|
|
128
|
-
$ git diff --name-only --diff-filter=d origin/main | grep -E '\.(sysml|kerml)$' | xargs -r sysml-validate --workspace .
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
`--workspace .` indexes the rest of the project for reference resolution, but
|
|
132
|
-
still reports diagnostics only for the files you named.
|
|
133
|
-
|
|
134
|
-
**Use it from a coding agent.** The default output is plain text with a stable
|
|
135
|
-
one-line summary, so an agent can act on it directly:
|
|
136
|
-
|
|
137
|
-
```console
|
|
138
|
-
$ sysml-validate models/ --format compact ; echo "exit=$?"
|
|
139
|
-
models/vehicle.sysml:12:23: error [RES001]: Could not resolve reference to Element named 'Engien'.
|
|
140
|
-
exit=1
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## Your project's configuration is honoured
|
|
144
|
-
|
|
145
|
-
The validator reads the settings your team commits, in the editor's own
|
|
146
|
-
precedence — `.vscode/settings.json` first, then `.vscode/sysml/project.json`:
|
|
147
|
-
|
|
148
|
-
| Setting | Effect |
|
|
149
|
-
|---|---|
|
|
150
|
-
| `sysml.lint.profile` | `default` / `quiet` / `strict` style-notice volume |
|
|
151
|
-
| `sysml.validation.severities` | Per-code severity overrides (e.g. `{ "SEM006": "warning" }`) |
|
|
152
|
-
| `sysml.diagnostics.unusedImports` | `off` / `warning` / `error` |
|
|
153
|
-
| `sysml.diagnostics.units` | UNIT001–UNIT005 dimensional analysis on/off |
|
|
154
|
-
|
|
155
|
-
`--lint-profile` overrides the profile for one run, and `--no-config` ignores
|
|
156
|
-
both files. Note that `sysml.validation.severities` covers the validator's own
|
|
157
|
-
codes; unresolved-reference errors (`RES001`) come from the linker and are
|
|
158
|
-
always errors.
|
|
159
|
-
|
|
160
|
-
## Exit codes
|
|
161
|
-
|
|
162
|
-
| Code | Meaning |
|
|
163
|
-
|---|---|
|
|
164
|
-
| `0` | no blocking diagnostics |
|
|
165
|
-
| `1` | errors, or warnings under `--strict` / `--max-warnings` |
|
|
166
|
-
| `2` | the command line or the environment was wrong (bad flag, unreadable path) |
|
|
167
|
-
|
|
168
|
-
Informational notices and hints never fail a run; they are only printed with
|
|
169
|
-
`--all`.
|
|
170
|
-
|
|
171
|
-
## GitHub Actions
|
|
172
|
-
|
|
173
|
-
Fail the build on model errors, with inline annotations on the diff:
|
|
174
|
-
|
|
175
|
-
```yaml
|
|
176
|
-
- uses: actions/setup-node@v4
|
|
177
|
-
with: { node-version: 20 }
|
|
178
|
-
|
|
179
|
-
- name: Validate the SysML model
|
|
180
|
-
run: npx sysml-validate models/ --format github --strict
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
Or upload SARIF so diagnostics land in **Security → Code scanning** and on the
|
|
184
|
-
pull request:
|
|
185
|
-
|
|
186
|
-
```yaml
|
|
187
|
-
- name: Validate the SysML model
|
|
188
|
-
run: npx sysml-validate models/ --format sarif --out sysml.sarif
|
|
189
|
-
continue-on-error: true
|
|
190
|
-
|
|
191
|
-
- uses: github/codeql-action/upload-sarif@v3
|
|
192
|
-
with:
|
|
193
|
-
sarif_file: sysml.sarif
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## License
|
|
197
|
-
|
|
198
|
-
The CLI uses the extension's Freeware License (see `LICENSE`). The vendored OMG
|
|
199
|
-
standard library under `resources/sysml.library` keeps its upstream OMG
|
|
200
|
-
LICENSE / LICENSE-GPL terms; see that directory's `NOTICE.md`.
|
|
1
|
+
# sysml-validate
|
|
2
|
+
|
|
3
|
+
Headless SysML v2 / KerML validation. Runs the same parser, linker, and
|
|
4
|
+
diagnostics as the
|
|
5
|
+
[SysML v2 VS Code extension](https://marketplace.visualstudio.com/items?itemName=voidaliot.vscode-sysml-v2)
|
|
6
|
+
— the Problems panel, in a terminal or a CI job. No VS Code, no browser, no
|
|
7
|
+
display server.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx sysml-validate models/
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
models/control.sysml
|
|
15
|
+
2:5 error SYN067 Import visibility is required by the Release syntax; use 'private import' unless re-export is intended.
|
|
16
|
+
|
|
17
|
+
models/vehicle.sysml
|
|
18
|
+
12:23 error RES001 Could not resolve reference to Element named 'Engien'.
|
|
19
|
+
|
|
20
|
+
✖ 2 problems (2 errors) in 2 of 2 files
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
…and when the model is healthy:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
✓ 2 files checked, no problems found
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Colour is used on a terminal and dropped everywhere else — a pipe, a log file,
|
|
30
|
+
or a coding agent's chat window gets exactly the plain text above. `--color` and
|
|
31
|
+
`--no-color` force it either way, and `NO_COLOR` is honoured.
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
sysml-validate [paths...] [options]
|
|
37
|
+
|
|
38
|
+
--format <fmt> text | compact | json | sarif | github (default: text).
|
|
39
|
+
text grouped and aligned, colour on a terminal
|
|
40
|
+
compact file:line:col: severity [CODE]: message
|
|
41
|
+
--out <path> Write the report to a file instead of stdout.
|
|
42
|
+
--strict Fail on warnings as well as errors.
|
|
43
|
+
--max-warnings <n> Fail when more than n warnings are reported.
|
|
44
|
+
--all Report informational notices and hints too.
|
|
45
|
+
--lint-profile <p> Override sysml.lint.profile: default | quiet | strict.
|
|
46
|
+
--workspace <path> Index this project for cross-file reference resolution.
|
|
47
|
+
--no-config Ignore .vscode/settings.json and .vscode/sysml/project.json.
|
|
48
|
+
--library <path> Standard-library directory (default: the bundled library).
|
|
49
|
+
--color, --no-color Force ANSI colour on or off (default: on a terminal only).
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Paths may be files or directories; directories are searched recursively for
|
|
53
|
+
`.sysml` and `.kerml`, skipping `node_modules`, VCS directories, build output,
|
|
54
|
+
and vendored library trees. With no path, the working directory is checked.
|
|
55
|
+
By default, no model file outside the paths you name is discovered or indexed.
|
|
56
|
+
Use `--workspace <path>` only when references should resolve against other
|
|
57
|
+
project files.
|
|
58
|
+
|
|
59
|
+
The OMG standard library ships with the package, so `Real`, `ISQ::*`, `SI::*`
|
|
60
|
+
and the rest resolve with nothing else installed.
|
|
61
|
+
|
|
62
|
+
## Examples
|
|
63
|
+
|
|
64
|
+
**Check one file while you work.** Paths, positions, severity, and the
|
|
65
|
+
diagnostic code — everything needed to jump to the problem:
|
|
66
|
+
|
|
67
|
+
```console
|
|
68
|
+
$ sysml-validate models/vehicle.sysml
|
|
69
|
+
models/vehicle.sysml
|
|
70
|
+
12:23 error RES001 Could not resolve reference to Element named 'Engien'.
|
|
71
|
+
|
|
72
|
+
✖ 1 problem (1 error) in 1 of 1 file
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**See the advisory notices too.** Hints and info are out of the way by default —
|
|
76
|
+
`--all` brings them in:
|
|
77
|
+
|
|
78
|
+
```console
|
|
79
|
+
$ sysml-validate models/ --all
|
|
80
|
+
models/vehicle.sysml
|
|
81
|
+
5:19 hint RES016 'power' shadows a standard-library element of the same name; the library symbol is hidden in this scope.
|
|
82
|
+
16:21 hint SEM006 Requirement definition 'MassLimit' has no 'subject' declaration.
|
|
83
|
+
|
|
84
|
+
▲ 2 problems (2 hints) in 1 of 2 files
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**One line per problem** for `grep`, an editor error matcher, or a coding agent
|
|
88
|
+
that wants to parse the output:
|
|
89
|
+
|
|
90
|
+
```console
|
|
91
|
+
$ sysml-validate models/ --format compact
|
|
92
|
+
models/control.sysml:2:5: error [SYN067]: Import visibility is required by the Release syntax; use 'private import' unless re-export is intended.
|
|
93
|
+
models/vehicle.sysml:12:23: error [RES001]: Could not resolve reference to Element named 'Engien'.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Compact prints **nothing at all** on a clean run, so `[ -s report.txt ]` and
|
|
97
|
+
`if sysml-validate . --format compact | grep .` both behave.
|
|
98
|
+
|
|
99
|
+
**Structured output** for a script or a dashboard:
|
|
100
|
+
|
|
101
|
+
```console
|
|
102
|
+
$ sysml-validate models/ --format json | jq '.counts, .diagnostics[0].code'
|
|
103
|
+
{
|
|
104
|
+
"error": 2,
|
|
105
|
+
"warning": 0,
|
|
106
|
+
"info": 0,
|
|
107
|
+
"hint": 0
|
|
108
|
+
}
|
|
109
|
+
"SYN067"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Gate a commit hook** on errors, and allow a small warning budget:
|
|
113
|
+
|
|
114
|
+
```console
|
|
115
|
+
$ sysml-validate models/ --max-warnings 5 && echo "model is publishable"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Check just what changed**, without loading any model outside that list:
|
|
119
|
+
|
|
120
|
+
```console
|
|
121
|
+
$ git diff --name-only --diff-filter=d origin/main | grep -E '\.(sysml|kerml)$' | xargs -r sysml-validate
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
If those files need definitions elsewhere in the checkout, opt into workspace
|
|
125
|
+
indexing explicitly:
|
|
126
|
+
|
|
127
|
+
```console
|
|
128
|
+
$ git diff --name-only --diff-filter=d origin/main | grep -E '\.(sysml|kerml)$' | xargs -r sysml-validate --workspace .
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
`--workspace .` indexes the rest of the project for reference resolution, but
|
|
132
|
+
still reports diagnostics only for the files you named.
|
|
133
|
+
|
|
134
|
+
**Use it from a coding agent.** The default output is plain text with a stable
|
|
135
|
+
one-line summary, so an agent can act on it directly:
|
|
136
|
+
|
|
137
|
+
```console
|
|
138
|
+
$ sysml-validate models/ --format compact ; echo "exit=$?"
|
|
139
|
+
models/vehicle.sysml:12:23: error [RES001]: Could not resolve reference to Element named 'Engien'.
|
|
140
|
+
exit=1
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Your project's configuration is honoured
|
|
144
|
+
|
|
145
|
+
The validator reads the settings your team commits, in the editor's own
|
|
146
|
+
precedence — `.vscode/settings.json` first, then `.vscode/sysml/project.json`:
|
|
147
|
+
|
|
148
|
+
| Setting | Effect |
|
|
149
|
+
|---|---|
|
|
150
|
+
| `sysml.lint.profile` | `default` / `quiet` / `strict` style-notice volume |
|
|
151
|
+
| `sysml.validation.severities` | Per-code severity overrides (e.g. `{ "SEM006": "warning" }`) |
|
|
152
|
+
| `sysml.diagnostics.unusedImports` | `off` / `warning` / `error` |
|
|
153
|
+
| `sysml.diagnostics.units` | UNIT001–UNIT005 dimensional analysis on/off |
|
|
154
|
+
|
|
155
|
+
`--lint-profile` overrides the profile for one run, and `--no-config` ignores
|
|
156
|
+
both files. Note that `sysml.validation.severities` covers the validator's own
|
|
157
|
+
codes; unresolved-reference errors (`RES001`) come from the linker and are
|
|
158
|
+
always errors.
|
|
159
|
+
|
|
160
|
+
## Exit codes
|
|
161
|
+
|
|
162
|
+
| Code | Meaning |
|
|
163
|
+
|---|---|
|
|
164
|
+
| `0` | no blocking diagnostics |
|
|
165
|
+
| `1` | errors, or warnings under `--strict` / `--max-warnings` |
|
|
166
|
+
| `2` | the command line or the environment was wrong (bad flag, unreadable path) |
|
|
167
|
+
|
|
168
|
+
Informational notices and hints never fail a run; they are only printed with
|
|
169
|
+
`--all`.
|
|
170
|
+
|
|
171
|
+
## GitHub Actions
|
|
172
|
+
|
|
173
|
+
Fail the build on model errors, with inline annotations on the diff:
|
|
174
|
+
|
|
175
|
+
```yaml
|
|
176
|
+
- uses: actions/setup-node@v4
|
|
177
|
+
with: { node-version: 20 }
|
|
178
|
+
|
|
179
|
+
- name: Validate the SysML model
|
|
180
|
+
run: npx sysml-validate models/ --format github --strict
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Or upload SARIF so diagnostics land in **Security → Code scanning** and on the
|
|
184
|
+
pull request:
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
- name: Validate the SysML model
|
|
188
|
+
run: npx sysml-validate models/ --format sarif --out sysml.sarif
|
|
189
|
+
continue-on-error: true
|
|
190
|
+
|
|
191
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
192
|
+
with:
|
|
193
|
+
sarif_file: sysml.sarif
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
The CLI uses the extension's Freeware License (see `LICENSE`). The vendored OMG
|
|
199
|
+
standard library under `resources/sysml.library` keeps its upstream OMG
|
|
200
|
+
LICENSE / LICENSE-GPL terms; see that directory's `NOTICE.md`.
|