@geonosis/lint-parity 2.9.0 → 2.10.0
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/CHANGELOG.md +11 -0
- package/dist/{chunk-OQSXP7ZK.js → chunk-DFAXDNDR.js} +10 -6
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/parity-cli.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @geonosis/lint-parity
|
|
2
2
|
|
|
3
|
+
## 2.10.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3863c79: `--expect-changed` sees a rule whose findings moved, not only one whose count changed.
|
|
8
|
+
|
|
9
|
+
The corpus claim compared per-rule finding counts, so a rule rewritten to fire twice in new places
|
|
10
|
+
where it used to fire twice in old ones read as unchanged and the claim was reported unproven. It
|
|
11
|
+
now compares where each rule fired — `path:line:col`, without the message, so a reworded finding is
|
|
12
|
+
still the same finding.
|
|
13
|
+
|
|
3
14
|
## 2.9.0
|
|
4
15
|
|
|
5
16
|
## 2.8.0
|
|
@@ -148,6 +148,7 @@ ${output.trim()}`);
|
|
|
148
148
|
}
|
|
149
149
|
return findings;
|
|
150
150
|
};
|
|
151
|
+
var PLACE = /^(.+?:\d+:\d+):/;
|
|
151
152
|
var UNATTRIBUTED = "(unattributed)";
|
|
152
153
|
var ruleOf = (line) => RULE_IN_LINE.exec(line)?.[1] ?? UNATTRIBUTED;
|
|
153
154
|
var asFile = (lines) => lines.length === 0 ? "" : `${lines.join("\n")}
|
|
@@ -333,7 +334,7 @@ var corpusOf = ({
|
|
|
333
334
|
const root = mkdtempSync(join2(tmpdir(), "geonosis-corpus-"));
|
|
334
335
|
const here = join2(root, "corpus");
|
|
335
336
|
const foundIn = (config, side) => {
|
|
336
|
-
const
|
|
337
|
+
const places = /* @__PURE__ */ new Map();
|
|
337
338
|
for (const finding of readRun(
|
|
338
339
|
lint({
|
|
339
340
|
config,
|
|
@@ -346,9 +347,10 @@ var corpusOf = ({
|
|
|
346
347
|
side
|
|
347
348
|
)) {
|
|
348
349
|
const rule = ruleIdOf(finding);
|
|
349
|
-
|
|
350
|
+
const place = PLACE.exec(finding)?.[1] ?? finding;
|
|
351
|
+
places.set(rule, [...places.get(rule) ?? [], place]);
|
|
350
352
|
}
|
|
351
|
-
return
|
|
353
|
+
return places;
|
|
352
354
|
};
|
|
353
355
|
let inA = /* @__PURE__ */ new Map();
|
|
354
356
|
let inB = /* @__PURE__ */ new Map();
|
|
@@ -362,10 +364,12 @@ var corpusOf = ({
|
|
|
362
364
|
const configured = [.../* @__PURE__ */ new Set([...rulesNamedBy(configA), ...rulesNamedBy(configB)])].toSorted();
|
|
363
365
|
const off = [.../* @__PURE__ */ new Set([...rulesTurnedOffBy(configA), ...rulesTurnedOffBy(configB)])].filter((rule) => !configured.includes(rule)).toSorted();
|
|
364
366
|
const reach = configured.filter((rule) => exercised.has(rule)).map((rule) => {
|
|
365
|
-
const
|
|
366
|
-
const
|
|
367
|
+
const placesA = (inA.get(rule) ?? []).toSorted();
|
|
368
|
+
const placesB = (inB.get(rule) ?? []).toSorted();
|
|
369
|
+
const foundInA = placesA.length;
|
|
370
|
+
const foundInB = placesB.length;
|
|
367
371
|
return {
|
|
368
|
-
changed:
|
|
372
|
+
changed: placesA.join("\n") !== placesB.join("\n"),
|
|
369
373
|
firedInA: foundInA > 0,
|
|
370
374
|
firedInB: foundInB > 0,
|
|
371
375
|
foundInA,
|
package/dist/index.d.ts
CHANGED
|
@@ -59,8 +59,9 @@ declare const formatSummary: (parity: Parity) => string;
|
|
|
59
59
|
type RuleReach = {
|
|
60
60
|
/**
|
|
61
61
|
* The corpus saw this rule behave differently under the two configs — it started firing, stopped
|
|
62
|
-
* firing, or fired a different
|
|
63
|
-
*
|
|
62
|
+
* firing, or fired in a different set of places. A PLACE, not a count: #9 rewrote a rule that fired
|
|
63
|
+
* twice on the base build and twice on the new one, on files with nothing in common, and comparing
|
|
64
|
+
* counts read that as untouched. What a release CLAIMS about a rule is checked against this.
|
|
64
65
|
*/
|
|
65
66
|
changed: boolean;
|
|
66
67
|
firedInA: boolean;
|
package/dist/index.js
CHANGED
package/dist/parity-cli.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geonosis/lint-parity",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
5
|
"description": "Findings parity and rule reach over any two oxlint configs — the diff a fork is deleted on.",
|
|
6
6
|
"keywords": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@geonosis/ratchet": "2.
|
|
48
|
+
"@geonosis/ratchet": "2.10.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup",
|