@hailstails/hone 1.2.0 → 1.4.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/ADOPTING.md +6 -6
- package/CHANGELOG.md +38 -0
- package/MIGRATING.md +28 -5
- package/README.md +41 -14
- package/api/audit.d.ts +1 -1
- package/api/testing.js +3 -3
- package/chunks/chunk-335ITLPO.js +7 -0
- package/chunks/{chunk-5VXHQC4A.js → chunk-6SM3HKWO.js} +302 -637
- package/chunks/{chunk-PL2PNPAR.js → chunk-E6VR3VRV.js} +1 -6
- package/chunks/{chunk-H4V72FCW.js → chunk-FEWCJU7H.js} +9 -1
- package/chunks/chunk-WF3PPYRR.js +27 -0
- package/core/check/tool-command.js +797 -88
- package/core/mechanism-port/runner-result-types.d.ts +6 -0
- package/docs/adding-a-discipline-or-mechanism.md +4 -4
- package/docs/extending.md +5 -5
- package/docs/output-contract.md +60 -14
- package/mechanisms/audit/CD-27/test-body-logic.js +394 -46
- package/mechanisms/audit/runner/runner.js +1 -1
- package/mechanisms/audit/runner/typescript-parse.d.ts +2 -0
- package/mechanisms/audit/runner/walker-piece.d.ts +2 -1
- package/mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js +7 -4
- package/mechanisms/eslint/CD-10/cd10/cd10.eslint-plugin.js +21 -11
- package/mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js +15 -5
- package/mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js +7 -3
- package/mechanisms/eslint/CD-41/README.md +1 -1
- package/mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js +100 -28
- package/mechanisms/eslint/CD-42/cd42/cd42.eslint-plugin.js +8 -4
- package/mechanisms/eslint/CD-7/cd7/cd7.eslint-plugin.js +8 -4
- package/mechanisms/eslint/runner/README.md +10 -3
- package/mechanisms/eslint/runner/runner.js +1410 -1351
- package/methods/lenses/di-discipline.md +4 -5
- package/methods/lenses/test-discipline.md +1 -1
- package/package.json +1 -1
- package/rules/CD-1/CHECKS.md +2 -0
- package/rules/CD-10/CHECKS.md +2 -2
- package/rules/CD-12/README.md +1 -1
- package/rules/CD-14/CHECKS.md +2 -2
- package/rules/CD-15/CHECKS.md +4 -2
- package/rules/CD-17/CHECKS.md +2 -2
- package/rules/CD-17/README.md +3 -3
- package/rules/CD-19/CHECKS.md +2 -2
- package/rules/CD-2/CHECKS.md +4 -2
- package/rules/CD-23/CHECKS.md +2 -2
- package/rules/CD-25/CHECKS.md +3 -3
- package/rules/CD-25/README.md +3 -3
- package/rules/CD-26/CHECKS.md +2 -2
- package/rules/CD-27/CHECKS.md +384 -8
- package/rules/CD-27/README.md +1 -1
- package/rules/CD-27/discipline.json +130 -0
- package/rules/CD-3/CHECKS.md +2 -2
- package/rules/CD-40/CHECKS.md +2 -2
- package/rules/CD-41/CHECKS.md +12 -2
- package/rules/CD-41/README.md +2 -0
- package/rules/CD-41/discipline.json +14 -0
- package/rules/CD-42/CHECKS.md +2 -2
- package/rules/CD-43/CHECKS.md +2 -2
- package/rules/CD-44/CHECKS.md +2 -2
- package/rules/CD-47/CHECKS.md +2 -2
- package/rules/CD-5/CHECKS.md +2 -2
- package/rules/CD-6/CHECKS.md +2 -2
- package/rules/CD-7/CHECKS.md +2 -2
- package/rules/CD-7a/CHECKS.md +2 -2
- package/rules/CD-8/CHECKS.md +2 -2
- package/chunks/chunk-YLZ73C7O.js +0 -0
|
@@ -96,6 +96,14 @@
|
|
|
96
96
|
"expectedLines": [
|
|
97
97
|
1
|
|
98
98
|
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "an it callback inside a describe",
|
|
102
|
+
"fileName": "src/steps.test.ts",
|
|
103
|
+
"source": "describe(\"steps\", () => {\n it(\"runs\", () => {\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n });\n});\n",
|
|
104
|
+
"expectedLines": [
|
|
105
|
+
2
|
|
106
|
+
]
|
|
99
107
|
}
|
|
100
108
|
],
|
|
101
109
|
"allow": [
|
|
@@ -110,6 +118,12 @@
|
|
|
110
118
|
"fileName": "src/steps.ts",
|
|
111
119
|
"source": "export function steps(): void {\n step0();\n step1();\n step2();\n step3();\n step4();\n step5();\n step6();\n step7();\n step8();\n step9();\n step10();\n step11();\n step12();\n step13();\n step14();\n step15();\n step16();\n step17();\n step18();\n step19();\n step20();\n step21();\n step22();\n step23();\n step24();\n step25();\n step26();\n step27();\n step28();\n step29();\n step30();\n step31();\n step32();\n step33();\n step34();\n step35();\n step36();\n step37();\n step38();\n step39();\n step40();\n step41();\n step42();\n step43();\n if (ready0) {\n run();\n }\n if (ready1) {\n run();\n }\n if (ready2) {\n run();\n }\n}\n",
|
|
112
120
|
"expectedLines": []
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "a describe callback is not a function to shorten",
|
|
124
|
+
"fileName": "src/steps.test.ts",
|
|
125
|
+
"source": "describe(\"steps\", () => {\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n step();\n});\n",
|
|
126
|
+
"expectedLines": []
|
|
113
127
|
}
|
|
114
128
|
]
|
|
115
129
|
}
|
package/rules/CD-42/CHECKS.md
CHANGED
|
@@ -36,7 +36,7 @@ const label = (order: Order) => {
|
|
|
36
36
|
Handle the unhappy path first with an early return and leave the happy path as the final return.
|
|
37
37
|
|
|
38
38
|
## Exceptions
|
|
39
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep an else for an external reason. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs
|
|
39
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep an else for an external reason. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. Judgement clauses cannot be selected and need no exception record. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
40
40
|
|
|
41
41
|
```json
|
|
42
42
|
{ "version": 1, "exceptions": [
|
|
@@ -44,4 +44,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
44
44
|
] }
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-43/CHECKS.md
CHANGED
|
@@ -26,7 +26,7 @@ const render = (mode: "compact" | "full"): string => "";
|
|
|
26
26
|
Name each state in the type.
|
|
27
27
|
|
|
28
28
|
## Exceptions
|
|
29
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must follow an external interface that uses a boolean. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs
|
|
29
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must follow an external interface that uses a boolean. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
30
30
|
|
|
31
31
|
```json
|
|
32
32
|
{ "version": 1, "exceptions": [
|
|
@@ -34,4 +34,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
34
34
|
] }
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-44/CHECKS.md
CHANGED
|
@@ -37,7 +37,7 @@ const withTotal = (order: Order): Order => ({ ...order, total: 10 });
|
|
|
37
37
|
Copy before sorting or reversing: `[...items].sort()`.
|
|
38
38
|
|
|
39
39
|
## Exceptions
|
|
40
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must fill an output object supplied by an external API. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs
|
|
40
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must fill an output object supplied by an external API. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
41
41
|
|
|
42
42
|
```json
|
|
43
43
|
{ "version": 1, "exceptions": [
|
|
@@ -45,4 +45,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
45
45
|
] }
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-47/CHECKS.md
CHANGED
|
@@ -26,7 +26,7 @@ spawnSync("git", ["init"], { cwd: directory, env: hermeticGitEnvironment() });
|
|
|
26
26
|
Build the environment without inherited git variables or the user's configuration, and run in a temporary directory.
|
|
27
27
|
|
|
28
28
|
## Exceptions
|
|
29
|
-
Record exemptions only in `discipline-exceptions.json` at the repository root; core reads no other allowance file. Use `authorised-location` when a test file legitimately builds its environment another way. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs
|
|
29
|
+
Record exemptions only in `discipline-exceptions.json` at the repository root; core reads no other allowance file. Use `authorised-location` when a test file legitimately builds its environment another way. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
30
30
|
|
|
31
31
|
```json
|
|
32
32
|
{ "version": 1, "exceptions": [
|
|
@@ -34,4 +34,4 @@ Record exemptions only in `discipline-exceptions.json` at the repository root; c
|
|
|
34
34
|
] }
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-5/CHECKS.md
CHANGED
|
@@ -41,7 +41,7 @@ const first = items[0];
|
|
|
41
41
|
Remove the need for the directive. If it must stay, add a tracked reference to the work that removes it: `// biome-ignore lint/style/noNonNullAssertion: until items is typed as a non-empty tuple (#42)`. The reference satisfies this clause only. A directive that escapes a selected clause, such as an `eslint-disable` naming a selected rule or a `@ts-expect-error` under `CD-2#cast-expressions`, still needs a file record on that clause, and that record does not satisfy this clause.
|
|
42
42
|
|
|
43
43
|
## Exceptions
|
|
44
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file legitimately carries untracked directives, such as generated code. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs
|
|
44
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file legitimately carries untracked directives, such as generated code. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
45
45
|
|
|
46
46
|
```json
|
|
47
47
|
{ "version": 1, "exceptions": [
|
|
@@ -49,4 +49,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
49
49
|
] }
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-6/CHECKS.md
CHANGED
|
@@ -40,7 +40,7 @@ const account = await loadAccount(id);
|
|
|
40
40
|
Name the value for what it is in the domain.
|
|
41
41
|
|
|
42
42
|
## Exceptions
|
|
43
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep a name fixed by an external contract. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs
|
|
43
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep a name fixed by an external contract. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
44
44
|
|
|
45
45
|
```json
|
|
46
46
|
{ "version": 1, "exceptions": [
|
|
@@ -48,4 +48,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
48
48
|
] }
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-7/CHECKS.md
CHANGED
|
@@ -35,7 +35,7 @@ src/price-formatting.ts
|
|
|
35
35
|
Rename the file or folder for what it contains, or split it into files that each hold one thing.
|
|
36
36
|
|
|
37
37
|
## Exceptions
|
|
38
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a path name is fixed by a framework or external convention. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs
|
|
38
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a path name is fixed by a framework or external convention. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
39
39
|
|
|
40
40
|
```json
|
|
41
41
|
{ "version": 1, "exceptions": [
|
|
@@ -43,4 +43,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
43
43
|
] }
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-7a/CHECKS.md
CHANGED
|
@@ -27,7 +27,7 @@ const createClient = (): Client => ({ send: () => undefined });
|
|
|
27
27
|
Declare and export the type, then annotate the factory with it.
|
|
28
28
|
|
|
29
29
|
## Exceptions
|
|
30
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when the type comes from a library whose package exports no named return type. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs
|
|
30
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when the type comes from a library whose package exports no named return type. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
31
31
|
|
|
32
32
|
```json
|
|
33
33
|
{ "version": 1, "exceptions": [
|
|
@@ -35,4 +35,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
35
35
|
] }
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-8/CHECKS.md
CHANGED
|
@@ -31,7 +31,7 @@ switch (event.kind) {
|
|
|
31
31
|
Name each remaining variant so the compiler checks exhaustiveness.
|
|
32
32
|
|
|
33
33
|
## Exceptions
|
|
34
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a switch is over an open set of values and needs a fallback. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs
|
|
34
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a switch is over an open set of values and needs a fallback. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
35
35
|
|
|
36
36
|
```json
|
|
37
37
|
{ "version": 1, "exceptions": [
|
|
@@ -39,4 +39,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
39
39
|
] }
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/chunks/chunk-YLZ73C7O.js
DELETED
|
File without changes
|