@hailstails/hone 1.5.0 → 2.0.0-pre.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/ADOPTING.md +104 -199
- package/CHANGELOG.md +138 -0
- package/MIGRATING.md +92 -47
- package/README.md +95 -244
- package/chunks/chunk-5HRMJ4O2.js +608 -0
- package/chunks/chunk-5U4JMWNV.js +9 -0
- package/chunks/{chunk-2O46EB4E.js → chunk-ASUN4AVC.js} +25 -12
- package/chunks/chunk-DGOLOS5A.js +9 -0
- package/chunks/{chunk-HJA4CX7C.js → chunk-FBZBSDED.js} +1 -1
- package/chunks/{chunk-Y2KPZDDV.js → chunk-GNOMK7CR.js} +201 -98
- package/chunks/chunk-IX2VZTBO.js +887 -0
- package/chunks/{chunk-QWA6OVLC.js → chunk-K2W3D3NB.js} +8 -2
- package/chunks/chunk-L7BGRC6D.js +22 -0
- package/chunks/chunk-M6SOGWT7.js +82 -0
- package/chunks/chunk-MWLBA4B3.js +849 -0
- package/chunks/chunk-NRIQD3PI.js +38 -0
- package/chunks/chunk-OKLYWD2Z.js +823 -0
- package/chunks/{chunk-3HFJHJDO.js → chunk-QP5TLOBY.js} +17 -8
- package/chunks/chunk-R75QELTA.js +481 -0
- package/chunks/chunk-RANAKCTW.js +31 -0
- package/chunks/{chunk-NA5L6PUE.js → chunk-RANIXNWY.js} +1 -2
- package/chunks/chunk-RFR3ITBS.js +9 -0
- package/chunks/{chunk-Z4UBS7WI.js → chunk-RGSHTPLA.js} +26 -7
- package/chunks/{chunk-T32FOWZA.js → chunk-TNY2PASL.js} +14 -18
- package/chunks/{chunk-Y4SMWOD2.js → chunk-UJONWHA4.js} +2 -2
- package/chunks/{chunk-WF3PPYRR.js → chunk-VYBO2Q65.js} +4 -2
- package/chunks/chunk-Z6JHBNDS.js +15 -0
- package/chunks/eslint-10-boundary-A4JIQ734.js +14 -0
- package/chunks/eslint-9-boundary-CL5DDBHX.js +34 -0
- package/docs/adding-a-discipline-or-mechanism.md +21 -19
- package/docs/extending.md +5 -5
- package/docs/output-contract.md +700 -14
- package/docs/why-chain-contract.md +6 -6
- package/methods/README.md +2 -2
- package/methods/assessment-template.md +1 -1
- package/methods/lenses/clean-architecture.md +19 -54
- package/methods/lenses/decomposition.md +7 -7
- package/methods/lenses/defended-on-intent.md +4 -4
- package/methods/lenses/di-discipline.md +8 -8
- package/methods/lenses/errors-as-data.md +6 -6
- package/methods/lenses/function-first.md +9 -9
- package/methods/lenses/naming.md +6 -6
- package/methods/lenses/test-discipline.md +8 -8
- package/methods/lenses/type-soundness.md +6 -6
- package/methods/lenses/zod-boundary.md +9 -9
- package/package.json +30 -28
- package/rules/README.md +268 -4
- package/rules/SPIRIT.md +1 -1
- package/rules/cases/a-value-is-one-of-several-kinds-or-states.md +20 -0
- package/rules/cases/an-adopter-is-not-handed-our-risk.md +17 -0
- package/rules/cases/an-operation-can-fail.md +20 -0
- package/rules/cases/builds-the-real-implementations.md +25 -0
- package/rules/cases/causes-an-effect.md +26 -0
- package/rules/cases/checks-a-value-that-may-be-one-of-several-outcomes.md +20 -0
- package/rules/cases/checks-conditions-before-its-work.md +20 -0
- package/rules/cases/coordinates-other-units.md +20 -0
- package/rules/cases/does-one-job.md +23 -0
- package/rules/cases/explains-something-in-prose.md +20 -0
- package/rules/cases/gives-a-value-its-type.md +26 -0
- package/rules/cases/gives-each-unit-its-test.md +20 -0
- package/rules/cases/keeps-state-or-settings-across-calls.md +20 -0
- package/rules/cases/makes-a-new-value-from-what-it-has.md +17 -0
- package/rules/cases/names-something.md +20 -0
- package/rules/cases/needs-the-current-time-a-random-value-a-new-id-or-an-outside-ordering.md +26 -0
- package/rules/cases/puts-code-in-a-file-or-folder.md +20 -0
- package/rules/cases/reads-data-from-outside.md +23 -0
- package/rules/cases/reuses-behaviour-from-another-unit-or-type.md +20 -0
- package/rules/cases/sends-data-out-of-the-program.md +20 -0
- package/rules/cases/sets-how-strictly-the-checker-works.md +14 -0
- package/rules/cases/ships-code-for-others.md +17 -0
- package/rules/cases/states-what-the-unit-gives-back-for-one-case-or-several.md +20 -0
- package/rules/cases/takes-an-outside-dependency.md +38 -0
- package/rules/cases/tests-across-units-or-against-a-real-system.md +20 -0
- package/rules/cases/uses-a-system-or-service-outside-the-program.md +29 -0
- package/rules/cases/uses-what-a-collaborator-gives-back.md +20 -0
- package/rules/cases/writes-basic-logic.md +17 -0
- package/rules/cases.md +36 -59
- package/rules/numbers.md +121 -121
- package/rules/principles/external-behaviour-sits-at-a-boundary.md +12 -0
- package/rules/principles/no-hidden-effects.md +17 -0
- package/rules/principles/no-leak-across-a-boundary.md +19 -0
- package/rules/principles/one-place-decides.md +12 -0
- package/rules/principles/our-code-reads-in-the-common-language.md +12 -0
- package/rules/principles/outside-risk-is-carried-on-purpose.md +13 -0
- package/rules/principles/tests-are-ours.md +12 -0
- package/rules/principles/the-type-checker-proves-it.md +12 -0
- package/rules/principles.md +50 -46
- package/rules/record-kinds/authorised-location.md +26 -0
- package/rules/record-kinds/boundary-record.md +9 -0
- package/rules/record-kinds/debt.md +23 -0
- package/rules/record-kinds/dependency-record.md +9 -0
- package/rules/record-kinds/deviation.md +9 -0
- package/rules/records.md +17 -30
- package/rules/rules/declared-not-asserted.md +16 -0
- package/rules/rules/doer-or-orchestrator.md +16 -0
- package/rules/rules/failures-are-values.md +15 -0
- package/rules/rules/fixed-versions.md +11 -0
- package/rules/rules/guard-first.md +14 -0
- package/rules/rules/handed-what-it-uses.md +16 -0
- package/rules/rules/kinds-are-named.md +16 -0
- package/rules/rules/one-reason-per-module.md +18 -0
- package/rules/rules/one-word-everywhere.md +19 -0
- package/rules/rules/outside-dependencies-justified.md +14 -0
- package/rules/rules/outside-dependencies-stay-at-boundaries.md +18 -0
- package/rules/rules/ports-declared-inside.md +22 -0
- package/rules/rules/shipped-risk-declared.md +11 -0
- package/rules/rules/straight-through-tests.md +15 -0
- package/rules/rules/tested-where-its-owned.md +20 -0
- package/rules/rules/tools-live-in-the-repo.md +11 -0
- package/rules/rules/upstream-stays-untouched.md +11 -0
- package/rules/rules/written-out-answers.md +17 -0
- package/rules/rules.md +117 -81
- package/rules/typescript/checks.md +1668 -202
- package/rules/typescript/recipes/adapter-per-outside-party.md +18 -0
- package/rules/typescript/recipes/assert-to-narrow.md +18 -0
- package/rules/typescript/recipes/bounded-context-generic.md +19 -0
- package/rules/typescript/recipes/closure-factory.md +20 -0
- package/rules/typescript/recipes/companion-test-file.md +18 -0
- package/rules/typescript/recipes/composed-orchestrator.md +18 -0
- package/rules/typescript/recipes/composition-root.md +18 -0
- package/rules/typescript/recipes/copy-never-write-in.md +18 -0
- package/rules/typescript/recipes/declared-not-bundled.md +17 -0
- package/rules/typescript/recipes/dependency-record.md +20 -0
- package/rules/typescript/recipes/domain-vocabulary-list.md +18 -0
- package/rules/typescript/recipes/entity-module.md +20 -0
- package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +18 -0
- package/rules/typescript/recipes/extension-outside-the-vendored-code.md +18 -0
- package/rules/typescript/recipes/failure-asserted-as-a-value.md +18 -0
- package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +20 -0
- package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +18 -0
- package/rules/typescript/recipes/functional-iteration.md +18 -0
- package/rules/typescript/recipes/guard-clauses.md +18 -0
- package/rules/typescript/recipes/integration-test-owns-its-scratch.md +18 -0
- package/rules/typescript/recipes/integration-test-suffix.md +18 -0
- package/rules/typescript/recipes/iteach-over-typed-rows.md +18 -0
- package/rules/typescript/recipes/map-out-at-the-adapter.md +18 -0
- package/rules/typescript/recipes/meaning-in-names-not-comments.md +22 -0
- package/rules/typescript/recipes/named-exported-type.md +18 -0
- package/rules/typescript/recipes/narrow-ports.md +18 -0
- package/rules/typescript/recipes/one-argument-object.md +19 -0
- package/rules/typescript/recipes/port-in-the-domain.md +19 -0
- package/rules/typescript/recipes/ports-in-the-argument.md +18 -0
- package/rules/typescript/recipes/repo-scripts-only.md +18 -0
- package/rules/typescript/recipes/result-union.md +22 -0
- package/rules/typescript/recipes/screaming-folders.md +20 -0
- package/rules/typescript/recipes/shared-strict-base-config.md +20 -0
- package/rules/typescript/recipes/stub-with-vifn.md +20 -0
- package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +18 -0
- package/rules/typescript/recipes/whole-words.md +18 -0
- package/rules/typescript/recipes/whole-written-out-expectation.md +18 -0
- package/rules/typescript/recipes/world-values-through-a-port.md +18 -0
- package/rules/typescript/recipes/zod-at-the-producers-adapter.md +19 -0
- package/rules/typescript/recipes.md +247 -218
- package/rules/typescript/symptoms/absence-standing-for-a-state.md +36 -0
- package/rules/typescript/symptoms/adapter-built-outside-the-root.md +30 -0
- package/rules/typescript/symptoms/ambient-randomness.md +36 -0
- package/rules/typescript/symptoms/answer-set-in-a-hook.md +45 -0
- package/rules/typescript/symptoms/authored-class-or-this/class-keyword.md +30 -0
- package/rules/typescript/symptoms/authored-class-or-this/static-members-only.md +18 -0
- package/rules/typescript/symptoms/authored-class-or-this.md +49 -0
- package/rules/typescript/symptoms/behaviour-tested-away-from-its-owner.md +44 -0
- package/rules/typescript/symptoms/boolean-in-a-signature/boolean-annotation.md +30 -0
- package/rules/typescript/symptoms/boolean-in-a-signature.md +43 -0
- package/rules/typescript/symptoms/branch-in-a-test/test-body.md +213 -0
- package/rules/typescript/symptoms/branch-in-a-test.md +48 -0
- package/rules/typescript/symptoms/bundled-dependency.md +28 -0
- package/rules/typescript/symptoms/catch-all-failure-kind.md +37 -0
- package/rules/typescript/symptoms/change-spread-across-modules.md +27 -0
- package/rules/typescript/symptoms/claimed-type/cast-to-any.md +29 -0
- package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +34 -0
- package/rules/typescript/symptoms/claimed-type/unlisted-cast-site.md +34 -0
- package/rules/typescript/symptoms/claimed-type.md +56 -0
- package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +144 -0
- package/rules/typescript/symptoms/computed-value-in-a-test.md +36 -0
- package/rules/typescript/symptoms/coverage-gate.md +27 -0
- package/rules/typescript/symptoms/date-used-directly/clock-sources.md +31 -0
- package/rules/typescript/symptoms/date-used-directly.md +46 -0
- package/rules/typescript/symptoms/default-for-a-required-value.md +45 -0
- package/rules/typescript/symptoms/default-on-a-closed-union/default-arm.md +32 -0
- package/rules/typescript/symptoms/default-on-a-closed-union.md +32 -0
- package/rules/typescript/symptoms/dependency-without-a-record.md +33 -0
- package/rules/typescript/symptoms/doer-calling-our-own-unit.md +36 -0
- package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +32 -0
- package/rules/typescript/symptoms/double-with-a-body/stub-implementation.md +31 -0
- package/rules/typescript/symptoms/double-with-a-body.md +55 -0
- package/rules/typescript/symptoms/drawer-path/drawer-names.md +28 -0
- package/rules/typescript/symptoms/drawer-path.md +32 -0
- package/rules/typescript/symptoms/duplicate-decision.md +36 -0
- package/rules/typescript/symptoms/edit-inside-vendored-code.md +33 -0
- package/rules/typescript/symptoms/failure-shaped-as-success.md +28 -0
- package/rules/typescript/symptoms/floating-version.md +27 -0
- package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +30 -0
- package/rules/typescript/symptoms/inherited-environment-in-a-subprocess.md +33 -0
- package/rules/typescript/symptoms/inner-layer-imports-outer.md +33 -0
- package/rules/typescript/symptoms/integration-heavy-suite.md +29 -0
- package/rules/typescript/symptoms/large-input-for-a-few-fields.md +37 -0
- package/rules/typescript/symptoms/library-class-built-in-place.md +42 -0
- package/rules/typescript/symptoms/long-function/function-length.md +47 -0
- package/rules/typescript/symptoms/long-function.md +75 -0
- package/rules/typescript/symptoms/loop-keyword/loop-statement.md +34 -0
- package/rules/typescript/symptoms/loop-keyword.md +49 -0
- package/rules/typescript/symptoms/machine-touched-in-a-unit-test.md +40 -0
- package/rules/typescript/symptoms/many-spellings-of-one-concept.md +29 -0
- package/rules/typescript/symptoms/module-level-state.md +30 -0
- package/rules/typescript/symptoms/module-or-global-patched/module-mock-call.md +29 -0
- package/rules/typescript/symptoms/module-or-global-patched.md +38 -0
- package/rules/typescript/symptoms/name-off-its-casing/filename-case.md +16 -0
- package/rules/typescript/symptoms/name-off-its-casing/naming-convention.md +20 -0
- package/rules/typescript/symptoms/name-off-its-casing.md +31 -0
- package/rules/typescript/symptoms/no-lock-file.md +27 -0
- package/rules/typescript/symptoms/orchestrator-that-computes.md +27 -0
- package/rules/typescript/symptoms/outside-dependency-vocabulary-for-basic-logic.md +33 -0
- package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +44 -0
- package/rules/typescript/symptoms/outside-import-past-a-boundary.md +45 -0
- package/rules/typescript/symptoms/outside-type-in-a-signature.md +37 -0
- package/rules/typescript/symptoms/own-type-guard.md +36 -0
- package/rules/typescript/symptoms/port-named-for-a-mechanism.md +34 -0
- package/rules/typescript/symptoms/port-outside-the-domain.md +28 -0
- package/rules/typescript/symptoms/positional-parameters/parameter-count.md +30 -0
- package/rules/typescript/symptoms/positional-parameters.md +43 -0
- package/rules/typescript/symptoms/process-global-used-in-place.md +53 -0
- package/rules/typescript/symptoms/prose-in-code.md +27 -0
- package/rules/typescript/symptoms/rebinding/parameter-reassignment.md +18 -0
- package/rules/typescript/symptoms/rebinding/test-body.md +32 -0
- package/rules/typescript/symptoms/rebinding.md +36 -0
- package/rules/typescript/symptoms/schema-past-its-adapter.md +41 -0
- package/rules/typescript/symptoms/shorthand-name/identifier-names.md +29 -0
- package/rules/typescript/symptoms/shorthand-name.md +32 -0
- package/rules/typescript/symptoms/strictness-weakened/exact-optional-property-types.md +51 -0
- package/rules/typescript/symptoms/strictness-weakened/no-fallthrough-cases-in-switch.md +51 -0
- package/rules/typescript/symptoms/strictness-weakened/no-implicit-override.md +51 -0
- package/rules/typescript/symptoms/strictness-weakened/no-property-access-from-index-signature.md +51 -0
- package/rules/{CD-3/CHECKS.md → typescript/symptoms/strictness-weakened/no-unchecked-indexed-access.md} +23 -40
- package/rules/typescript/symptoms/strictness-weakened/strict.md +51 -0
- package/rules/typescript/symptoms/strictness-weakened/use-unknown-in-catch-variables.md +51 -0
- package/rules/typescript/symptoms/strictness-weakened.md +32 -0
- package/rules/typescript/symptoms/tangled-function/cognitive-complexity.md +42 -0
- package/rules/typescript/symptoms/tangled-function.md +75 -0
- package/rules/typescript/symptoms/test-of-the-type-checker.md +24 -0
- package/rules/typescript/symptoms/test-switched-off/focused-tests.md +15 -0
- package/rules/typescript/symptoms/test-switched-off/skipped-tests.md +15 -0
- package/rules/typescript/symptoms/test-switched-off.md +25 -0
- package/rules/typescript/symptoms/text-past-its-reader/test-body.md +30 -0
- package/rules/typescript/symptoms/text-past-its-reader.md +71 -0
- package/rules/typescript/symptoms/throw-between-our-units.md +46 -0
- package/rules/typescript/symptoms/throw-or-catch-in-a-test/throw-statement.md +32 -0
- package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +39 -0
- package/rules/typescript/symptoms/throw-or-catch-in-a-test.md +35 -0
- package/rules/typescript/symptoms/thrown-non-error/throw-only-error.md +15 -0
- package/rules/typescript/symptoms/thrown-non-error.md +27 -0
- package/rules/typescript/symptoms/tool-fetched-at-run-time.md +27 -0
- package/rules/typescript/symptoms/tuple-as-data.md +29 -0
- package/rules/typescript/symptoms/type-derived-from-code/factory-return-types.md +29 -0
- package/rules/typescript/symptoms/type-derived-from-code.md +41 -0
- package/rules/typescript/symptoms/types-only-file.md +36 -0
- package/rules/typescript/symptoms/unasserted-call.md +29 -0
- package/rules/typescript/symptoms/unit-without-a-running-test/companion-test-file.md +28 -0
- package/rules/typescript/symptoms/unit-without-a-running-test.md +28 -0
- package/rules/{CD-5/CHECKS.md → typescript/symptoms/untracked-escape/directive-pointers.md} +12 -25
- package/rules/typescript/symptoms/untracked-escape.md +32 -0
- package/rules/typescript/symptoms/untyped-value/explicit-any.md +14 -0
- package/rules/typescript/symptoms/untyped-value/implicit-any-let.md +14 -0
- package/rules/typescript/symptoms/untyped-value.md +36 -0
- package/rules/typescript/symptoms/wide-input.md +37 -0
- package/rules/typescript/symptoms/wide-port.md +32 -0
- package/rules/typescript/symptoms/work-inside-a-condition/else-after-an-exit.md +40 -0
- package/rules/typescript/symptoms/work-inside-a-condition.md +41 -0
- package/rules/typescript/symptoms/write-into-a-parameter/parameter-mutation.md +33 -0
- package/rules/typescript/symptoms/write-into-a-parameter.md +34 -0
- package/rules/typescript/symptoms.md +623 -414
- package/{core → src/application}/conformance/conformance-testing-types.d.ts +16 -6
- package/src/audit.d.ts +20 -0
- package/{api → src}/audit.js +6 -5
- package/{core/rule-set-reader → src/domain/rule-set}/authored-rule-set-types.d.ts +2 -2
- package/{core/values → src/domain/rule-set}/edition-types.d.ts +3 -3
- package/{core/values → src/domain/rule-set}/identifier-types.d.ts +2 -2
- package/{core/conformance → src/domain/runner}/conformance-types.d.ts +1 -1
- package/{core/mechanism-port → src/domain/runner}/piece-failure-types.d.ts +1 -1
- package/{core/mechanism-port → src/domain/runner}/runner-module-types.d.ts +4 -4
- package/src/domain/runner/runner-result-types.d.ts +88 -0
- package/src/eslint-plugin.d.ts +16 -0
- package/src/eslint-plugin.js +72 -0
- package/src/hone.js +13563 -0
- package/src/infrastructure/disciplines-file/version-one-names.json +634 -0
- package/src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/class-keyword.examples.json +84 -0
- package/{mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js → src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/eslint-plugin.js} +9 -10
- package/src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/piece.json +12 -0
- package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/piece.json +24 -0
- package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/static-members-only.examples.json +36 -0
- package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/eslint-plugin.js +16 -0
- package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/non-null-assertions.examples.json +48 -0
- package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/piece.json +22 -0
- package/src/infrastructure/engines/eslint/long-function/function-length/function-length.examples.json +42 -0
- package/src/infrastructure/engines/eslint/long-function/function-length/piece.json +16 -0
- package/{mechanisms/eslint/CD-7/cd7/cd7.eslint-plugin.js → src/infrastructure/engines/eslint/name-off-its-casing/filename-case/eslint-plugin.js} +5 -4
- package/src/infrastructure/engines/eslint/name-off-its-casing/filename-case/filename-case.examples.json +60 -0
- package/src/infrastructure/engines/eslint/name-off-its-casing/filename-case/piece.json +11 -0
- package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/eslint-plugin.js +16 -0
- package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/naming-convention.examples.json +78 -0
- package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/piece.json +214 -0
- package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/eslint-plugin.js +16 -0
- package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/parameter-count.examples.json +30 -0
- package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/piece.json +18 -0
- package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/eslint-plugin.js +16 -0
- package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/parameter-reassignment.examples.json +30 -0
- package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/piece.json +17 -0
- package/{mechanisms → src/infrastructure/engines}/eslint/runner/README.md +5 -5
- package/{mechanisms/eslint/runner → src/infrastructure/engines/eslint/runner/pieces}/eslint-piece-settings-types.d.ts +1 -1
- package/{mechanisms → src/infrastructure/engines}/eslint/runner/runner.js +2186 -1372
- package/{mechanisms/eslint/CD-41 → src/infrastructure/engines/eslint/tangled-function/cognitive-complexity}/README.md +1 -1
- package/src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/cognitive-complexity.examples.json +48 -0
- package/{mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js → src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/eslint-plugin.js} +58 -14
- package/src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/piece.json +12 -0
- package/{mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js → src/infrastructure/engines/eslint/test-switched-off/focused-tests/eslint-plugin.js} +5 -4
- package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/focused-tests.examples.json +60 -0
- package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/piece.json +12 -0
- package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/piece.json +16 -0
- package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/skipped-tests.examples.json +54 -0
- package/{mechanisms/eslint/CD-10/cd10/cd10.eslint-plugin.js → src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/eslint-plugin.js} +5 -4
- package/src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/piece.json +12 -0
- package/src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/throw-only-error.examples.json +54 -0
- package/{mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js → src/infrastructure/engines/eslint/untyped-value/explicit-any/eslint-plugin.js} +14 -9
- package/src/infrastructure/engines/eslint/untyped-value/explicit-any/explicit-any.examples.json +36 -0
- package/src/infrastructure/engines/eslint/untyped-value/explicit-any/piece.json +12 -0
- package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/implicit-any-let.examples.json +48 -0
- package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/piece.json +16 -0
- package/src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/else-after-an-exit.examples.json +36 -0
- package/{mechanisms/eslint/CD-42/cd42/cd42.eslint-plugin.js → src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/eslint-plugin.js} +29 -13
- package/src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/piece.json +12 -0
- package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/class-keyword.examples.json +84 -0
- package/{mechanisms/audit/CD-14 → src/infrastructure/engines/walker/authored-class-or-this/class-keyword}/class-syntax.js +6 -3
- package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/piece.json +10 -0
- package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/boolean-annotation.examples.json +42 -0
- package/{mechanisms/audit/CD-43 → src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation}/boolean-signatures.js +14 -6
- package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/piece.json +9 -0
- package/src/infrastructure/engines/walker/branch-in-a-test/test-body/piece.json +95 -0
- package/{mechanisms/audit/CD-27 → src/infrastructure/engines/walker/branch-in-a-test/test-body}/test-body-logic.js +183 -54
- package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body.examples.json +280 -0
- package/{mechanisms/audit/CD-1 → src/infrastructure/engines/walker/claimed-type/cast-to-any}/any-cast.js +7 -4
- package/src/infrastructure/engines/walker/claimed-type/cast-to-any/cast-to-any.examples.json +48 -0
- package/src/infrastructure/engines/walker/claimed-type/cast-to-any/piece.json +9 -0
- package/{mechanisms/audit/CD-2 → src/infrastructure/engines/walker/claimed-type/unlisted-cast-site}/cast-expressions.js +13 -6
- package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/piece.json +14 -0
- package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/unlisted-cast-site.examples.json +54 -0
- package/src/infrastructure/engines/walker/computed-value-in-a-test/test-body/piece.json +18 -0
- package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.examples.json +30 -0
- package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.js +36 -0
- package/src/infrastructure/engines/walker/date-used-directly/clock-sources/piece.json +9 -0
- package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/default-arm.examples.json +36 -0
- package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/piece.json +9 -0
- package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/switch-defaults.js +54 -0
- package/src/infrastructure/engines/walker/double-with-a-body/logic-in-a-passed-function/piece.json +18 -0
- package/{mechanisms/audit/CD-25 → src/infrastructure/engines/walker/double-with-a-body/stub-implementation}/dependency-isolation.js +8 -4
- package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/piece.json +9 -0
- package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/stub-implementation.examples.json +36 -0
- package/{mechanisms/audit/CD-7 → src/infrastructure/engines/walker/drawer-path/drawer-names}/categorical-paths.js +23 -8
- package/src/infrastructure/engines/walker/drawer-path/drawer-names/drawer-names.examples.json +42 -0
- package/src/infrastructure/engines/walker/drawer-path/drawer-names/piece.json +9 -0
- package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/git-spawn-environment.examples.json +36 -0
- package/{mechanisms/audit/CD-47 → src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment}/hermetic-git-spawns.js +13 -4
- package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/piece.json +9 -0
- package/src/infrastructure/engines/walker/loop-keyword/loop-statement/loop-statement.examples.json +48 -0
- package/{mechanisms/audit/CD-15 → src/infrastructure/engines/walker/loop-keyword/loop-statement}/loops.js +12 -4
- package/src/infrastructure/engines/walker/loop-keyword/loop-statement/piece.json +9 -0
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mock-call.examples.json +36 -0
- package/{mechanisms/audit/CD-26 → src/infrastructure/engines/walker/module-or-global-patched/module-mock-call}/module-mocking.js +8 -4
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/piece.json +9 -0
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-boundaries.js +133 -0
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-or-require.examples.json +42 -0
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/piece.json +14 -0
- package/src/infrastructure/engines/walker/rebinding/test-body/piece.json +18 -0
- package/{mechanisms/audit/runner → src/infrastructure/engines/walker/runner/pieces}/walker-piece.d.ts +8 -14
- package/{mechanisms/audit → src/infrastructure/engines/walker}/runner/runner.js +191 -120
- package/{mechanisms/audit/runner → src/infrastructure/engines/walker/runner/toolchain}/typescript-parse.d.ts +1 -0
- package/src/infrastructure/engines/walker/shorthand-name/identifier-names/identifier-names.examples.json +42 -0
- package/{mechanisms/audit/CD-6 → src/infrastructure/engines/walker/shorthand-name/identifier-names}/identifier-names.js +32 -15
- package/src/infrastructure/engines/walker/shorthand-name/identifier-names/piece.json +9 -0
- package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/exact-optional-property-types.examples.json +71 -0
- package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/piece.json +17 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/no-fallthrough-cases-in-switch.examples.json +71 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/piece.json +17 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/no-implicit-override.examples.json +71 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/piece.json +17 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/no-property-access-from-index-signature.examples.json +71 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/piece.json +17 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/no-unchecked-indexed-access.examples.json +71 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/piece.json +17 -0
- package/{mechanisms/audit/CD-3 → src/infrastructure/engines/walker/strictness-weakened/strict}/compiler-overrides.js +102 -38
- package/src/infrastructure/engines/walker/strictness-weakened/strict/piece.json +13 -0
- package/src/infrastructure/engines/walker/strictness-weakened/strict/strict.examples.json +64 -0
- package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/piece.json +17 -0
- package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/use-unknown-in-catch-variables.examples.json +71 -0
- package/src/infrastructure/engines/walker/text-past-its-reader/test-body/piece.json +18 -0
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/piece.json +9 -0
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throw-statement.examples.json +36 -0
- package/{mechanisms/audit/CD-10 → src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement}/throws-in-tests.js +6 -3
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/try-block/piece.json +18 -0
- package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.examples.json +36 -0
- package/{mechanisms/audit/CD-7a → src/infrastructure/engines/walker/type-derived-from-code/factory-return-types}/factory-return-types.js +5 -3
- package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/piece.json +9 -0
- package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/companion-test-file.examples.json +36 -0
- package/{mechanisms/audit/CD-23 → src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file}/export-test-sibling.js +7 -4
- package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/piece.json +9 -0
- package/{mechanisms/audit/CD-5 → src/infrastructure/engines/walker/untracked-escape/directive-pointers}/comments-directives.js +40 -19
- package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/directive-pointers.examples.json +96 -0
- package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/piece.json +16 -0
- package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.examples.json +42 -0
- package/{mechanisms/audit/CD-44 → src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation}/parameter-mutation.js +22 -7
- package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/piece.json +9 -0
- package/src/rule-set.d.ts +4 -0
- package/src/testing.d.ts +7 -0
- package/src/testing.js +524 -0
- package/api/audit.d.ts +0 -20
- package/api/rule-set.d.ts +0 -4
- package/api/testing.d.ts +0 -5
- package/api/testing.js +0 -238
- package/chunks/chunk-335ITLPO.js +0 -7
- package/chunks/chunk-5U4VTFD5.js +0 -1949
- package/chunks/chunk-E6VR3VRV.js +0 -268
- package/chunks/chunk-FR4FASVM.js +0 -108
- package/chunks/chunk-LDQUT742.js +0 -15
- package/chunks/chunk-MXSIQPCV.js +0 -13
- package/chunks/chunk-RWQ4UNKY.js +0 -24
- package/core/check/tool-command.js +0 -2909
- package/core/mechanism-port/runner-result-types.d.ts +0 -19
- package/mechanisms/audit/CD-1/piece.json +0 -13
- package/mechanisms/audit/CD-10/piece.json +0 -13
- package/mechanisms/audit/CD-14/piece.json +0 -13
- package/mechanisms/audit/CD-15/piece.json +0 -13
- package/mechanisms/audit/CD-17/clock-sources.js +0 -28
- package/mechanisms/audit/CD-17/piece.json +0 -13
- package/mechanisms/audit/CD-19/import-boundaries.js +0 -99
- package/mechanisms/audit/CD-19/piece.json +0 -18
- package/mechanisms/audit/CD-2/piece.json +0 -18
- package/mechanisms/audit/CD-23/piece.json +0 -13
- package/mechanisms/audit/CD-25/piece.json +0 -13
- package/mechanisms/audit/CD-26/piece.json +0 -13
- package/mechanisms/audit/CD-27/piece.json +0 -17
- package/mechanisms/audit/CD-3/piece.json +0 -77
- package/mechanisms/audit/CD-43/piece.json +0 -13
- package/mechanisms/audit/CD-44/piece.json +0 -13
- package/mechanisms/audit/CD-47/piece.json +0 -13
- package/mechanisms/audit/CD-5/piece.json +0 -20
- package/mechanisms/audit/CD-6/piece.json +0 -13
- package/mechanisms/audit/CD-7/piece.json +0 -13
- package/mechanisms/audit/CD-7a/piece.json +0 -13
- package/mechanisms/audit/CD-8/piece.json +0 -13
- package/mechanisms/audit/CD-8/switch-defaults.js +0 -42
- package/mechanisms/eslint/CD-1/piece.json +0 -23
- package/mechanisms/eslint/CD-10/piece.json +0 -15
- package/mechanisms/eslint/CD-14/piece.json +0 -31
- package/mechanisms/eslint/CD-2/cd2/cd2.eslint-plugin.js +0 -15
- package/mechanisms/eslint/CD-2/piece.json +0 -25
- package/mechanisms/eslint/CD-27/piece.json +0 -23
- package/mechanisms/eslint/CD-40/cd40/cd40.eslint-plugin.js +0 -15
- package/mechanisms/eslint/CD-40/piece.json +0 -21
- package/mechanisms/eslint/CD-41/piece.json +0 -23
- package/mechanisms/eslint/CD-42/piece.json +0 -15
- package/mechanisms/eslint/CD-44/cd44/cd44.eslint-plugin.js +0 -15
- package/mechanisms/eslint/CD-44/piece.json +0 -20
- package/mechanisms/eslint/CD-6/cd6/cd6.eslint-plugin.js +0 -15
- package/mechanisms/eslint/CD-6/piece.json +0 -217
- package/mechanisms/eslint/CD-7/piece.json +0 -15
- package/rules/CD-1/CHECKS.md +0 -41
- package/rules/CD-1/README.md +0 -15
- package/rules/CD-1/discipline.json +0 -195
- package/rules/CD-10/CHECKS.md +0 -51
- package/rules/CD-10/README.md +0 -15
- package/rules/CD-10/discipline.json +0 -133
- package/rules/CD-11/CHECKS.md +0 -15
- package/rules/CD-11/README.md +0 -15
- package/rules/CD-11/discipline.json +0 -12
- package/rules/CD-12/CHECKS.md +0 -15
- package/rules/CD-12/README.md +0 -15
- package/rules/CD-12/discipline.json +0 -12
- package/rules/CD-13/CHECKS.md +0 -15
- package/rules/CD-13/README.md +0 -15
- package/rules/CD-13/discipline.json +0 -12
- package/rules/CD-14/CHECKS.md +0 -51
- package/rules/CD-14/README.md +0 -15
- package/rules/CD-14/discipline.json +0 -173
- package/rules/CD-15/CHECKS.md +0 -44
- package/rules/CD-15/README.md +0 -15
- package/rules/CD-15/discipline.json +0 -73
- package/rules/CD-16/CHECKS.md +0 -9
- package/rules/CD-16/README.md +0 -15
- package/rules/CD-17/CHECKS.md +0 -39
- package/rules/CD-17/README.md +0 -15
- package/rules/CD-17/discipline.json +0 -51
- package/rules/CD-18/CHECKS.md +0 -15
- package/rules/CD-18/README.md +0 -15
- package/rules/CD-18/discipline.json +0 -12
- package/rules/CD-19/CHECKS.md +0 -51
- package/rules/CD-19/README.md +0 -15
- package/rules/CD-19/discipline.json +0 -63
- package/rules/CD-2/CHECKS.md +0 -60
- package/rules/CD-2/README.md +0 -15
- package/rules/CD-2/discipline.json +0 -151
- package/rules/CD-20/CHECKS.md +0 -9
- package/rules/CD-20/README.md +0 -15
- package/rules/CD-21/CHECKS.md +0 -15
- package/rules/CD-21/README.md +0 -15
- package/rules/CD-21/discipline.json +0 -12
- package/rules/CD-22/CHECKS.md +0 -15
- package/rules/CD-22/README.md +0 -15
- package/rules/CD-22/discipline.json +0 -12
- package/rules/CD-23/CHECKS.md +0 -37
- package/rules/CD-23/README.md +0 -15
- package/rules/CD-23/discipline.json +0 -57
- package/rules/CD-24/CHECKS.md +0 -9
- package/rules/CD-24/README.md +0 -15
- package/rules/CD-25/CHECKS.md +0 -40
- package/rules/CD-25/README.md +0 -15
- package/rules/CD-25/discipline.json +0 -57
- package/rules/CD-26/CHECKS.md +0 -38
- package/rules/CD-26/README.md +0 -15
- package/rules/CD-26/discipline.json +0 -57
- package/rules/CD-27/CHECKS.md +0 -460
- package/rules/CD-27/README.md +0 -15
- package/rules/CD-27/discipline.json +0 -437
- package/rules/CD-28/CHECKS.md +0 -15
- package/rules/CD-28/README.md +0 -15
- package/rules/CD-28/discipline.json +0 -12
- package/rules/CD-29/CHECKS.md +0 -15
- package/rules/CD-29/README.md +0 -15
- package/rules/CD-29/discipline.json +0 -12
- package/rules/CD-3/README.md +0 -15
- package/rules/CD-3/discipline.json +0 -641
- package/rules/CD-30/CHECKS.md +0 -15
- package/rules/CD-30/README.md +0 -15
- package/rules/CD-30/discipline.json +0 -12
- package/rules/CD-31/CHECKS.md +0 -15
- package/rules/CD-31/README.md +0 -15
- package/rules/CD-31/discipline.json +0 -12
- package/rules/CD-32/CHECKS.md +0 -15
- package/rules/CD-32/README.md +0 -26
- package/rules/CD-32/discipline.json +0 -12
- package/rules/CD-33/CHECKS.md +0 -15
- package/rules/CD-33/README.md +0 -26
- package/rules/CD-33/discipline.json +0 -12
- package/rules/CD-34/CHECKS.md +0 -15
- package/rules/CD-34/README.md +0 -25
- package/rules/CD-34/discipline.json +0 -12
- package/rules/CD-39/CHECKS.md +0 -15
- package/rules/CD-39/README.md +0 -26
- package/rules/CD-39/discipline.json +0 -12
- package/rules/CD-4/CHECKS.md +0 -15
- package/rules/CD-4/README.md +0 -15
- package/rules/CD-4/discipline.json +0 -12
- package/rules/CD-40/CHECKS.md +0 -41
- package/rules/CD-40/README.md +0 -15
- package/rules/CD-40/discipline.json +0 -58
- package/rules/CD-41/CHECKS.md +0 -66
- package/rules/CD-41/README.md +0 -15
- package/rules/CD-41/discipline.json +0 -138
- package/rules/CD-42/CHECKS.md +0 -49
- package/rules/CD-42/README.md +0 -15
- package/rules/CD-42/discipline.json +0 -61
- package/rules/CD-43/CHECKS.md +0 -39
- package/rules/CD-43/README.md +0 -15
- package/rules/CD-43/discipline.json +0 -65
- package/rules/CD-44/CHECKS.md +0 -50
- package/rules/CD-44/README.md +0 -15
- package/rules/CD-44/discipline.json +0 -111
- package/rules/CD-45/CHECKS.md +0 -15
- package/rules/CD-45/README.md +0 -15
- package/rules/CD-45/discipline.json +0 -12
- package/rules/CD-46/CHECKS.md +0 -9
- package/rules/CD-46/README.md +0 -27
- package/rules/CD-47/CHECKS.md +0 -39
- package/rules/CD-47/README.md +0 -15
- package/rules/CD-47/discipline.json +0 -57
- package/rules/CD-5/README.md +0 -15
- package/rules/CD-5/discipline.json +0 -131
- package/rules/CD-6/CHECKS.md +0 -53
- package/rules/CD-6/README.md +0 -15
- package/rules/CD-6/discipline.json +0 -165
- package/rules/CD-7/CHECKS.md +0 -48
- package/rules/CD-7/README.md +0 -15
- package/rules/CD-7/discipline.json +0 -142
- package/rules/CD-7a/CHECKS.md +0 -40
- package/rules/CD-7a/README.md +0 -15
- package/rules/CD-7a/discipline.json +0 -57
- package/rules/CD-8/CHECKS.md +0 -44
- package/rules/CD-8/README.md +0 -15
- package/rules/CD-8/discipline.json +0 -57
- package/rules/CD-9/CHECKS.md +0 -15
- package/rules/CD-9/README.md +0 -15
- package/rules/CD-9/discipline.json +0 -12
- package/rules/typescript/symptoms.json +0 -1005
- /package/{core/values → src/domain/finding}/anchor.d.ts +0 -0
- /package/{core/values → src/domain/repository}/branded.d.ts +0 -0
- /package/{core/values → src/domain/repository}/repo-path-types.d.ts +0 -0
- /package/{core/values → src/domain}/result.d.ts +0 -0
- /package/{core/values → src/domain/rule-set}/clause-address-types.d.ts +0 -0
- /package/{core/values → src/domain/settings/json-values}/json-value.d.ts +0 -0
- /package/{mechanisms/eslint/CD-14 → src/infrastructure/engines/eslint/authored-class-or-this/class-keyword}/README.md +0 -0
- /package/{mechanisms/eslint/CD-2 → src/infrastructure/engines/eslint/claimed-type/non-null-assertions}/README.md +0 -0
- /package/{mechanisms/eslint/CD-7 → src/infrastructure/engines/eslint/name-off-its-casing/filename-case}/README.md +0 -0
- /package/{mechanisms/eslint/CD-6 → src/infrastructure/engines/eslint/name-off-its-casing/naming-convention}/README.md +0 -0
- /package/{mechanisms/eslint/CD-40 → src/infrastructure/engines/eslint/positional-parameters/parameter-count}/README.md +0 -0
- /package/{mechanisms/eslint/CD-44 → src/infrastructure/engines/eslint/rebinding/parameter-reassignment}/README.md +0 -0
- /package/{mechanisms/eslint/CD-27 → src/infrastructure/engines/eslint/test-switched-off/focused-tests}/README.md +0 -0
- /package/{mechanisms/eslint/CD-10 → src/infrastructure/engines/eslint/thrown-non-error/throw-only-error}/README.md +0 -0
- /package/{mechanisms/eslint/CD-1 → src/infrastructure/engines/eslint/untyped-value/explicit-any}/README.md +0 -0
- /package/{mechanisms/eslint/CD-42 → src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit}/README.md +0 -0
- /package/{mechanisms/audit → src/infrastructure/engines/walker}/runner/README.md +0 -0
- /package/{api → src}/rule-set.js +0 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/@hailstails/hone)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
|
|
9
|
-
Hone checks a repository against the disciplines it has chosen to adopt. It is a tool, not a framework: it reads what the repository selected, hands each selected clause to the mechanism that checks it, applies the repository's recorded exceptions, and prints one verdict. Its core enforces nothing and names no discipline and no mechanism. A discipline (for example
|
|
9
|
+
Hone checks a repository against the disciplines it has chosen to adopt. It is a tool, not a framework: it reads what the repository selected, hands each selected clause to the mechanism that checks it, applies the repository's recorded exceptions, and prints one verdict. Its core enforces nothing and names no discipline and no mechanism. A discipline (for example the one that flags an [authored class](rules/typescript/symptoms.md#authored-class-or-this)) is data under `rules/`, and a mechanism is a runner under `mechanisms/`; the core reaches both only through files and one module contract.
|
|
10
10
|
|
|
11
11
|
**Install the npm package `@hailstails/hone`.** The unscoped name `hone` on npm belongs to an unrelated package: never run `npm install hone`. `@hailstails/hone` installs one command, `hone`:
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ npm install --save-dev --save-exact @hailstails/hone@<version>
|
|
|
17
17
|
|
|
18
18
|
With pnpm the second command is `pnpm add -D --save-exact @hailstails/hone@<version>`. Stable releases are published to npm under the dist-tag `latest` and pre-releases under `next`; the badge above shows the version `latest` installs. Pin the exact version rather than installing by tag: a major release can remove or rename a clause address, config key or flag, and an install by tag can record a range. The alternative is the tarball attached to each [GitHub release](https://github.com/HailsTails/hone/releases), installed with `npm install --save-dev <path-to-tarball>`. A repository on the package's old name, `honed`, moves with [MIGRATING.md](MIGRATING.md#11-moving-from-honed-to-hailstailshone). [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 has the steps, and the alternative of building the tarball from a pinned commit.
|
|
19
19
|
|
|
20
|
-
Two
|
|
20
|
+
Two engines ship: `walker`, a standalone TypeScript syntax walker, and `eslint`, which runs the check as an ESLint rule inside the team's own ESLint setup. Rules are referred to by name; a number is only a clause address. [rules/README.md](rules/README.md) explains how the named pages read, and [the checks page](rules/typescript/checks.md) lists every check; a check that needs ESLint says so on its page. The rest are judgement rules, applied in review with the review methods in [methods/](methods/README.md).
|
|
21
21
|
|
|
22
22
|
To adopt Hone in another repository, follow [ADOPTING.md](ADOPTING.md) step by step. A repository already using the older standalone route, or a copy of Hone's source, follows [MIGRATING.md](MIGRATING.md) instead.
|
|
23
23
|
|
|
@@ -25,284 +25,135 @@ A team adds its own disciplines as a rule set in its own repository, with ESLint
|
|
|
25
25
|
|
|
26
26
|
## Commands
|
|
27
27
|
|
|
28
|
-
The package ships one command, `hone
|
|
28
|
+
The package ships one command, `hone`. `check` and `project` run through a `package.json` script as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) shows; `record-debt` runs once, when a repository adopts Hone; `prune-debt` runs when the check names it, to remove the records of debt that is paid; `authorise` writes one authorised location; `upgrade` runs once, to move a version 1 repository to version 2, as [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) section 20 shows. `hone --help` lists the commands, and `hone <command> --help` gives each one's options and exit codes.
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
hone check --repo <dir> [--base-revision <revision>] [--report-output <full|failures-only|counts|verdict-only>] [--forfeiture <this-run|elsewhere>]
|
|
32
|
-
hone project --repo <dir>
|
|
33
|
-
hone record-debt --repo <dir> --base-revision <revision> [--leave <path>]...
|
|
34
|
-
hone prune-debt --repo <dir> [--base-revision <revision>] [--forfeiture <this-run|elsewhere>]
|
|
35
|
-
hone split-records --repo <dir>
|
|
36
|
-
hone --help
|
|
37
|
-
hone --version
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
`--repo` is the folder that holds `disciplines.json`, usually the repository root. `hone --help` lists the commands, `hone check --help`, `hone project --help`, `hone record-debt --help`, `hone prune-debt --help` and `hone split-records --help` list each one's options and exit codes, and `hone --version` prints the installed version. A command typed wrongly is a load failure `arguments-invalid` that says what was wrong, a `--repo` folder with no `disciplines.json` is the load failure `selection-absent`, and an error Hone did not expect is the load failure `unexpected-error`; each exits `2`. Everything Hone prints goes to standard output, so exit `1` always comes with `verdict: fail`. From a source checkout the same command is `node core/check/tool-command.ts check --repo <dir>`.
|
|
41
|
-
|
|
42
|
-
[docs/output-contract.md](docs/output-contract.md) lists every line `hone` prints, exactly as it prints it, with the exit codes and which parts are stable for hooks, CI and agents to rely on. A test renders every kind of line and checks it against that page, both ways.
|
|
43
|
-
|
|
44
|
-
`hone check` loads the repository's selection, exceptions, rule sets and pieces; works out which files changed since `--base-revision`; runs each selected mechanism once over the repository's tracked `.ts`, `.tsx`, `.mts` and `.cts` files; applies the exceptions; and prints a plain-text report ending in `verdict: pass` or `verdict: fail`, followed by ` (partial assessment)` when the run left part of the assessment to another run. It exits `0` when the verdict is `pass`, `1` when it is `fail`, and `2` on a load failure, which prints one line, `load failure: <kind> <fields>`. `hone project`, `hone record-debt`, `hone prune-debt` and `hone split-records` exit `0` or `2`.
|
|
45
|
-
|
|
46
|
-
The report lists the excluded paths, the clauses not adopted, the clauses adopted with their mechanism not run, the edition each clause with more than one edition ran, findings, exempted findings, uncovered clauses, stale, forfeited, unrecorded and doubly-held exceptions, invalid exception records, unmeasured checks, projection problems, any part of the assessment left to another run and, last, where to read first for each clause with findings and the command that removes the records of paid debt, each with its count. The verdict is `pass` only when every list except the excluded paths, clauses not adopted, clauses not run, editions, exempted findings, assessment and where to read first is empty.
|
|
47
|
-
|
|
48
|
-
An `unrecorded` line is `<clause> <mechanism> <kind> <detail>`. Two kinds end with a note:
|
|
49
|
-
|
|
50
|
-
| Kind | Line |
|
|
51
|
-
| --- | --- |
|
|
52
|
-
| `inline-disable` naming no rule | `<clause> eslint inline-disable <file>:<line> <comment> names no rule and escapes every selected clause: naming the rule is the cheap fix` |
|
|
53
|
-
| `command-line-option` that weakens the run | `<clause> eslint command-line-option <package.json> <script> <option> weakens the script's whole run, so no record can cover it: remove it from the script` |
|
|
54
|
-
| `command-line-option` Hone cannot judge, because another command comes before `eslint` in its script | `<clause> eslint command-line-option <package.json> <script> <option>: <command> is not the first command of its script, so Hone cannot tell what the option does to the files under check; give <command> a script of its own, such as "<invocation>"` |
|
|
55
|
-
| `command-line-option` Hone cannot judge, because something before `eslint` in its own command is not a package runner or a `NAME=value` setting | `<clause> eslint command-line-option <package.json> <script> <option>: "<wrapper>" comes before <command> and is neither a package runner nor a NAME=value setting, so Hone cannot tell what the option does to the files under check; put only package runners and NAME=value settings before <command>` |
|
|
56
|
-
| `command-line-option` Hone cannot judge, because a quote in a script naming `eslint` has no partner; the whole script stands in for the option | `<clause> eslint command-line-option <package.json> <script> <script text>: a quote in the script has no partner, so Hone cannot read what the script passes to <command> or tell what that does to the files under check; pair every quote in the script` |
|
|
57
|
-
|
|
58
|
-
`<command>` is the `eslint` call as the script writes it, `<invocation>` is its whole command with its settings and options, from the same script, and `<wrapper>` is the first token before it that Hone does not read, such as `env` or a runner flag like `-y` or `-C`. `cross-env` followed only by `NAME=value` settings counts as a setting. Once only package runners and settings come first, Hone judges the option: `-c` naming the config ESLint already finds, and `--ignore-pattern` that ignores no checked file, are then not reported.
|
|
59
|
-
|
|
60
|
-
`readFirst` comes last, just before the verdict, so a reader who looks only at the end of a failing report lands on it. It has one line per clause with findings, not one per finding, in the order the findings first name the clauses. Each line points at the Spirit section of the clause's rule page, `rules/<ID>/README.md` in the clause's rule set, and, where the repository has written one, at the clause's own section in `disciplines.assessment.md` at the repository root first. That file is where a repository records its own causes, forward goal and steps for a clause; [ADOPTING step 5a](ADOPTING.md#5a-write-the-assessment) says how to write it. Paths are printed with forward slashes, relative to the `--repo` folder; a page on another drive is printed as its absolute path.
|
|
61
|
-
|
|
62
|
-
When `disciplines.assessment.md` is not written yet, or cannot be read, one note line comes first and says so, naming ADOPTING step 5a; each clause line then names its rule page only. The note counts as an entry, so a report with two failing clauses and no assessment file prints `readFirst (3)`. A clause line names the clause's section when the file has one, and says `disciplines.assessment.md does not assess this clause` when the file is there without it. When the check finds a `stale` or `forfeited` `file-carve-out` whose debt is paid, one more line comes last and names the exact `hone prune-debt` command for this repository, as [Pruning paid debt](#pruning-paid-debt) shows. [The output contract](docs/output-contract.md#report-lines) lists every `readFirst` line exactly.
|
|
63
|
-
|
|
64
|
-
A file that does not assess a clause is normal: the assessment covers the clauses the repository chose to describe, and the rule page's Spirit is the read for the rest.
|
|
30
|
+
[docs/output-contract.md](docs/output-contract.md) lists every line `hone` prints, the exit codes, the report's sections and which parts are stable for hooks, CI and agents to rely on.
|
|
65
31
|
|
|
66
|
-
|
|
32
|
+
`hone check` loads the repository's `hone.config.json`, the symptom catalogue and the records in `hone-records`; works out which files changed since `--base-revision`; runs each engine its listed checks name once over the repository's tracked files; answers each finding by the records; and prints one report ending in its verdict. The verdict and exit code always come from the whole report, whatever `--report-output` or `reportOutput` print.
|
|
67
33
|
|
|
68
|
-
Hone
|
|
69
|
-
|
|
70
|
-
`--report-output` sets how much of the report is printed for one run, overriding `reportOutput` in `disciplines.json`; with neither, the output is `full`. `full` prints every non-empty section, `failures-only` leaves out the informational sections and keeps `readFirst`, `counts` prints each section's heading line only, with `informational` or `guidance` after the sections that never fail the run, and `verdict-only` prints the verdict line alone; [the output contract](docs/output-contract.md#the-report) shows each.
|
|
71
|
-
|
|
72
|
-
The output changes only what is printed: the verdict and exit code always come from the whole report. An unknown `--report-output` value is a load failure `arguments-invalid`; an unknown `reportOutput` value makes `disciplines.json` `file-malformed`, even when `--report-output` is given. Load failures print the same in every output.
|
|
73
|
-
|
|
74
|
-
Without `--base-revision`, Hone cannot tell which files were touched, so a file carve-out cannot be forfeited; if any file carve-out exists the report lists `forfeiture-unmeasured` and the run fails. For the same reason it cannot tell whether an entry with an earlier-contract why-chain is unchanged; if one exists the report lists `legacy-chain-unmeasured` and the run fails. Each line says what Hone needs:
|
|
75
|
-
|
|
76
|
-
```text
|
|
77
|
-
forfeiture-unmeasured no-base-revision: no --base-revision was given, so file carve-outs cannot be checked for decay; pass --base-revision with the branch's base, such as origin/main, or leave decay to another run with "assessment": { "forfeiture": "elsewhere" } in disciplines.json or --forfeiture elsewhere
|
|
78
|
-
import-unmeasured no-base-revision: no --base-revision was given, so imported records cannot be checked against it; pass --base-revision with the branch's base, such as origin/main
|
|
79
|
-
legacy-chain-unmeasured no-base-revision: no --base-revision was given, so legacy-chain records cannot be checked against it; pass --base-revision with the branch's base, such as origin/main
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
A `--base-revision` that git cannot use gives the same kinds as `base-git-failed`, naming the revision in double quotes, escaped as in JSON, with git's own first line:
|
|
83
|
-
|
|
84
|
-
```text
|
|
85
|
-
forfeiture-unmeasured base-git-failed "origin/main": git could not list the files changed since that revision and said "<git's first line>"; Hone needs that revision and the history back to where this branch left it, or leave decay to another run with "assessment": { "forfeiture": "elsewhere" } in disciplines.json or --forfeiture elsewhere
|
|
86
|
-
import-unmeasured base-git-failed "origin/main": git could not read the exception records at that revision and said "<git's first line>"; Hone needs the exception records as they were at that revision
|
|
87
|
-
legacy-chain-unmeasured base-git-failed "origin/main": git could not read the exception records at that revision and said "<git's first line>"; Hone needs the exception records as they were at that revision
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
`--forfeiture elsewhere` makes a run leave carve-out decay to another run, such as a pre-push hook given a base revision, overriding `assessment.forfeiture` in `disciplines.json`; `--forfeiture this-run`, the default, assesses it in this run. A run with forfeiture elsewhere asks git for no change set, forfeits no file carve-out and never reports `forfeiture-unmeasured`, with or without `--base-revision`. It ends its report with an `assessment` section, printed whenever the run assesses less than the default, and marks its verdict line in every output:
|
|
91
|
-
|
|
92
|
-
```text
|
|
93
|
-
assessment (1)
|
|
94
|
-
forfeiture elsewhere: 37 file carve-outs not checked for decay in this run
|
|
95
|
-
verdict: pass (partial assessment)
|
|
96
|
-
```
|
|
34
|
+
Without `--base-revision`, Hone cannot tell which files were touched, so debt cannot be forfeited and records carried from version 1 cannot be compared with the base; the report says so and the run fails. `--forfeiture elsewhere`, or `"forfeiture": "elsewhere"` in `hone.config.json`, leaves debt forfeiture to another run, such as a pre-push hook given a base revision; that run's report says what it left, and its verdict is a partial assessment.
|
|
97
35
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
`hone project` writes the native configuration each embedded mechanism needs, and prints `<path> <effect>` per file: `written`, `unchanged`, `removed` for a package slice Hone wrote whose folder is no longer a config root, or `left-in-place` for such a file whose bytes are not what Hone would write there. The audit mechanism is standalone and writes nothing, so with only the walker selected the command prints nothing and exits `0`.
|
|
36
|
+
`hone project` writes the native configuration each engine that runs a listed check through one needs. The walker is standalone and needs none.
|
|
101
37
|
|
|
102
38
|
### Recording inherited debt
|
|
103
39
|
|
|
104
|
-
`hone record-debt` gives a repository that adopts Hone with existing code a
|
|
105
|
-
|
|
106
|
-
Give it the base that the run assessing decay is given, such as `origin/main` for a branch: a record for a file changed since that base is forfeited by that run, and a check against a later revision, such as `HEAD`, does not show it.
|
|
40
|
+
`hone record-debt` gives a repository that adopts Hone with existing code a debt record for each finding it cannot fix on day one. [ADOPTING.md](ADOPTING.md#7a-record-the-debt-you-inherit) step 7a is the procedure. The command runs the check with the `--base-revision` it is given, then writes one debt record under `hone-records/debt/<symptom>.json` for each symptom, check and file that has a finding, and for each inline disable or TypeScript directive under `unrecorded`, since debt on its check and file is what holds one. Each is the record a person would write, so nothing downstream treats it differently: it names only its symptom, or its symptom and check as `<symptom>#<check>`, and its file. Debt needs no why-chain and no case, so the command needs no setting in `hone.config.json` and never sets one. Add a `note` by hand afterwards if you want to leave a note for future developers on what the debt signals.
|
|
107
41
|
|
|
108
|
-
|
|
42
|
+
Give it the base that the run assessing forfeiture is given, such as `origin/main` for a branch: a record for a file changed since that base is forfeited by that run, so the command writes none for such a file and says so, and a check against a later revision, such as `HEAD`, would not show it.
|
|
109
43
|
|
|
110
|
-
It never writes anything
|
|
44
|
+
It never writes anything that needs an owner's reason: no authorised location, no boundary record, no deviation, no dependency record and no setting. It prints one line per finding and per native exception under `unrecorded`, and writes nothing for:
|
|
111
45
|
|
|
112
|
-
- a
|
|
113
|
-
- a file under a `--leave` path
|
|
114
|
-
- a file
|
|
115
|
-
- a
|
|
116
|
-
- a
|
|
46
|
+
- a symptom and file that already hold debt;
|
|
47
|
+
- a file under a `--leave` path. `--leave` takes an exact file or folder, as `exclude` does, and may be given once for each path. It names the deliberate, permanent exceptions, which a person records as an authorised location with its own reason;
|
|
48
|
+
- a file this change created or changed, when the run assesses forfeiture, since a finding there is the change's own breach: fix it there. With `forfeiture` set to `elsewhere` the check forfeits nothing, so the command writes debt on such a file like any other;
|
|
49
|
+
- a finding the catalogue gives no symptom or check to record against, such as one of a team rule set's clauses;
|
|
50
|
+
- a native exception no debt record can hold. A `config-override` is never recorded, since debt holds what is owed and an override on a clean file owes nothing: a file under it that breaks the check gets its debt from the finding, because Hone's own run does not read the override, so remove the override or narrow it. An `ignore` and a `suppression-entry` hide nothing from Hone's run, which has already recorded what it finds in the file, so remove them; a generated or vendored file under an `ignore` can instead be listed in `exclude`, which Hone's run then honours too, so no `ignore` line is printed for it. An inline rule configuration changes what the rule checks: remove the comment. A lint-script option gets the advice for why Hone could not judge it, the same as its `unrecorded` line.
|
|
117
51
|
|
|
118
|
-
|
|
52
|
+
Each line it prints says what to do next.
|
|
119
53
|
|
|
120
|
-
It adds
|
|
54
|
+
It adds each record to its symptom's file, writing the file when there is none yet, and leaves every record already there as written. It stages and commits nothing: the diff of `hone-records` is the review, and nothing takes effect until a person commits it. It never removes or rewrites a record, so running it again writes nothing the second time. A record whose debt is paid is removed by `hone prune-debt`, below. Run `hone project` after it when any listed check runs on `eslint`, so the projection carries the new records.
|
|
121
55
|
|
|
122
|
-
The command does not refuse to run again later, and has no flag for it. Forfeiture is what stops it turning new findings into
|
|
56
|
+
The command does not refuse to run again later, and has no flag for it. Forfeiture is what stops it turning new findings into debt: debt is forfeited once its file changes since `--base-revision`, so a record written for a file someone has just changed fails the next check that assesses forfeiture, and a file that is new or changed since the base gets no record at all. That holds only where forfeiture is assessed. In an arrangement that leaves it elsewhere, such as `"forfeiture": "elsewhere"` with the pre-push hook that assesses it bypassed, such a record is not caught until a run that does assess it.
|
|
123
57
|
|
|
124
58
|
### Pruning paid debt
|
|
125
59
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
Every other record stays for a person:
|
|
60
|
+
Debt is a record that a finding is owed, and once the debt is paid the record should go. `hone prune-debt` removes the debt a run lists under `paid`, `stale` or `forfeited`: debt that another record answers in place of, debt on a file that is gone, a file the settings exclude, or a file whose check its engine measured there with nothing found, and debt on a file this change touched, whether or not that file still breaks its check. The `stale` line and the `prune-debt` line say which of the three it was. Only the engine knows what it measured. A file it was handed and skipped, a file outside the checked set and an engine that did not run are not measured, so their debt is unjudged: it is not listed as stale and the command leaves it.
|
|
129
61
|
|
|
130
|
-
|
|
131
|
-
- **A `forfeited` record on a file that still breaks its clause:** fix the file, then run the command, which removes the record once its mechanism measures the clause there with nothing left. While the file still breaks its clause, the record keeps failing the run.
|
|
132
|
-
- **An `authorised-location` or `clause-wide-carve-out` under `stale`:** it carries a person's judgement, so delete it by hand.
|
|
133
|
-
|
|
134
|
-
The command runs the check with the `--base-revision` and `--forfeiture` it is given, so give it what the check was given. A check that finds a `file-carve-out` whose debt is paid names the command exactly in its last `readFirst` line, just above the verdict, with `hone project` after it when any of the records is for an `eslint` clause:
|
|
135
|
-
|
|
136
|
-
```text
|
|
137
|
-
prune-debt: 3 file carve-outs under stale or forfeited still record debt that is paid; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js prune-debt --repo /work/shop --base-revision origin/main to remove what is paid, then run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit the exception records with every disciplines.eslint.mjs it writes
|
|
138
|
-
```
|
|
62
|
+
Every other record stays for a person, such as a `stale` authorised location whose finding is gone: it carries a person's judgement, so delete it by hand.
|
|
139
63
|
|
|
140
|
-
|
|
64
|
+
The command runs the check with the `--base-revision` and `--forfeiture` it is given, so give it what the check was given; a check that finds paid debt names the exact command. Like `hone record-debt`, it writes `hone-records`, keeps every other record's text as written, stages and commits nothing, and does not write the projection: run `hone project` after it when any check runs on `eslint`. It has no dry run: the diff of `hone-records` is the review.
|
|
141
65
|
|
|
142
|
-
For an `eslint`
|
|
66
|
+
For an `eslint` check, the off-switch the projection writes for a record is Hone's own. The check does not list it as a `config-override`, so it never counts as a native exception the record holds. A `config-override` on a check and file no record holds is reported under `unrecorded`, and `hone record-debt` never records it: remove the override or narrow it. Once a record is removed, a team off-switch placed after the projection is listed under `unrecorded` as a `config-override`, and one placed before it never takes effect, since the projection turns the rule on after it, so ESLint and the check both flag the file. A team block placed after the projection that sets a recorded file's rule to `"warn"` or `"error"` leaves the projection out of effect, and the check says `not-included`.
|
|
143
67
|
|
|
144
68
|
## Adopting the ESLint mechanism
|
|
145
69
|
|
|
146
|
-
With any
|
|
70
|
+
With any check listed for `eslint`, run `hone project`. It writes `hone.eslint.mjs` at the repository root, which turns the listed checks' rules on and off where records answer them, and `hone.eslint.d.mts`, which types it. Commit both, and spread the default export of the projection last in the repository's flat config:
|
|
147
71
|
|
|
148
72
|
```js
|
|
149
|
-
import
|
|
73
|
+
import hone from "./hone.eslint.mjs";
|
|
150
74
|
|
|
151
75
|
export default [
|
|
152
76
|
// the team's own blocks
|
|
153
|
-
...
|
|
77
|
+
...hone,
|
|
154
78
|
];
|
|
155
79
|
```
|
|
156
80
|
|
|
157
|
-
This is the only supported way to adopt the
|
|
158
|
-
|
|
159
|
-
```text
|
|
160
|
-
mechanism-not-run eslint missing: disciplines.eslint.mjs is not written; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit every disciplines.eslint.mjs it writes
|
|
161
|
-
mechanism-not-run eslint not-included: the eslint configuration leaves the projection out of effect for a file under check; spread the default export of disciplines.eslint.mjs, or of a package's own disciplines.eslint.mjs in that package, last in the configuration that file loads, after every other block (an import placed last without the spread applies nothing), or, where a tool such as sku generates the configuration, last in the configuration the tool takes
|
|
162
|
-
eslint out-of-date: disciplines.eslint.mjs differs from what hone project writes now; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit every disciplines.eslint.mjs it writes
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
The command on these lines runs the entry file of the Hone that ran the check with `node`, with the repository the check measured, both as absolute paths with forward slashes, so it runs as printed from any directory; the lines above show an install at `/work/shop`. Re-run `hone project` after changing the selection or the exceptions.
|
|
81
|
+
This is the only supported way to adopt the checks. On every run, Hone reads the team's resolved configuration for each checked file and fails the run if the projection is missing, not in effect, or differs from what `hone project` would write now, with a line that says what to run. Re-run `hone project` after changing the checks or the records.
|
|
166
82
|
|
|
167
83
|
### Package slices
|
|
168
84
|
|
|
169
|
-
A package that runs ESLint from its own folder resolves the `files` of its config against that folder, so spreading the root projection there loses every
|
|
85
|
+
A package that runs ESLint from its own folder resolves the `files` of its config against that folder, so spreading the root projection there loses every record written with a root-relative path. `hone project` therefore writes one projection per config root, and beside each a `hone.eslint.d.mts` that types its default export as ESLint's `Linter.Config[]`, so a TypeScript config can import the projection and spread it. Commit both files in every folder. The repository root gets `hone.eslint.mjs` as above. Under the nearest-to-file lookup, each package folder with a tracked `eslint.config.*` is a config root; under the repository-root lookup a package's own config is never loaded, so it gets no slice. Each folder `hone.config.json` lists under `eslintConfigRoots` is a config root under either lookup. Each package config root gets its own `hone.eslint.mjs` beside it: the same checks, imported by a path relative to that folder, and only the records for files under it, with paths relative to it; every slice also carries the block that turns the listed checks' rules on. Each package config spreads its own slice:
|
|
170
86
|
|
|
171
87
|
```js
|
|
172
|
-
import
|
|
173
|
-
|
|
174
|
-
export default [{ files: ["**/*.{ts,tsx,mts,cts}"] }, ...disciplines];
|
|
175
|
-
```
|
|
88
|
+
import hone from "./hone.eslint.mjs";
|
|
176
89
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
```text
|
|
180
|
-
mechanism-not-run eslint not-included: the eslint configuration leaves the projection out of effect for a file under check; spread the default export of disciplines.eslint.mjs, or of a package's own disciplines.eslint.mjs in that package, last in the configuration that file loads, after every other block (an import placed last without the spread applies nothing), or, where a tool such as sku generates the configuration, last in the configuration the tool takes; the eslint lines under projectionProblems name the package slices involved; fixtures/a hold their own disciplines.json, and nested Hone configurations are not supported yet (https://github.com/HailsTails/hone/issues/72): to govern such a folder from this repository, remove its disciplines.json and keep its records here, then run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop, which writes its slice
|
|
90
|
+
export default [{ files: ["**/*.{ts,tsx,mts,cts}"] }, ...hone];
|
|
181
91
|
```
|
|
182
92
|
|
|
183
|
-
A config
|
|
184
|
-
|
|
185
|
-
The check reports each package slice under the mechanism, naming the slice: out of date, missing, or, when ESLint resolves each file from its nearest config and a package's carve-outs are not in effect, for example because its config spreads the root projection or nothing instead of its slice, not applied, beside `mechanism-not-run eslint not-included`. A folder listed under `eslintConfigRoots` with no `eslint.config.*` on disk is unconfigured: nothing there can load its slice, so Hone would otherwise say nothing about that package; generate its config before the check runs, as a tool such as sku does on any of its commands:
|
|
186
|
-
|
|
187
|
-
```text
|
|
188
|
-
eslint out-of-date packages/a/disciplines.eslint.mjs: that slice differs from what hone project writes now; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit every disciplines.eslint.mjs it writes
|
|
189
|
-
eslint missing packages/a/disciplines.eslint.mjs: that slice is not written; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit every disciplines.eslint.mjs it writes
|
|
190
|
-
eslint not-applied packages/a/disciplines.eslint.mjs: the eslint configuration for packages/a leaves records of that slice out of effect; spread the default export of packages/a/disciplines.eslint.mjs last in that package's configuration, in place of any other projection it spreads, or, where a tool such as sku generates the configuration, last in the configuration the tool takes
|
|
191
|
-
eslint unconfigured packages/a/disciplines.eslint.mjs: packages/a has no eslint configuration file on disk, so nothing loads that slice; run the tool that generates it (for sku, sku configure) before the check
|
|
192
|
-
```
|
|
93
|
+
A package with no `eslint.config.*` of its own is linted by the nearest config above it, so its records stay in that config's slice. A file is governed by the deepest config root that contains it. A folder holding its own `hone.config.json` is a nested Hone configuration, which is not supported yet ([#72](https://github.com/HailsTails/hone/issues/72)): when the ESLint engine would check a file under it, `check` and `project` stop before anything is checked or written, while a run that lists only walker checks does not stop. A folder holding one and no file the run would check gets no slice, and nor does anything under it. Either fix works today: run the folder on its own with `--repo`, as the line says, or govern it from this repository by removing its `hone.config.json` and keeping its records here, after which `hone project` writes its slice.
|
|
193
94
|
|
|
194
|
-
A
|
|
95
|
+
A config root keeps its slice even where a config above it ignores its folder: a lint run from that folder loads its own config and never reads the ignores above it, so `hone project` writes the same slices from the same inputs every time. A repository with only a root config gets exactly the projection it had before.
|
|
195
96
|
|
|
196
|
-
|
|
197
|
-
A file carve-out stays in the projection after it is forfeited, so the team's own ESLint run keeps ignoring that file; Hone's check is what fails it, as `forfeited`.
|
|
97
|
+
The check reports each package slice that is missing, out of date or not in effect. A package that spreads the root projection is reported only once a record answers a file in it, since until then both projections give that package the same rules; one that spreads nothing is reported at once. A folder listed under `eslintConfigRoots` with no `eslint.config.*` on disk is reported too: generate its config before the check runs, as a tool such as sku does on any of its commands.
|
|
198
98
|
|
|
199
|
-
|
|
99
|
+
A debt record stays in the projection after it is forfeited, so the team's own ESLint run keeps ignoring that file; Hone's check is what fails it, as `forfeited`.
|
|
200
100
|
|
|
201
|
-
|
|
101
|
+
Hone's own ESLint run uses only the runner's configuration, with ignores, suppressions and inline configuration off, so nothing in the team's setup can change a finding. Every way the team's setup can weaken a selected rule (a native channel) is reported instead, and only an override that matches a record is accepted.
|
|
102
|
+
## hone.config.json
|
|
202
103
|
|
|
203
|
-
At the repository root. It
|
|
104
|
+
At the repository root. It lists the checks the repository runs and the engine that runs each one. The example lists the checks `authored-class-or-this#class-keyword` and `authored-class-or-this#static-members-only` on ESLint and a team's check on the walker.
|
|
204
105
|
|
|
205
106
|
```json
|
|
206
107
|
{
|
|
207
|
-
"version":
|
|
108
|
+
"version": 2,
|
|
208
109
|
"ruleSets": { "team": "tools/disciplines" },
|
|
209
|
-
"
|
|
210
|
-
"
|
|
211
|
-
"
|
|
212
|
-
"team/
|
|
110
|
+
"checks": {
|
|
111
|
+
"authored-class-or-this#class-keyword": "eslint",
|
|
112
|
+
"authored-class-or-this#static-members-only": "eslint",
|
|
113
|
+
"team/some-symptom#some-check": "walker"
|
|
213
114
|
},
|
|
214
115
|
"exclude": ["vendor", "generated"]
|
|
215
116
|
}
|
|
216
117
|
```
|
|
217
118
|
|
|
218
|
-
- `ruleSets` names the repository's own rule sets, each a
|
|
219
|
-
- `
|
|
220
|
-
- Listing a
|
|
221
|
-
- `"not-run"` states that the
|
|
222
|
-
- A judgement clause cannot be selected; it is enforced by review.
|
|
119
|
+
- `ruleSets` names the repository's own rule sets, each a folder relative to the repository root, or `"."` for the root. The name `hone` is reserved for the rule set shipped with the tool; `hone/authored-class-or-this#class-keyword` and `authored-class-or-this#class-keyword` are the same address. A rule-set name may not start with `hone-`, and no declared name may be another declared name plus `-<suffix>`.
|
|
120
|
+
- `checks` maps a check address to an engine id, to `"not-run"` or to `"not-adopted"`. An address is `[<ruleSet>/]<symptom>#<check>`; no prefix means the `hone` rule set. The engine must be one the check lists.
|
|
121
|
+
- Listing a check adopts it, and only a listed check runs. A check of a symptom that a listed check sees, listed nowhere, is offered under `available`; it never fails the run, so a new check in a later Hone never turns a run red by itself.
|
|
122
|
+
- `"not-run"` states that the check is adopted and binds the repository, but its engine is not run: the check is not a true measure of the rule's intent here, or cannot work here. The rule is enforced by review. `"not-adopted"` states that the check does not apply to the repository. Either way the check is never run and never projected, and its engine is not loaded unless another check uses it. The report lists it under `not-run` or `not-adopted`; both are informational, and the run is still a whole assessment. No engine may be named `not-run` or `not-adopted`.
|
|
223
123
|
- `eslintConfigLookup`, optional, is `"nearest-to-file"` or `"repository-root"` and says which `eslint.config.*` the team's own ESLint run applies to a file; see [Runtime](#runtime). Leave it out to let Hone detect it.
|
|
224
|
-
- `eslintConfigRoots`, optional, lists repository folders that get their own projection slice under either lookup although they track no `eslint.config.*`, such as a package whose config a tool generates and ignores; see [Package slices](#package-slices). Globs are refused. Each entry must be a folder git tracks files under outside every `exclude` path, spelled exactly as git spells it; any other entry stops the run before anything is checked or written
|
|
225
|
-
- `
|
|
226
|
-
- `reportOutput`, optional, is `"full"` (the default), `"
|
|
227
|
-
- `checkEditions`, optional, is `"pinned"` (the default) or `"latest"`. A
|
|
228
|
-
- `
|
|
229
|
-
- `
|
|
230
|
-
- `
|
|
124
|
+
- `eslintConfigRoots`, optional, lists repository folders that get their own projection slice under either lookup although they track no `eslint.config.*`, such as a package whose config a tool generates and ignores; see [Package slices](#package-slices). Globs are refused. Each entry must be a folder git tracks files under outside every `exclude` path, spelled exactly as git spells it; any other entry stops the run before anything is checked or written.
|
|
125
|
+
- `forfeiture`, optional, is `"this-run"` (the default) or `"elsewhere"`, and says which run assesses whether debt is forfeited; `--forfeiture` overrides it for one run; see [Commands](#commands).
|
|
126
|
+
- `reportOutput`, optional, is `"full"` (the default), `"actionable"`, `"counts"` or `"verdict-only"`: the repository's default for how much of the report the check prints. `--report-output` overrides it for one run; see [Commands](#commands).
|
|
127
|
+
- `checkEditions`, optional, is `"pinned"` (the default) or `"latest"`. A check that has been tightened has more than one edition, listed on its check page. `"pinned"` runs each check's default edition, which changes only in a major release; `"latest"` runs the newest edition the installed Hone has for every listed check, so a minor release can add findings. `"edition"` in a check's `checkSettings` holds that one check to the edition it names over either. The report lists the edition each such check ran under `editions`.
|
|
128
|
+
- `checkSettings`, optional, maps a listed check address to an object of that check's settings, for a check whose page lists settings. Each key must be one the check's piece declares, and its value must be the same JSON kind as the declared default and, where the piece lists choices, one of them; the value replaces the default. Anything else makes `hone.config.json` malformed, naming the check, the key and what is accepted.
|
|
129
|
+
- `exclude`, optional, lists repository folders or exact files that no engine checks. A folder entry covers everything under it. Globs are refused: an entry containing `*` makes `hone.config.json` malformed. The report lists the active entries under `excluded`. Exclude Hone's own install when it is vendored inside the repository.
|
|
130
|
+
- `generated` and `layers`, optional, are declared for checks that will read them; no check reads either yet, and the report says so under `settings-notes`.
|
|
231
131
|
|
|
232
|
-
|
|
132
|
+
The keys version 1's `disciplines.json` used under other names are refused, each naming what replaces it: `clauses` is `checks`, `clauseSettings` is `checkSettings`, `assessment` is `forfeiture`, and `fileExceptionWhyChains` is gone, since every record shows its why-chain. [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) section 20 lists what moved.
|
|
233
133
|
|
|
234
|
-
|
|
134
|
+
## hone-records
|
|
235
135
|
|
|
236
|
-
|
|
237
|
-
{
|
|
238
|
-
"version": 1,
|
|
239
|
-
"exceptions": [
|
|
240
|
-
{ "kind": "authorised-location", "clause": "CD-14#class-syntax", "file": "src/adapter.ts", "reason": "..." },
|
|
241
|
-
{ "kind": "file-carve-out", "clause": "CD-14#class-syntax", "file": "src/legacy.ts", "reason": "..." },
|
|
242
|
-
{ "kind": "clause-wide-carve-out", "clause": "CD-14#class-syntax", "reason": "...", "whyChain": { } }
|
|
243
|
-
]
|
|
244
|
-
}
|
|
245
|
-
```
|
|
136
|
+
A folder at the repository root; without it, no record answers any finding. It holds the records that answer findings, one file for each kind and symptom or recipe, each a document `{ "version": 2, "records": [...] }`. A file in the wrong folder or under a name that is not a catalogue name is refused, naming where each record belongs. Each record names what it reaches by the symptom's name, or by `<symptom>#<check>` to reach one check of it. [rules/records.md](rules/records.md) says what each kind is for.
|
|
246
137
|
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
- A `
|
|
250
|
-
-
|
|
251
|
-
- A
|
|
252
|
-
|
|
253
|
-
```json
|
|
254
|
-
"whyChain": {
|
|
255
|
-
"whys": [
|
|
256
|
-
{ "why": "...", "because": "...", "evidence": "..." },
|
|
257
|
-
{ "why": "...", "because": "...", "evidence": "..." },
|
|
258
|
-
{ "why": "...", "because": "...", "evidence": "..." },
|
|
259
|
-
{ "why": "...", "because": "...", "evidence": "..." },
|
|
260
|
-
{ "why": "...", "because": "...", "evidence": "..." }
|
|
261
|
-
],
|
|
262
|
-
"rootCause": "...",
|
|
263
|
-
"rootCheck": "...",
|
|
264
|
-
"readback": "...",
|
|
265
|
-
"owner": "..."
|
|
266
|
-
}
|
|
267
|
-
```
|
|
268
|
-
- A chain with neither `rootCheck` nor `readback` was written to the earlier contract. It is accepted only while the `--base-revision` holds its entry unchanged; a new or edited one is refused as `why-chain-refused`, and a run with such a chain and no `--base-revision` is `legacy-chain-unmeasured`.
|
|
269
|
-
- An entry carried over from an earlier system may give `provenance` instead of a `whyChain`: `{ "kind": "inherited-debt", "source", "decision" }` on a file carve-out, `{ "kind": "existing-authorisation", "source" }` on an authorised location, where `decision` is optional. `source` names the old record entry as `<directory>/cd-<id>.json#<index>`: `.constitution-carve-outs` for inherited debt, `.constitution-authorised-locations` for an existing authorisation, the old file for the record's discipline, and the entry's position in its array. Such an entry is imported, and is accepted only while the `--base-revision` already holds it unchanged, or, when the base holds no record for that kind, clause and file, while the `source` entry at that revision lists the file in its `files`. A new or edited entry without a `whyChain` is refused as `import-unverified`, and a run with imported entries and no `--base-revision` is `import-unmeasured`. The report names each imported entry it exempts by.
|
|
270
|
-
- A `file-carve-out` without a `whyChain` or `provenance` is not checked against `--base-revision`, but a run with any file carve-out still needs `--base-revision`: without it the report lists `forfeiture-unmeasured` and the run fails, and with it a file carve-out is forfeited once its file is touched. A `whyChain` or `provenance` a file carve-out gives anyway is still judged as above.
|
|
271
|
-
- With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` entry may give only its `reason`, which then carries why the exception exists and must not be blank. This is deprecated: a reason-only `authorised-location` will be refused in the next major release, so give it a `whyChain`. A `whyChain` or `provenance` the entry gives anyway is still judged as above. A `clause-wide-carve-out` still needs its `whyChain`.
|
|
272
|
-
- A clause whose `discipline.json` declares `"exceptions": "refused"` cannot be exempted. No shipped discipline declares it, so every shipped clause can be.
|
|
273
|
-
- Files are exact repository paths, never globs.
|
|
274
|
-
- An entry that exempts nothing is stale, a file both authorised and carved for one clause is doubly held, and an entry that cannot be parsed is invalid. Each fails the run.
|
|
275
|
-
|
|
276
|
-
### The split layout
|
|
277
|
-
|
|
278
|
-
A repository can keep the same records in a `discipline-exceptions` folder instead of `discipline-exceptions.json`: a folder for each record kind, and in it one file for each discipline. The name of a changed file then says which rule and which kind a change touches, and a code owner can own one rule's exceptions.
|
|
279
|
-
|
|
280
|
-
```text
|
|
281
|
-
discipline-exceptions/
|
|
282
|
-
authorised-locations/
|
|
283
|
-
cd-19.json
|
|
284
|
-
file-carve-outs/
|
|
285
|
-
cd-19.json
|
|
286
|
-
cd-27.json
|
|
287
|
-
clause-wide-carve-outs/
|
|
288
|
-
team/
|
|
289
|
-
tm-1.json
|
|
290
|
-
```
|
|
138
|
+
- **Debt** is in `hone-records/debt/<symptom>.json`: `answers`, `file` and an optional `note`, a note to future developers on what the debt signals, which nothing reads. It says a finding in one file is owed. It needs no case and no why-chain; forfeiture is what holds it: it is forfeited once its file is touched.
|
|
139
|
+
- **An authorised location** is in `hone-records/authorised-locations/<symptom>.json`: `answers`, `file`, `case` and `owes`, naming the case the file is and the principle it owes, and a `whyChain`. It says the symptom is correct in that file. [`hone authorise`](#commands) writes one from the arguments it is given.
|
|
140
|
+
- **A deviation** is in `hone-records/deviations/<recipe>.json`: `recipe`, `file`, `recipeReason`, `reasonFails`, `evidence` and `ruleHolds`. It says why a file does not follow a recipe the catalogue gives.
|
|
141
|
+
- **A boundary record** is in `hone-records/boundary-records.json`: `module`, `outsideParty` (a runtime facility such as `runtime:clock`, or an outside module's specifier), the `ports` the module declares and an optional `conformist`. It says the module is where an outside party is met.
|
|
142
|
+
- **A dependency record** is in `hone-records/dependency-records.json`: `dependency`, `nativeWay`, `whyNotEnough` and an optional `peerRisk`. It says why a package is used where the platform's own way exists.
|
|
291
143
|
|
|
292
|
-
|
|
293
|
-
- A record in another discipline's or kind's file, or any other file or folder under `discipline-exceptions`, makes the load fail as `file-malformed`, naming the file; for a misplaced record it names the file it belongs in.
|
|
294
|
-
- Hone reads whichever layout is present. `discipline-exceptions.json` stays the default, and nothing changes for a repository that keeps it. A repository holding both is refused with `records-in-both-layouts` rather than merged.
|
|
295
|
-
- An `invalidRecords` line names the file that holds the record and its index there. `hone record-debt` adds each record to its discipline's `file-carve-outs` file, writing the file when there is none yet.
|
|
296
|
-
- The `--base-revision` may hold either layout, so the change that moves a repository to the split layout is checked against `discipline-exceptions.json` at its base: imported and legacy-chain records are still verified.
|
|
297
|
-
- Records are read in path order: the kind folders in the order of their names, then the files in the order of their paths. A section that lists records, such as `stale`, lists them in that order, not in the order `discipline-exceptions.json` had.
|
|
144
|
+
An authorised location's `whyChain` follows the [why-chain contract](docs/why-chain-contract.md), which gives its shape, what Hone refuses and what review still judges.
|
|
298
145
|
|
|
299
|
-
|
|
146
|
+
- A record that `hone upgrade` moved from version 1 keeps its old entry word for word under a `carried` key, in place of the keys version 1 did not hold. The check lists it under `carried`, with what it lacks, and judges it against `--base-revision`: it is `established` when the base held it unchanged and `unjudged` when the run could not compare it; a carried record changed since the base is refused as `carried-changed-since-base`. [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) section 20 describes them.
|
|
147
|
+
- A record the catalogue does not recognise, or whose form is wrong, is refused with its records file and index, and the run fails. A record that names a case or an `owes` the catalogue does not list is kept, with a note under `record-notes`.
|
|
148
|
+
- A record that answers no finding and holds no native exception is stale where the checks it reaches were measured at its place, or its place is gone or excluded; a record whose checks were not measured there is unjudged, not stale, and a dependency record, which no check reads yet, is never stale. Debt on a file this change touched is forfeited, and a record that duplicates another is refused. Each fails the run. Debt that another record answers in place of is paid, which does not.
|
|
149
|
+
- An inline exception, an `eslint-disable` comment naming a selected rule or no rule, or a `@ts-expect-error`, `@ts-ignore` or `@ts-nocheck` directive under `claimed-type#unlisted-cast-site`, is held only by a record on its check and file. A comment naming no rule escapes every selected ESLint check and needs one per check. Without a record it is listed under `unrecorded` and fails the run. A lint-script option that weakens the whole run, such as `--rule`, `--suppress-all` or `-c` naming another config, cannot be recorded.
|
|
150
|
+
- Files are exact repository paths, never globs.
|
|
300
151
|
|
|
301
152
|
## Installing
|
|
302
153
|
|
|
303
|
-
Hone installs as one npm package, `@hailstails/hone`, installed from npm at an exact version, `@hailstails/hone@<version>` with `--save-exact`, downloaded as the tarball `hailstails-hone-<version>.tgz` attached to a GitHub release, or built by `pnpm run pack-package` into `artefacts/hailstails-hone-<version>.tgz`, the file name `npm pack` gives the scoped package, and added to the repository root as a development dependency; [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 has the steps. The package is plain JavaScript holding only Hone's own code. It declares
|
|
154
|
+
Hone installs as one npm package, `@hailstails/hone`, installed from npm at an exact version, `@hailstails/hone@<version>` with `--save-exact`, downloaded as the tarball `hailstails-hone-<version>.tgz` attached to a GitHub release, or built by `pnpm run pack-package` into `artefacts/hailstails-hone-<version>.tgz`, the file name `npm pack` gives the scoped package, and added to the repository root as a development dependency; [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 has the steps. The package is plain JavaScript holding only Hone's own code. It declares its own `dependencies` as caret ranges starting at the version `pnpm-lock.yaml` locks, so the package manager installs them from the registry, and the repository's own audit tools see them as it does any other dependency. Which release inside each range is installed is decided by the repository's own lockfile and overrides, so a patched release can be taken without waiting for a new Hone. It declares the toolchain as `peerDependencies`, `typescript` required and the ESLint packages optional, and exposes one command, `hone`, described under [Commands](#commands). It ships the rule data and pages, both mechanisms, the review methods and the why-chain contract, and no TypeScript source, only the declaration files of the public type entries below.
|
|
304
155
|
|
|
305
|
-
With the ESLint mechanism selected, a packaged install's projection imports
|
|
156
|
+
With the ESLint mechanism selected, a packaged install's projection imports one plugin, `@hailstails/hone/eslint-plugin`, registered under the namespace `hone`, so the repository's ESLint must resolve the package from the repository root. Hone compares the committed projection `hone.eslint.mjs` and its declaration `hone.eslint.d.mts` byte for byte with what `hone project` would write now.
|
|
306
157
|
|
|
307
158
|
## Public type entries
|
|
308
159
|
|
|
@@ -319,39 +170,39 @@ Each resolves with `moduleResolution` `"nodenext"` or `"bundler"`. `install-proo
|
|
|
319
170
|
## Runtime
|
|
320
171
|
|
|
321
172
|
- Windows, Linux, macOS or WSL. Hone keeps absolute paths in the platform's own form and repository paths in POSIX form, as git reports them. CI proves Windows and Linux; macOS is not proven in CI.
|
|
322
|
-
- The package: Node
|
|
173
|
+
- The package: the Node versions its `engines.node` declares. It is plain JavaScript, so Node never strips types from it, and Node strips types from a rule set's `.ts` piece modules, within the limits [ADOPTING.md](ADOPTING.md#1-check-the-prerequisites) lists.
|
|
323
174
|
- git 2.24 or later. Older git rejects `--end-of-options`, so the changed-file query fails and forfeiture is reported unmeasured.
|
|
324
|
-
- Hone's own packages,
|
|
325
|
-
- The repository's own toolchain, declared as `peerDependencies`: `typescript`
|
|
175
|
+
- Hone's own packages, declared in `dependencies` as caret ranges whose floor is the version `pnpm-lock.yaml` locks, which is the version Hone is tested on. The repository's lockfile, and any override it sets, decides which release inside each range is installed. They are implementation details: nothing of theirs crosses into the repository's code or configuration.
|
|
176
|
+
- The repository's own toolchain, declared as `peerDependencies`: `typescript` required, because every walker check needs it, and the ESLint packages optional, for the ESLint mechanism. Declare `typescript` at the root at the version the repository uses. TypeScript stops below 7 because TypeScript 7's compiler API is a different one. Yarn Plug'n'Play is not supported.
|
|
326
177
|
|
|
327
|
-
Hone loads the toolchain by Node's own resolution, upward from the install directory, which is the same resolution the pieces' plugin modules get when the team's ESLint loads the projection. Hone's query of the team's configuration, its governance run and the pieces therefore all use one copy, the repository's. Keep the toolchain resolvable from the repository root: declare it in the root `package.json` (in a pnpm workspace, `pnpm add -Dw`). A package may install a different ESLint for its own lint script; Hone's verdict still comes from the root's, its governance behaviour is the same on either supported line, and the pieces that wrap native rules wrap the root's copies there too.
|
|
178
|
+
Hone loads the toolchain by Node's own resolution, upward from the install directory, which is the same resolution the pieces' plugin modules get when the team's ESLint loads the projection. Hone's query of the team's configuration, its governance run and the pieces therefore all use one copy, the repository's. Keep the toolchain resolvable from the repository root: declare it in the root `package.json` (in a pnpm workspace, `pnpm add -Dw`). A package may install a different ESLint for its own lint script; Hone's verdict still comes from the root's, its governance behaviour is the same on either supported line, and the pieces that wrap native rules wrap the root's copies there too.
|
|
328
179
|
|
|
329
|
-
A peer that is missing, cannot load, or is outside its range stops the
|
|
180
|
+
A peer that is missing, cannot load, or is outside its range stops the engine before any piece loads, with one line naming every such peer and what to install. A peer that resolves from inside the installed package stops it too, naming the folder to delete before reinstalling.
|
|
330
181
|
|
|
331
|
-
A repository can hold one `eslint.config.*` at its root or one per package. Hone resolves the team's configuration the way the team's own ESLint run does. ESLint 10, and ESLint 9 started with `--flag v10_config_lookup_from_file` (or `unstable_config_lookup_from_file`), use the `eslint.config.*` nearest each checked file. Plain ESLint 9 uses only the one in the directory it runs from, so for a repository whose `eslint` resolves to 9.x at `node_modules/eslint` and whose lint scripts carry no such flag, Hone reads the root `eslint.config.*` for every file, and fails the run
|
|
182
|
+
A repository can hold one `eslint.config.*` at its root or one per package. Hone resolves the team's configuration the way the team's own ESLint run does. ESLint 10, and ESLint 9 started with `--flag v10_config_lookup_from_file` (or `unstable_config_lookup_from_file`), use the `eslint.config.*` nearest each checked file. Plain ESLint 9 uses only the one in the directory it runs from, so for a repository whose `eslint` resolves to 9.x at `node_modules/eslint` and whose lint scripts carry no such flag, Hone reads the root `eslint.config.*` for every file, and fails the run if there is none. When Hone cannot read an installed `eslint` at the repository root it assumes the nearest-to-file lookup. Each config that applies to a file must spread its projection: the root config the root projection, each package config its own slice; see [Package slices](#package-slices). A config that fails to load stops the run, naming the config, the checked file it applies to and ESLint's message: fix that config. Only if its folder holds nothing Hone should check, add it to `exclude` in `hone.config.json` instead. A broken config in a folder that the repository's own ESLint never enters does not stop the run. Before failing, Hone asks the config that governs that folder, and each config above it up to the root, whether it really ignores both that folder and the file; a file that no `files` block matches is not taken for an ignored one. If one does, the file is treated like any other file the team's ESLint ignores and reported as an `ignore` native exception. Hone asks about a folder through a file inside it, so one gap remains: an ignore that matches every entry directly inside the folder but not the folder itself, such as `gen/*`, counts as ignoring `gen`, and Hone reports its files as ignored where the team's `eslint .` still loads the broken `gen/eslint.config.*` and fails. A file that no `eslint.config.*` applies to stops the run the same way, and the next step is to create one at the repository root that spreads the projection, as [ADOPTING.md](ADOPTING.md) step 4a shows. Detection cannot see how a task runner starts ESLint, so `hone.config.json` can state the lookup: `"eslintConfigLookup": "nearest-to-file"` or `"repository-root"`, which overrides detection. Both lookups are tested against monorepo fixtures with a config per package.
|
|
332
183
|
|
|
333
184
|
## Compatibility
|
|
334
185
|
|
|
335
186
|
Hone's version numbers follow semantic versioning under these rules:
|
|
336
187
|
|
|
337
|
-
- A new or tightened check ships off by default in a minor release and becomes a default only in a major release. A new check arrives as a new
|
|
188
|
+
- A new or tightened check ships off by default in a minor release and becomes a default only in a major release. A new check arrives as a new check of a symptom, which a repository adopts by listing it. A tightened check arrives as a new edition of the check, which runs only for a repository that sets `checkEditions` to `"latest"` or names the edition in the check's `checkSettings`; a major release makes it the default edition and may retire older ones.
|
|
338
189
|
- A change to the ESLint config that `hone project` generates, which an adopter must regenerate, is a minor release, with a clear message telling the adopter to regenerate: its changelog entry says to run `hone project` and commit the result, and until then the check reports the projection `out-of-date`.
|
|
339
|
-
- Renaming or removing a
|
|
190
|
+
- Renaming or removing a check address, a config key in `hone.config.json`, a records file or a key of a record, or a CLI flag, or changing what one means, is a major release. Adding one with a safe default is not.
|
|
340
191
|
- A change to what [the output contract](docs/output-contract.md) says a tool can parse is a major release: the command and option names, the exit codes and streams, the report's sections, outputs and verdict lines, the load failure kinds, and each line's leading fields up to its first value that may hold a space. What it marks not stable, such as the help text, the wording of `arguments-invalid` and `readFirst` lines and the repair text after a load failure's values, may change in a minor release, and a minor release may add a section, a kind of line or an option.
|
|
341
192
|
- A breaking change to a type in `@hailstails/hone/rule-set` is a major release. `@hailstails/hone/audit` is experimental: its types may change in a minor release until it is marked stable.
|
|
342
193
|
- A pre-release previews the release it is numbered towards and is published under the `next` dist-tag. A change no larger than the one a pre-release is numbered towards lands in that release's next pre-release; a larger one starts the line of the larger version it calls for. The changelog lists each change either way.
|
|
343
194
|
|
|
344
|
-
`
|
|
195
|
+
`hone.config.json` and the records in `hone-records` follow the same rules. A new key with a safe default, where nothing changes for an adopter who does not set it, is not breaking and can arrive in a minor release. A new required key with no safe default is breaking, and so is a change that makes a file that loads today stop loading or mean something else; both wait for a major release.
|
|
345
196
|
|
|
346
|
-
A
|
|
197
|
+
A check that accepts an engine keeps accepting it: an engine is never removed from the engines a check lists, so a `hone.config.json` that names it for the check keeps loading. A check can only gain engines. The standalone engine's id is `walker`; `audit` was version 1's name for it, and `hone.config.json` naming it is refused as `engine-not-allowed`.
|
|
347
198
|
|
|
348
199
|
Each release's changes are listed in [CHANGELOG.md](CHANGELOG.md), which the package ships: after an upgrade, read `node_modules/@hailstails/hone/CHANGELOG.md` for what changed between the version you had and the one you have now.
|
|
349
200
|
|
|
350
201
|
## Known limits
|
|
351
202
|
|
|
352
|
-
The ESLint
|
|
203
|
+
The ESLint engine registers one plugin under the namespace `hone`, so a check's rule id is `hone/` followed by the check's address, `hone/<symptom>#<check>`, such as `hone/authored-class-or-this#class-keyword`: the address `hone.config.json` and the records write, character for character. A rule id that splits the address with a slash names no check, and an inline disable that writes one is listed under `misnamed`. The namespace `hone-core` is reserved for Hone's own machinery, never a check's rule: it names the governance rule `hone-core/inline-config`, which reports inline configuration comments. The projection's own blocks are named `hone/checks` and `hone/answered/<reaches>`. No piece may use it.
|
|
353
204
|
|
|
354
|
-
|
|
205
|
+
Hone's tests cover each supported platform's ordinary paths and drives, and a committed ESLint projection checked out with either LF or CRLF line endings. The cases below are not covered by tests. Some may already work, but none is supported until a consumer needs it and a test is added:
|
|
355
206
|
|
|
356
207
|
- File and folder names outside ASCII.
|
|
357
208
|
- Windows device paths (`\\?\C:\...`).
|
|
@@ -365,35 +216,35 @@ This is the first release. Its tests cover each supported platform's ordinary pa
|
|
|
365
216
|
- Columns reported on lines holding non-ASCII text.
|
|
366
217
|
- Lint scripts are read with a simple shell tokenizer, so unusual quoting or a `cd` before `eslint` is not interpreted.
|
|
367
218
|
- A script whose quotes do not pair as `sh` reads them, such as `echo don't stop`, is passed over when nothing in it names `eslint`. One that names `eslint` is listed as an unreadable `command-line-option` on every selected ESLint clause, since Hone cannot tell what it passes to ESLint.
|
|
368
|
-
- Detection reads an ESLint 9 run started from inside a package, or given the lookup flag through the environment or a task runner, as a root-only run; set `eslintConfigLookup` in `
|
|
219
|
+
- Detection reads an ESLint 9 run started from inside a package, or given the lookup flag through the environment or a task runner, as a root-only run; set `eslintConfigLookup` in `hone.config.json` for those repositories.
|
|
369
220
|
- Team ESLint configs that imitate projection block names, register a second copy of the plugin, or use processors are not exercised.
|
|
370
|
-
- A byte-order mark at the start of `
|
|
221
|
+
- A byte-order mark at the start of `hone.config.json` or a file under `hone-records`; save them without one.
|
|
371
222
|
|
|
372
223
|
## Developing Hone
|
|
373
224
|
|
|
374
|
-
This repository is self-contained: it holds its own configuration and its own lock. `package.json` declares the packages the code imports and the development tools, `pnpm-lock.yaml` locks both, `tsconfig.json` typechecks the code under `strict`,
|
|
225
|
+
This repository is self-contained: it holds its own configuration and its own lock. `package.json` declares the packages the code imports and the development tools, `pnpm-lock.yaml` locks both, `tsconfig.json` typechecks the code under `strict`, `.oxfmtrc.json` configures the formatter, and `vitest.config.ts` runs its tests. `package.json` pins the pnpm version that locks and installs them, `pnpm-workspace.yaml` holds its settings, and pnpm resolves a dependency only to a release that is at least three days old when a dependency is added or updated; installing from the lock does not re-check it. Run `corepack enable` once so that Node provides that pnpm, install with `pnpm install --frozen-lockfile` in this directory, then run a script from it with `pnpm run <script>`:
|
|
375
226
|
|
|
376
227
|
| Script | Runs |
|
|
377
228
|
| --- | --- |
|
|
378
229
|
| `typecheck` | `tsc` with `tsconfig.json` |
|
|
379
|
-
| `
|
|
230
|
+
| `format` | oxfmt with `.oxfmtrc.json`, writing the formatted files |
|
|
380
231
|
| `test` | Vitest with `vitest.config.ts` |
|
|
381
|
-
| `check` |
|
|
382
|
-
| `build-package` |
|
|
383
|
-
| `pack-package` |
|
|
384
|
-
| `package-determinism` |
|
|
385
|
-
| `self-check` |
|
|
386
|
-
| `install-proof` |
|
|
387
|
-
| `pull-request-title` |
|
|
388
|
-
| `release-pull-request` |
|
|
232
|
+
| `check` | typecheck, the oxfmt check and the tests in that order |
|
|
233
|
+
| `build-package` | Builds the published package into `dist/`, and fails on anything the package must not ship, such as an undeclared import, a bundled dependency or a page linking to a file the package does not ship |
|
|
234
|
+
| `pack-package` | Builds `dist/` and packs it with `npm pack` into `artefacts/hailstails-hone-<version>.tgz`, named by the `version` in `package.json` |
|
|
235
|
+
| `package-determinism` | Builds and packs twice into separate temporary roots and fails naming any file that differs, or when the two packed tarballs differ |
|
|
236
|
+
| `self-check` | Runs Hone's own check on this repository; pass `--base-revision <rev>` after the script name. See [Hone's check on itself](#hones-check-on-itself) |
|
|
237
|
+
| `install-proof` | Packs the package, or takes `--tarball <path>`, and installs it into the consumers under `delivery/install-proof/consumer-proof/` in a temporary directory, each proving one thing only an installed package shows |
|
|
238
|
+
| `pull-request-title` | Passes a title shaped as a Conventional Commits subject, `type(scope)!: description`, and fails any other with the expected form. See [Versions and releases](#versions-and-releases) |
|
|
239
|
+
| `release-pull-request` | Writes the next release's section into `CHANGELOG.md` and its version into `package.json`, in the working tree only. See [Versions and releases](#versions-and-releases) |
|
|
389
240
|
|
|
390
241
|
### Hone's check on itself
|
|
391
242
|
|
|
392
|
-
|
|
243
|
+
Hone checks itself with its own `hone.config.json` and the records in `hone-records/`. The consumer folders `install-proof` copies out are excluded, since they are other repositories checked by their own Hone run.
|
|
393
244
|
|
|
394
|
-
`self-check` prints Hone's full report on itself, then one `self-check:` line. It fails when the
|
|
245
|
+
`self-check` prints Hone's full report on itself, then one `self-check:` line. It fails when the selection, the records or the projection are not sound, and not on findings, which it prints and counts. CI runs it on every change with the pull request's base, or the previous `main`, as the base revision.
|
|
395
246
|
|
|
396
|
-
Continuous integration runs on every pull request, drafts included, and on every push to `main`, from `pnpm-lock.yaml` alone, in two jobs,
|
|
247
|
+
Continuous integration runs on every pull request, drafts included, and on every push to `main`, from `pnpm-lock.yaml` alone, in two jobs, both required checks. They run side by side on the oldest claimed Node. Linux runs `check`, `self-check` and `package-determinism`, packs as the release does, and proves the tarball installs on a newer Node. Windows packs and proves its own tarball. A third job fails when the two tarballs differ. macOS is not proven in CI. A separate workflow, `pull-request-title.yml`, runs `pull-request-title` on each pull request's title whenever the pull request is opened, edited, reopened, marked ready or pushed to.
|
|
397
248
|
|
|
398
249
|
### Versions and releases
|
|
399
250
|
|