@hailstails/hone 2.0.0-pre.3 → 2.0.0-pre.5
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 +9 -20
- package/CHANGELOG.md +104 -0
- package/MIGRATING.md +18 -9
- package/README.md +15 -17
- package/chunks/chunk-3CWFUD5B.js +38 -0
- package/chunks/chunk-4AJQHZ7I.js +191 -0
- package/chunks/chunk-5AKHEW6V.js +15 -0
- package/chunks/{chunk-L7BGRC6D.js → chunk-6LTJRJOE.js} +1 -1
- package/chunks/chunk-75XWZYNN.js +64 -0
- package/chunks/{chunk-ASUN4AVC.js → chunk-BISP2JOL.js} +73 -9
- package/chunks/chunk-COQMPHWZ.js +37 -0
- package/chunks/chunk-D6645WPB.js +6 -0
- package/chunks/chunk-DJMF6JIM.js +42 -0
- package/chunks/chunk-EBX57Z3V.js +8 -0
- package/chunks/chunk-EFUWHLZK.js +426 -0
- package/chunks/chunk-FHVNKG5Q.js +19 -0
- package/chunks/{chunk-NRIQD3PI.js → chunk-FRE5IA3C.js} +3 -5
- package/chunks/{chunk-OKLYWD2Z.js → chunk-GMLT3MHO.js} +262 -257
- package/chunks/{chunk-QP5TLOBY.js → chunk-HVZVKZPW.js} +12 -9
- package/chunks/chunk-LEFM7OPS.js +41 -0
- package/chunks/chunk-LNMDMRGQ.js +51 -0
- package/chunks/chunk-M4VSJ27S.js +139 -0
- package/chunks/{chunk-RGSHTPLA.js → chunk-MBEDAFVC.js} +3 -11
- package/chunks/chunk-ND3EOGDK.js +2350 -0
- package/chunks/chunk-ONDBACCR.js +14332 -0
- package/chunks/chunk-OO5KV7KN.js +17 -0
- package/chunks/chunk-SKDQ3QJD.js +75 -0
- package/chunks/chunk-U6W65ZOF.js +86 -0
- package/chunks/chunk-W5OIAUDW.js +18 -0
- package/chunks/{chunk-GNOMK7CR.js → chunk-WPEOCLTP.js} +495 -52
- package/chunks/chunk-X73RZUPO.js +63 -0
- package/chunks/chunk-XE2KKWYH.js +45 -0
- package/chunks/chunk-XNIXPQQ5.js +179 -0
- package/chunks/chunk-YONPKP3C.js +15 -0
- package/docs/adding-a-discipline-or-mechanism.md +1 -1
- package/docs/extending.md +7 -388
- package/methods/lenses/function-first.md +2 -2
- package/package.json +7 -6
- package/rules/README.md +7 -5
- package/rules/SPIRIT.md +1 -1
- package/rules/numbers.md +4 -4
- package/rules/principles/no-leak-across-a-boundary.md +1 -1
- package/rules/principles.md +1 -1
- package/rules/record-kinds/authorised-location.md +1 -1
- package/rules/records.md +11 -19
- package/rules/rules.md +5 -5
- package/rules/sources.md +6 -7
- package/rules/typescript/checks.md +280 -394
- package/rules/typescript/recipes/adapter-per-outside-party.md +10 -5
- package/rules/typescript/recipes/assert-to-narrow.md +114 -4
- package/rules/typescript/recipes/closure-factory.md +5 -5
- package/rules/typescript/recipes/companion-test-file.md +5 -3
- package/rules/typescript/recipes/composed-orchestrator.md +6 -4
- package/rules/typescript/recipes/composition-root.md +5 -3
- package/rules/typescript/recipes/{bounded-context-generic.md → constrained-context-generic.md} +6 -4
- package/rules/typescript/recipes/copy-never-write-in.md +6 -4
- package/rules/typescript/recipes/declared-not-bundled.md +5 -3
- package/rules/typescript/recipes/dependency-record.md +5 -3
- package/rules/typescript/recipes/domain-vocabulary-list.md +5 -3
- package/rules/typescript/recipes/entity-module.md +8 -5
- package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +5 -3
- package/rules/typescript/recipes/extension-outside-the-vendored-code.md +5 -3
- package/rules/typescript/recipes/failure-asserted-as-a-value.md +44 -4
- package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +8 -5
- package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +5 -3
- package/rules/typescript/recipes/functional-iteration.md +8 -3
- package/rules/typescript/recipes/guard-clauses.md +5 -3
- package/rules/typescript/recipes/integration-test-owns-its-scratch.md +5 -3
- package/rules/typescript/recipes/integration-test-suffix.md +5 -3
- package/rules/typescript/recipes/it-each-over-typed-rows.md +117 -0
- package/rules/typescript/recipes/map-out-at-the-adapter.md +36 -4
- package/rules/typescript/recipes/meaning-in-names-not-comments.md +5 -5
- package/rules/typescript/recipes/named-exported-type.md +5 -3
- package/rules/typescript/recipes/narrow-ports.md +5 -3
- package/rules/typescript/recipes/one-argument-object.md +8 -3
- package/rules/typescript/recipes/{port-in-the-domain.md → port-in-a-module-of-its-own.md} +7 -5
- package/rules/typescript/recipes/ports-in-the-argument.md +5 -3
- package/rules/typescript/recipes/repo-scripts-only.md +5 -3
- package/rules/typescript/recipes/result-union.md +5 -5
- package/rules/typescript/recipes/screaming-folders.md +5 -5
- package/rules/typescript/recipes/shared-strict-base-config.md +5 -5
- package/rules/typescript/recipes/stub-with-vi-fn.md +130 -0
- package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +5 -3
- package/rules/typescript/recipes/whole-words.md +5 -3
- package/rules/typescript/recipes/whole-written-out-expectation.md +284 -4
- package/rules/typescript/recipes/world-values-through-a-port.md +5 -3
- package/rules/typescript/recipes/zod-at-the-producers-adapter.md +8 -3
- package/rules/typescript/recipes.md +567 -21
- package/rules/typescript/symptoms/ambient-randomness/random-call.md +10 -0
- package/rules/typescript/symptoms/ambient-randomness.md +1 -1
- package/rules/typescript/symptoms/answer-set-in-a-hook/hook-answer.md +10 -0
- package/rules/typescript/symptoms/answer-set-in-a-hook.md +1 -1
- package/rules/typescript/symptoms/assertion-outside-a-test-body/assertion-site.md +10 -0
- package/rules/typescript/symptoms/assertion-outside-a-test-body.md +25 -0
- package/rules/typescript/symptoms/branch-in-a-test/test-body.md +10 -184
- package/rules/typescript/symptoms/branch-in-a-test.md +11 -1
- package/rules/typescript/symptoms/built-unit-called-in-place/call-of-a-call.md +10 -0
- package/rules/typescript/symptoms/built-unit-called-in-place.md +25 -0
- package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +1 -1
- package/rules/typescript/symptoms/code-or-prose-read-as-text-in-a-test/raw-read.md +10 -0
- package/rules/typescript/symptoms/code-or-prose-read-as-text-in-a-test.md +31 -0
- package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +26 -117
- package/rules/typescript/symptoms/computed-value-in-a-test.md +1 -1
- package/rules/typescript/symptoms/date-used-directly.md +1 -1
- package/rules/typescript/symptoms/default-for-a-required-value.md +1 -1
- package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +2 -19
- package/rules/typescript/symptoms/double-with-a-body/stub-implementation.md +2 -2
- package/rules/typescript/symptoms/double-with-a-body.md +1 -1
- package/rules/typescript/symptoms/export-from-a-test/test-file-export.md +10 -0
- package/rules/typescript/symptoms/export-from-a-test.md +33 -0
- package/rules/typescript/symptoms/failure-shaped-as-success/empty-catch.md +10 -0
- package/rules/typescript/symptoms/failure-shaped-as-success.md +1 -1
- package/rules/typescript/symptoms/floating-version/version-selector.md +10 -0
- package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +2 -2
- package/rules/typescript/symptoms/inner-layer-imports-outer.md +1 -1
- package/rules/typescript/symptoms/library-class-built-in-place.md +1 -1
- package/rules/typescript/symptoms/loop-keyword/loop-statement.md +1 -1
- package/rules/typescript/symptoms/many-spellings-of-one-concept/test-call-aliases.md +10 -0
- package/rules/typescript/symptoms/many-spellings-of-one-concept.md +3 -2
- package/rules/typescript/symptoms/module-or-global-patched/module-mock-call.md +4 -4
- package/rules/typescript/symptoms/no-lock-file/committed-lock-file.md +12 -0
- package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +1 -0
- package/rules/typescript/symptoms/outside-import-past-a-boundary.md +5 -4
- package/rules/typescript/symptoms/outside-type-in-a-signature.md +2 -2
- package/rules/typescript/symptoms/{port-outside-the-domain.md → port-beside-its-adapter.md} +2 -2
- package/rules/typescript/symptoms/port-named-for-a-mechanism.md +1 -1
- package/rules/typescript/symptoms/process-global-used-in-place/debugger-statement.md +10 -0
- package/rules/typescript/symptoms/process-global-used-in-place/direct-global-use.md +14 -0
- package/rules/typescript/symptoms/process-global-used-in-place.md +2 -2
- package/rules/typescript/symptoms/prose-in-code/comment-prose.md +12 -0
- package/rules/typescript/symptoms/rebinding/test-body.md +1 -18
- package/rules/typescript/symptoms/rebinding.md +11 -1
- package/rules/typescript/symptoms/schema-past-its-adapter.md +2 -2
- package/rules/typescript/symptoms/test-switched-off/skipped-tests.md +3 -6
- package/rules/typescript/symptoms/test-switched-off.md +1 -1
- package/rules/typescript/symptoms/text-past-its-reader/test-body.md +2 -17
- package/rules/typescript/symptoms/text-past-its-reader.md +1 -1
- package/rules/typescript/symptoms/throw-between-our-units/throw-statement.md +10 -0
- package/rules/typescript/symptoms/throw-or-catch-in-a-test/throw-statement.md +1 -1
- package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +1 -25
- package/rules/typescript/symptoms/tool-fetched-at-run-time/fetch-command.md +10 -0
- package/rules/typescript/symptoms/type-declared-in-a-test/test-type-declaration.md +10 -0
- package/rules/typescript/symptoms/type-declared-in-a-test.md +33 -0
- package/rules/typescript/symptoms/unasserted-call.md +1 -1
- package/rules/typescript/symptoms/unit-without-a-running-test/companion-test-file.md +2 -2
- package/rules/typescript/symptoms/wide-input/unread-parameter.md +10 -0
- package/rules/typescript/symptoms/wide-input.md +3 -2
- package/rules/typescript/symptoms.md +210 -148
- package/src/application/conformance/conformance-testing-types.d.ts +13 -16
- package/src/domain/language-layer/authored-item-types.d.ts +66 -0
- package/src/domain/language-layer/catalogue-name.d.ts +5 -0
- package/src/domain/language-layer/check-address-text.d.ts +12 -0
- package/src/domain/rule-set/authored-rule-set-types.d.ts +31 -32
- package/src/domain/rule-set/clause-address-types.d.ts +4 -3
- package/src/domain/rule-set/rule-set-name-of.d.ts +10 -0
- package/src/domain/runner/check-binding.d.ts +18 -0
- package/src/domain/runner/check-observations.d.ts +39 -0
- package/src/domain/runner/conformance-types.d.ts +8 -2
- package/src/domain/runner/runner-result-types.d.ts +1 -2
- package/src/domain/settings/test-files.d.ts +7 -0
- package/src/eslint-plugin.js +45 -39
- package/src/hone.js +16 -13716
- package/src/infrastructure/disciplines-file/version-one-names.json +4 -5
- package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/piece.json +0 -6
- package/src/infrastructure/engines/eslint/long-function/function-length/piece.json +0 -6
- package/src/infrastructure/engines/eslint/runner/pieces/eslint-piece-settings-types.d.ts +2 -0
- package/src/infrastructure/engines/eslint/runner/runner.js +1001 -1234
- package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/README.md +0 -3
- package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/eslint-plugin.js +33 -21
- package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/piece.json +11 -4
- package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/skipped-tests.examples.json +28 -0
- package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/piece.json +0 -2
- package/src/infrastructure/engines/eslint/wide-input/unread-parameter/eslint-plugin.js +94 -0
- package/src/infrastructure/engines/eslint/wide-input/unread-parameter/piece.json +11 -0
- package/src/infrastructure/engines/eslint/wide-input/unread-parameter/unread-parameter.examples.json +48 -0
- package/src/infrastructure/engines/walker/ambient-randomness/random-call/ambient-randomness.js +109 -0
- package/src/infrastructure/engines/walker/ambient-randomness/random-call/piece.json +9 -0
- package/src/infrastructure/engines/walker/ambient-randomness/random-call/random-call.examples.json +48 -0
- package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answer.examples.json +42 -0
- package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answers.js +72 -0
- package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/piece.json +9 -0
- package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/assertion-site.examples.json +30 -0
- package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/assertion-site.js +123 -0
- package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/piece.json +9 -0
- package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/class-syntax.js +3 -3
- package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/boolean-signatures.js +7 -5
- package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body-logic.js +192 -147
- package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.examples.json +24 -0
- package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.js +34 -0
- package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/piece.json +9 -0
- package/src/infrastructure/engines/walker/claimed-type/cast-to-any/any-cast.js +6 -4
- package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/cast-expressions.js +6 -4
- package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/piece.json +9 -0
- package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/raw-read.examples.json +30 -0
- package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/raw-read.js +166 -0
- package/src/infrastructure/engines/walker/computed-value-in-a-test/test-body/piece.json +0 -10
- package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.js +4 -4
- package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/switch-defaults.js +8 -6
- package/src/infrastructure/engines/walker/double-with-a-body/logic-in-a-passed-function/piece.json +0 -10
- package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/dependency-isolation.js +9 -14
- package/src/infrastructure/engines/walker/drawer-path/drawer-names/categorical-paths.js +4 -4
- package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/piece.json +9 -0
- package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/test-file-export.examples.json +30 -0
- package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/test-file-export.js +31 -0
- package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.examples.json +18 -0
- package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.js +32 -0
- package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/piece.json +9 -0
- package/src/infrastructure/engines/walker/floating-version/version-selector/piece.json +9 -0
- package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.examples.json +54 -0
- package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.js +75 -0
- package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/hermetic-git-spawns.js +8 -17
- package/src/infrastructure/engines/walker/loop-keyword/loop-statement/loops.js +8 -6
- package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/piece.json +9 -0
- package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.examples.json +36 -0
- package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.js +67 -0
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mock-call.examples.json +34 -0
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mocking.js +64 -16
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/piece.json +5 -1
- package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.examples.json +24 -0
- package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.js +41 -0
- package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/piece.json +9 -0
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-boundaries.js +18 -16
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/piece.json +1 -1
- package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.examples.json +18 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.js +17 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/piece.json +9 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/direct-global-use.examples.json +63 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/piece.json +13 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/process-global-used-in-place.js +126 -0
- package/src/infrastructure/engines/walker/prose-in-code/comment-prose/comment-prose.examples.json +42 -0
- package/src/infrastructure/engines/walker/prose-in-code/comment-prose/piece.json +16 -0
- package/src/infrastructure/engines/walker/prose-in-code/comment-prose/prose-in-code.js +90 -0
- package/src/infrastructure/engines/walker/rebinding/test-body/piece.json +0 -10
- package/src/infrastructure/engines/walker/runner/pieces/walker-piece.d.ts +7 -5
- package/src/infrastructure/engines/walker/runner/runner.js +268 -79
- package/src/infrastructure/engines/walker/runner/toolchain/typescript-parse.d.ts +3 -0
- package/src/infrastructure/engines/walker/shorthand-name/identifier-names/identifier-names.js +12 -7
- package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/strict/compiler-overrides.js +30 -52
- package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/piece.json +0 -10
- package/src/infrastructure/engines/walker/text-past-its-reader/test-body/piece.json +0 -10
- package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/piece.json +9 -0
- package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throw-statement.examples.json +36 -0
- package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throws-in-production.js +12 -0
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throw-statement.examples.json +6 -6
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throws-in-tests.js +5 -44
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/try-block/piece.json +0 -10
- package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.examples.json +42 -0
- package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.js +152 -0
- package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/piece.json +9 -0
- package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/piece.json +9 -0
- package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.examples.json +36 -0
- package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.js +141 -0
- package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.js +8 -6
- package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/export-test-sibling.js +16 -10
- package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/comments-directives.js +18 -64
- package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.js +7 -5
- package/src/measure-engines.process.js +80 -0
- package/src/rule-set.d.ts +2 -1
- package/src/testing.d.ts +2 -4
- package/src/testing.js +173 -314
- package/src/{audit.d.ts → walker.d.ts} +13 -8
- package/src/walker.js +28 -0
- package/chunks/chunk-5HRMJ4O2.js +0 -608
- package/chunks/chunk-IX2VZTBO.js +0 -887
- package/chunks/chunk-K2W3D3NB.js +0 -17
- package/chunks/chunk-M6SOGWT7.js +0 -82
- package/chunks/chunk-Q62Y25WS.js +0 -843
- package/chunks/chunk-R75QELTA.js +0 -481
- package/chunks/chunk-RANAKCTW.js +0 -31
- package/chunks/chunk-TNY2PASL.js +0 -38
- package/chunks/chunk-UJONWHA4.js +0 -22
- package/docs/output-contract.md +0 -1155
- package/rules/record-kinds/boundary-record.md +0 -9
- package/rules/typescript/recipes/iteach-over-typed-rows.md +0 -18
- package/rules/typescript/recipes/stub-with-vifn.md +0 -20
- package/src/audit.js +0 -18
- package/src/domain/runner/runner-module-types.d.ts +0 -15
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sourceSnippetOf
|
|
3
|
+
} from "./chunk-5AKHEW6V.js";
|
|
4
|
+
import {
|
|
5
|
+
typeScriptSourceKindOf
|
|
6
|
+
} from "./chunk-COQMPHWZ.js";
|
|
7
|
+
|
|
8
|
+
// src/infrastructure/engines/walker/runner/pieces/throw-statement-check.ts
|
|
9
|
+
var throwStatementCheck = (scope) => ({
|
|
10
|
+
prepare: ({ bindings, repository, syntaxApi }) => ({
|
|
11
|
+
outcome: "ok",
|
|
12
|
+
value: {
|
|
13
|
+
prepareFile: ({ file }) => {
|
|
14
|
+
if (typeScriptSourceKindOf({ file, testFiles: repository.testFiles }) !== scope) {
|
|
15
|
+
return { outcome: "ok", value: { kind: "skipped" } };
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
outcome: "ok",
|
|
19
|
+
value: {
|
|
20
|
+
kind: "syntax",
|
|
21
|
+
begin: ({ sourceFile, anchorAt }) => {
|
|
22
|
+
const hits = [];
|
|
23
|
+
return {
|
|
24
|
+
enter: ({ node }) => {
|
|
25
|
+
if (!syntaxApi.isThrowStatement(node)) return;
|
|
26
|
+
const anchor = anchorAt({ position: node.getStart(sourceFile) });
|
|
27
|
+
const snippet = sourceSnippetOf(node.getText(sourceFile));
|
|
28
|
+
hits.push(
|
|
29
|
+
...bindings.map(({ address }) => ({ check: address, anchor, snippet }))
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
finish: () => hits
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
finish: () => ({ outcome: "ok", value: [] })
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
throwStatementCheck
|
|
45
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ownedNameText
|
|
3
|
+
} from "./chunk-4AJQHZ7I.js";
|
|
4
|
+
import {
|
|
5
|
+
NOT_INSTALLED,
|
|
6
|
+
TOOL_IDENTITY,
|
|
7
|
+
installRootAboveEntry,
|
|
8
|
+
versionOneEngineNameOf
|
|
9
|
+
} from "./chunk-WPEOCLTP.js";
|
|
10
|
+
|
|
11
|
+
// src/infrastructure/command-line/installation/install-root.ts
|
|
12
|
+
var DIRECTORIES_ABOVE_ENTRY = {
|
|
13
|
+
api: "two directories",
|
|
14
|
+
command: "two directories"
|
|
15
|
+
};
|
|
16
|
+
var installRootUnresolvable = (request) => ({
|
|
17
|
+
outcome: "failed",
|
|
18
|
+
error: { kind: "install-root-unresolvable", url: request.url, detail: request.detail }
|
|
19
|
+
});
|
|
20
|
+
var installRootAbove = (request) => {
|
|
21
|
+
const entry = request.path.fromFileUrl({ url: request.moduleUrl });
|
|
22
|
+
if (entry.outcome === "failed") {
|
|
23
|
+
return installRootUnresolvable({ url: entry.error.url, detail: entry.error.detail });
|
|
24
|
+
}
|
|
25
|
+
const resolved = request.path.resolve({
|
|
26
|
+
path: installRootAboveEntry({
|
|
27
|
+
entryFile: entry.value,
|
|
28
|
+
entry: request.entry,
|
|
29
|
+
directoryOf: (path) => request.path.directoryOf({ path })
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
if (resolved.outcome === "failed") {
|
|
33
|
+
return installRootUnresolvable({
|
|
34
|
+
url: request.moduleUrl,
|
|
35
|
+
detail: `the install root ${DIRECTORIES_ABOVE_ENTRY[request.entry]} above the entry file is not an absolute path`
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return resolved;
|
|
39
|
+
};
|
|
40
|
+
var installRootOf = (request) => installRootAbove({ ...request, entry: "command" });
|
|
41
|
+
var installRootOfApiEntry = (request) => installRootAbove({ ...request, entry: "api" });
|
|
42
|
+
|
|
43
|
+
// src/infrastructure/printed-report/symptoms/symptom-lines.ts
|
|
44
|
+
var symptomUnheldText = (request) => `${ownedNameText(request.failure.symptom)}: the catalogue and the records disagree, since a check, sighting or record names this symptom and no catalogue holds it`;
|
|
45
|
+
var lowerFirst = (request) => `${request.text.charAt(0).toLowerCase()}${request.text.slice(1)}`;
|
|
46
|
+
var pointedTitleOf = (request) => request.point.kind === "rule" ? request.point.rule.title : request.point.principle.title;
|
|
47
|
+
var indicatedCaseText = (request) => {
|
|
48
|
+
const caseText = lowerFirst({ text: request.indication.case.title });
|
|
49
|
+
return request.indication.situation === void 0 ? caseText : `${caseText}: ${request.indication.situation}`;
|
|
50
|
+
};
|
|
51
|
+
var indicationText = (request) => `${indicatedCaseText(request)} \u2192 ${request.indication.points.map((point) => pointedTitleOf({ point })).join(", ")}`;
|
|
52
|
+
var recipeSentence = (request) => {
|
|
53
|
+
const titles = request.recipes.map((recipe) => recipe.title);
|
|
54
|
+
if (titles.length === 0) {
|
|
55
|
+
return "";
|
|
56
|
+
}
|
|
57
|
+
return ` ${titles.length === 1 ? "Recipe" : "Recipes"}: ${titles.join("; ")}.`;
|
|
58
|
+
};
|
|
59
|
+
var symptomSourceOf = (request) => request.symptom.sourceFile ?? `${request.page}#${request.symptom.name}`;
|
|
60
|
+
var symptomLine = (request) => {
|
|
61
|
+
const { symptom } = request;
|
|
62
|
+
const indications = symptom.mayIndicate.map((indication) => indicationText({ indication })).join("; ");
|
|
63
|
+
return `${symptom.name}: ${symptom.title}. May indicate: ${indications}. The breach usually sits ${symptom.breachUsuallySits}.${recipeSentence(symptom)} Read ${symptomSourceOf(request)}`;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// src/infrastructure/printed-report/load-failures/load-failure-text.ts
|
|
67
|
+
var escapedLineBreaks = (request) => request.text.replaceAll("\n", "\\n").replaceAll("\r", "\\r");
|
|
68
|
+
var JUDGEMENT_CLAUSE_LISTED_REPAIR = "a judgement clause is enforced by review and is left out of clauses, adopted or not; remove it";
|
|
69
|
+
var CONFIG_ROOT_REPAIR = "an eslintConfigRoots entry is a folder git tracks files under outside every excluded path, spelled exactly as git spells it; fix or remove it in disciplines.json";
|
|
70
|
+
var SELECTION_ABSENT_REPAIR = "holds no disciplines.json; give the folder that holds it, usually the repository root";
|
|
71
|
+
var WHY_CHAINS_REQUIRED_REPAIR = `${TOOL_IDENTITY.command} record-debt writes records that give only a reason, and this file requires a whyChain on every record; set "fileExceptionWhyChains": "optional" in it to accept them`;
|
|
72
|
+
var BOTH_LAYOUTS_REPAIR = `${TOOL_IDENTITY.name} reads exception records from one layout; keep each record in one of them and remove the other`;
|
|
73
|
+
var SUPPORTED_VERSION_REPAIR = "add a supported version to the devDependencies of the repository root";
|
|
74
|
+
var EACH_SUPPORTED_VERSION_REPAIR = "add a supported version of each to the devDependencies of the repository root";
|
|
75
|
+
var unavailablePeerRepair = (request) => request.peer.peer === "required" && request.peer.found === NOT_INSTALLED ? `${request.peer.packageName} is a required peer of ${TOOL_IDENTITY.packageName}, so this install is incomplete; ${SUPPORTED_VERSION_REPAIR} and reinstall` : SUPPORTED_VERSION_REPAIR;
|
|
76
|
+
var unavailablePeersRepair = (request) => {
|
|
77
|
+
const [first, ...rest] = request.peers;
|
|
78
|
+
return rest.length === 0 ? unavailablePeerRepair({ peer: first }) : EACH_SUPPORTED_VERSION_REPAIR;
|
|
79
|
+
};
|
|
80
|
+
var unavailablePeerText = (request) => `${request.peer.packageName} found ${request.peer.found}, supported ${request.peer.supported}`;
|
|
81
|
+
var runnerFailureFields = (request) => {
|
|
82
|
+
switch (request.failure.kind) {
|
|
83
|
+
case "piece-invalid":
|
|
84
|
+
return [request.failure.kind, request.failure.pieceRoot, request.failure.detail];
|
|
85
|
+
case "file-unreadable":
|
|
86
|
+
case "file-unparseable":
|
|
87
|
+
return [request.failure.kind, request.failure.file, request.failure.detail];
|
|
88
|
+
case "toolchain-unavailable":
|
|
89
|
+
return [
|
|
90
|
+
request.failure.kind,
|
|
91
|
+
`${request.failure.peers.map((peer) => unavailablePeerText({ peer })).join("; ")}: ${unavailablePeersRepair({ peers: request.failure.peers })}`
|
|
92
|
+
];
|
|
93
|
+
case "toolchain-shadowed":
|
|
94
|
+
return [
|
|
95
|
+
request.failure.kind,
|
|
96
|
+
request.failure.packageName,
|
|
97
|
+
`resolved from ${request.failure.location} inside the core install ${request.failure.installRoot}: delete ${request.failure.installRoot}/node_modules, then reinstall the package with the repository's package manager, so the repository's own copy is used`
|
|
98
|
+
];
|
|
99
|
+
case "tool-failed":
|
|
100
|
+
case "plugin-conflict":
|
|
101
|
+
case "team-config-unloadable":
|
|
102
|
+
case "runner-invalid-output":
|
|
103
|
+
return [request.failure.kind, request.failure.detail];
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var loadFailureFields = (request) => {
|
|
107
|
+
switch (request.failure.kind) {
|
|
108
|
+
case "arguments-invalid":
|
|
109
|
+
case "git-failed":
|
|
110
|
+
case "unexpected-error":
|
|
111
|
+
return [request.failure.detail];
|
|
112
|
+
case "selection-absent":
|
|
113
|
+
return [request.failure.repo, SELECTION_ABSENT_REPAIR];
|
|
114
|
+
case "install-root-unresolvable":
|
|
115
|
+
return [request.failure.url, request.failure.detail];
|
|
116
|
+
case "file-unreadable":
|
|
117
|
+
case "file-malformed":
|
|
118
|
+
case "file-unwritable":
|
|
119
|
+
case "records-unsplittable":
|
|
120
|
+
case "rule-set-invalid":
|
|
121
|
+
return [request.failure.path, request.failure.detail];
|
|
122
|
+
case "rule-set-not-upgraded":
|
|
123
|
+
return [request.failure.path];
|
|
124
|
+
case "rule-set-half-upgraded":
|
|
125
|
+
return [request.failure.path, ...request.failure.files];
|
|
126
|
+
case "records-in-both-layouts":
|
|
127
|
+
return [request.failure.path, `${request.failure.folder}:`, BOTH_LAYOUTS_REPAIR];
|
|
128
|
+
case "why-chains-required":
|
|
129
|
+
return [`${request.failure.path}:`, WHY_CHAINS_REQUIRED_REPAIR];
|
|
130
|
+
case "unsupported-version":
|
|
131
|
+
return [request.failure.path, String(JSON.stringify(request.failure.found))];
|
|
132
|
+
case "reserved-rule-set-name":
|
|
133
|
+
case "unknown-rule-set":
|
|
134
|
+
return [request.failure.name];
|
|
135
|
+
case "duplicate-clause":
|
|
136
|
+
return [request.failure.address, request.failure.prefixedAddress];
|
|
137
|
+
case "rule-set-name-collision":
|
|
138
|
+
return [request.failure.name, request.failure.other];
|
|
139
|
+
case "rule-sets-share-a-check":
|
|
140
|
+
return [request.failure.check, ...request.failure.ruleSets];
|
|
141
|
+
case "unknown-discipline":
|
|
142
|
+
case "unknown-clause":
|
|
143
|
+
case "judgement-clause-selected":
|
|
144
|
+
return [request.failure.address];
|
|
145
|
+
case "judgement-clause-listed":
|
|
146
|
+
return [`${request.failure.address}:`, JUDGEMENT_CLAUSE_LISTED_REPAIR];
|
|
147
|
+
case "mechanism-not-allowed":
|
|
148
|
+
case "piece-missing":
|
|
149
|
+
return [request.failure.address, versionOneEngineNameOf(request.failure.mechanism)];
|
|
150
|
+
case "config-root-untracked":
|
|
151
|
+
return [`${request.failure.root}:`, CONFIG_ROOT_REPAIR];
|
|
152
|
+
case "runner-missing":
|
|
153
|
+
return [versionOneEngineNameOf(request.failure.mechanism)];
|
|
154
|
+
case "runner-invalid":
|
|
155
|
+
return [versionOneEngineNameOf(request.failure.mechanism), request.failure.detail];
|
|
156
|
+
case "runner-failed":
|
|
157
|
+
return [
|
|
158
|
+
versionOneEngineNameOf(request.failure.mechanism),
|
|
159
|
+
...runnerFailureFields({ failure: request.failure.failure })
|
|
160
|
+
];
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
var loadFailureDetail = (request) => {
|
|
164
|
+
const { failure } = request;
|
|
165
|
+
if (failure.kind === "symptom-unheld") return symptomUnheldText({ failure });
|
|
166
|
+
return [failure.kind, ...loadFailureFields({ failure })].map((text) => escapedLineBreaks({ text })).join(" ");
|
|
167
|
+
};
|
|
168
|
+
var loadFailureText = (request) => `load failure: ${loadFailureDetail(request)}
|
|
169
|
+
`;
|
|
170
|
+
|
|
171
|
+
export {
|
|
172
|
+
symptomUnheldText,
|
|
173
|
+
symptomSourceOf,
|
|
174
|
+
symptomLine,
|
|
175
|
+
installRootOf,
|
|
176
|
+
installRootOfApiEntry,
|
|
177
|
+
loadFailureDetail,
|
|
178
|
+
loadFailureText
|
|
179
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/domain/gathered-outcomes.ts
|
|
2
|
+
var gatheredOutcomes = (request) => {
|
|
3
|
+
const failed = request.outcomes.find((outcome) => outcome.outcome === "failed");
|
|
4
|
+
if (failed !== void 0) return failed;
|
|
5
|
+
return {
|
|
6
|
+
outcome: "ok",
|
|
7
|
+
value: request.outcomes.flatMap((outcome) => outcome.outcome === "ok" ? outcome.value : [])
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
var listedOutcome = (request) => request.outcome.outcome === "failed" ? request.outcome : { outcome: "ok", value: [request.outcome.value] };
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
gatheredOutcomes,
|
|
14
|
+
listedOutcome
|
|
15
|
+
};
|
|
@@ -151,7 +151,7 @@ Core knows only these two paths. A mechanism that fits neither would need a chan
|
|
|
151
151
|
|
|
152
152
|
Each runner's suite runs core's `checkConformance` (`core/conformance/conformance.ts`) over the real runner as core loads it, for every shared clause its pieces serve. It calls the runner's `conform` and compares the flagged lines with each case's expected lines; the runner conforms for a clause when the result is ok and lists no failures. The audit mechanism's is `mechanisms/audit/runner/walker-conformance.test.ts`; the ESLint runner's is in `src/infrastructure/engines/eslint/runner/native-exceptions/native-exceptions.integration.test.ts` and `delivery/shipped-content/eslint-conformance.test.ts`. Conformance runs the real tool in memory, because the tool's verdict is what is being checked.
|
|
153
153
|
|
|
154
|
-
A runner that answers a version 2 run through a checks runner, as ESLint does with its `checksRunner` export (`ChecksRunner` in `core/mechanism-port/checks-runner-types.ts`), implements `conform` there as well as `run`. `conform` is required: a module whose `checksRunner` has none is the load failure `runner-invalid`. `toolchainBoundChecksRunner` passes `conform` through the toolchain binding, as it does `run`. The report of a checks runner's `run` holds `projection`, the state of the root projection file, and `slices`, each other projection file it found `missing`, `out-of-date` or `unconfigured` (written for a declared config root whose folder holds no lint configuration on disk, so nothing loads it), named by its repository path. A checks runner reports no other slice state. Core lists each entry under `projectionProblems` as a line naming the file, which fails the check, whatever the root projection's state. The conformance kit (`
|
|
154
|
+
A runner that answers a version 2 run through a checks runner, as ESLint does with its `checksRunner` export (`ChecksRunner` in `core/mechanism-port/checks-runner-types.ts`), implements `conform` there as well as `run`. `conform` is required: a module whose `checksRunner` has none is the load failure `runner-invalid`. `toolchainBoundChecksRunner` passes `conform` through the toolchain binding, as it does `run`. The report of a checks runner's `run` holds `projection`, the state of the root projection file, and `slices`, each other projection file it found `missing`, `out-of-date` or `unconfigured` (written for a declared config root whose folder holds no lint configuration on disk, so nothing loads it), named by its repository path. A checks runner reports no other slice state. Core lists each entry under `projectionProblems` as a line naming the file, which fails the check, whatever the root projection's state. The conformance kit (`checkConformanceOf` in `@hailstails/hone/testing`, given a `ruleSet`) asks a standalone runner's `runner.conform`, and for an engine that runs through a native tool asks `checksRunner.conform`; such an engine with no `checksRunner` is the setup failure `runner-unloadable`, "the runner module exports no checksRunner, which version 2 conformance needs of an engine that runs through a native tool". Importing the module still builds its `runner` export; version 2 conformance does not call it.
|
|
155
155
|
|
|
156
156
|
### 5. Selecting it
|
|
157
157
|
|