sysml-validate 0.10.15 → 0.10.16
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/README.md +18 -8
- package/out/main.js +12 -7
- package/out/main.js.map +2 -2
- package/package.json +4 -4
- package/resources/sysml.dimension-table.json +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ sysml-validate [paths...] [options]
|
|
|
43
43
|
--max-warnings <n> Fail when more than n warnings are reported.
|
|
44
44
|
--all Report informational notices and hints too.
|
|
45
45
|
--lint-profile <p> Override sysml.lint.profile: default | quiet | strict.
|
|
46
|
-
--workspace <path>
|
|
46
|
+
--workspace <path> Index this project for cross-file reference resolution.
|
|
47
47
|
--no-config Ignore .vscode/settings.json and .vscode/sysml/project.json.
|
|
48
48
|
--library <path> Standard-library directory (default: the bundled library).
|
|
49
49
|
--color, --no-color Force ANSI colour on or off (default: on a terminal only).
|
|
@@ -51,7 +51,10 @@ sysml-validate [paths...] [options]
|
|
|
51
51
|
|
|
52
52
|
Paths may be files or directories; directories are searched recursively for
|
|
53
53
|
`.sysml` and `.kerml`, skipping `node_modules`, VCS directories, build output,
|
|
54
|
-
and vendored library trees. With no path, the working directory is checked.
|
|
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.
|
|
55
58
|
|
|
56
59
|
The OMG standard library ships with the package, so `Real`, `ISQ::*`, `SI::*`
|
|
57
60
|
and the rest resolve with nothing else installed.
|
|
@@ -112,14 +115,21 @@ $ sysml-validate models/ --format json | jq '.counts, .diagnostics[0].code'
|
|
|
112
115
|
$ sysml-validate models/ --max-warnings 5 && echo "model is publishable"
|
|
113
116
|
```
|
|
114
117
|
|
|
115
|
-
**Check just what changed**,
|
|
118
|
+
**Check just what changed**, without loading any model outside that list:
|
|
116
119
|
|
|
117
120
|
```console
|
|
118
|
-
$ git diff --name-only --diff-filter=d origin/main | grep -E '\.(sysml|kerml)$' | xargs -r sysml-validate
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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.
|
|
123
133
|
|
|
124
134
|
**Use it from a coding agent.** The default output is plain text with a stable
|
|
125
135
|
one-line summary, so an agent can act on it directly:
|
package/out/main.js
CHANGED
|
@@ -8898,7 +8898,9 @@ Usage:
|
|
|
8898
8898
|
sysml-validate [paths...] [options]
|
|
8899
8899
|
|
|
8900
8900
|
Paths may be files or directories; directories are searched recursively for
|
|
8901
|
-
.sysml and .kerml files.
|
|
8901
|
+
.sysml and .kerml files. Validation never discovers model files outside those
|
|
8902
|
+
paths unless --workspace is supplied. With no path, the working directory is
|
|
8903
|
+
checked.
|
|
8902
8904
|
|
|
8903
8905
|
Options:
|
|
8904
8906
|
--format <fmt> ${REPORT_FORMATS.join(" | ")} (default: text).
|
|
@@ -8909,7 +8911,7 @@ Options:
|
|
|
8909
8911
|
--max-warnings <n> Fail when more than n warnings are reported.
|
|
8910
8912
|
--all Report informational notices and hints too.
|
|
8911
8913
|
--lint-profile <p> Override sysml.lint.profile: ${LINT_PROFILES.join(" | ")}.
|
|
8912
|
-
--workspace <path>
|
|
8914
|
+
--workspace <path> Index this project for cross-file reference resolution.
|
|
8913
8915
|
--no-config Ignore .vscode/settings.json and .vscode/sysml/project.json.
|
|
8914
8916
|
--library <path> Standard-library directory (default: the bundled library).
|
|
8915
8917
|
--color, --no-color Force ANSI colour on or off (default: on a terminal only).
|
|
@@ -8923,6 +8925,7 @@ Exit codes:
|
|
|
8923
8925
|
|
|
8924
8926
|
Examples:
|
|
8925
8927
|
sysml-validate model.sysml
|
|
8928
|
+
sysml-validate model.sysml --workspace .
|
|
8926
8929
|
sysml-validate models/ --strict
|
|
8927
8930
|
sysml-validate . --format sarif --out sysml.sarif
|
|
8928
8931
|
sysml-validate . --format github # inline annotations in a workflow log
|
|
@@ -68346,14 +68349,16 @@ function applySettings(settings, lintProfileOverride) {
|
|
|
68346
68349
|
}
|
|
68347
68350
|
async function runValidation(command) {
|
|
68348
68351
|
const files = collectModelFiles(command.paths);
|
|
68349
|
-
const
|
|
68352
|
+
const workspaceRoot = command.workspace === void 0 ? void 0 : path10.resolve(command.workspace);
|
|
68353
|
+
const root3 = workspaceRoot ?? findWorkspaceRoot(files[0] ?? command.paths[0] ?? ".");
|
|
68350
68354
|
applySettings(command.noConfig ? {} : sysmlSettings(root3), command.lintProfile);
|
|
68351
68355
|
const services = await bootServices({
|
|
68352
68356
|
fromDir: path10.dirname(fileURLToPath(import.meta.url)),
|
|
68353
68357
|
library: command.library,
|
|
68354
|
-
//
|
|
68355
|
-
//
|
|
68356
|
-
workspaceFolders: [root3]
|
|
68358
|
+
// A validator invocation is scoped exactly to the paths the user named.
|
|
68359
|
+
// Project-wide discovery is an explicit opt-in through --workspace.
|
|
68360
|
+
workspaceFolders: [root3],
|
|
68361
|
+
skipWorkspaceIndex: workspaceRoot === void 0
|
|
68357
68362
|
});
|
|
68358
68363
|
const documents = [];
|
|
68359
68364
|
for (const file of files) documents.push(await services.document(file));
|
|
@@ -68370,7 +68375,7 @@ async function runValidation(command) {
|
|
|
68370
68375
|
}
|
|
68371
68376
|
|
|
68372
68377
|
// src/main.ts
|
|
68373
|
-
var VERSION2 = true ? "0.10.
|
|
68378
|
+
var VERSION2 = true ? "0.10.16" : "dev";
|
|
68374
68379
|
async function main(argv) {
|
|
68375
68380
|
const command = parseArgs(argv);
|
|
68376
68381
|
if (command.kind === "help") {
|