flashtrace 0.11.0 → 0.11.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/dist/flashtrace.mjs +15 -8
- package/package.json +1 -1
package/dist/flashtrace.mjs
CHANGED
|
@@ -1110,13 +1110,15 @@ function renderDefective(defective, out, style, dimLocation) {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
function renderSummary(summary, out, style) {
|
|
1112
1112
|
const originBreakdown = style.dim(`(${summary.specItems} from specs, ${summary.codeItems} from code)`);
|
|
1113
|
+
const coverageBreakdown = summary.shallowCoveredItems ? " " + style.dim(
|
|
1114
|
+
`(${summary.okItems - summary.shallowCoveredItems} deep-covered, ${summary.shallowCoveredItems} only shallow-covered)`
|
|
1115
|
+
) : "";
|
|
1113
1116
|
out.push(
|
|
1114
1117
|
style.bold("Summary"),
|
|
1115
1118
|
` items ${summary.items} ${originBreakdown}`,
|
|
1116
|
-
` ok ${style.green(String(summary.okItems))}`,
|
|
1119
|
+
` ok ${style.green(String(summary.okItems))}${coverageBreakdown}`,
|
|
1117
1120
|
` defective ${summary.defectiveItems ? style.red(String(summary.defectiveItems)) : "0"}`
|
|
1118
1121
|
);
|
|
1119
|
-
if (summary.shallowCoveredItems) out.push(" " + style.dim(`of the ok items, ${summary.shallowCoveredItems} are only shallow-covered (an item further down the tracing chain is defective)`));
|
|
1120
1122
|
if (summary.problems) out.push(` problems ${style.yellow(String(summary.problems))}`);
|
|
1121
1123
|
out.push("");
|
|
1122
1124
|
}
|
|
@@ -1235,14 +1237,14 @@ Options:
|
|
|
1235
1237
|
-t, --tags <t1,t2,...> only import spec items carrying one of these
|
|
1236
1238
|
tags; add "_" to also include untagged items
|
|
1237
1239
|
-f, --format <format> report format: "text" (default) or "json"; --json
|
|
1238
|
-
is shorthand for --format json
|
|
1239
|
-
selected only once
|
|
1240
|
+
is shorthand for --format json
|
|
1240
1241
|
-v, --verbose list every item with its coverage status and trace
|
|
1241
1242
|
edges, not only the defective ones; text format only
|
|
1242
1243
|
-V, --version print the version number
|
|
1243
1244
|
-h, --help show this help
|
|
1244
1245
|
|
|
1245
1246
|
Long options also accept "="-attached values, e.g. --tags=a,b.
|
|
1247
|
+
The report format and the tag filter may each be selected only once.
|
|
1246
1248
|
|
|
1247
1249
|
Exit codes: 0 clean, 1 defects or problems found, 2 usage error`;
|
|
1248
1250
|
function packageVersion() {
|
|
@@ -1256,11 +1258,15 @@ function splitLongOption(token) {
|
|
|
1256
1258
|
function rejectValue(name, inline) {
|
|
1257
1259
|
if (inline !== void 0) throw new UsageError(`option ${name} does not take a value`);
|
|
1258
1260
|
}
|
|
1261
|
+
function selectOnce(opts, raw, setting, subject) {
|
|
1262
|
+
const selectedBy = opts.selectedBy.get(setting);
|
|
1263
|
+
if (selectedBy !== void 0)
|
|
1264
|
+
throw new UsageError(`${subject} is already selected by ${selectedBy}`);
|
|
1265
|
+
opts.selectedBy.set(setting, raw);
|
|
1266
|
+
}
|
|
1259
1267
|
function selectFormat(opts, raw, format) {
|
|
1260
|
-
|
|
1261
|
-
throw new UsageError(`the report format is already selected by ${opts.formatSelectedBy}`);
|
|
1268
|
+
selectOnce(opts, raw, "format", "the report format");
|
|
1262
1269
|
opts.format = format;
|
|
1263
|
-
opts.formatSelectedBy = raw;
|
|
1264
1270
|
}
|
|
1265
1271
|
function reportFormat(raw, value) {
|
|
1266
1272
|
if (value !== "text" && value !== "json")
|
|
@@ -1298,6 +1304,7 @@ function setFormat(opts, raw, value) {
|
|
|
1298
1304
|
selectFormat(opts, raw, reportFormat(raw, value));
|
|
1299
1305
|
}
|
|
1300
1306
|
function setTags(opts, raw, value) {
|
|
1307
|
+
selectOnce(opts, raw, "tags", "the tag filter");
|
|
1301
1308
|
opts.tags = value.split(",").map((tag) => tag.trim()).filter(Boolean);
|
|
1302
1309
|
}
|
|
1303
1310
|
var VALUED_OPTIONS = /* @__PURE__ */ new Map([
|
|
@@ -1305,7 +1312,7 @@ var VALUED_OPTIONS = /* @__PURE__ */ new Map([
|
|
|
1305
1312
|
["--tags", setTags]
|
|
1306
1313
|
]);
|
|
1307
1314
|
function parseArgs(argv) {
|
|
1308
|
-
const opts = { dirs: [], tags: null, verbose: false, format: "text",
|
|
1315
|
+
const opts = { dirs: [], tags: null, verbose: false, format: "text", selectedBy: /* @__PURE__ */ new Map() };
|
|
1309
1316
|
for (let i = 0; i < argv.length; i++) {
|
|
1310
1317
|
const [raw, inline] = splitLongOption(argv[i]);
|
|
1311
1318
|
const name = LONG_ALIAS[raw] ?? raw;
|