@shivaedev/quality 0.76.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/README.md +65 -59
- package/dist/adapters/biome/pluginContract.d.ts +1 -1
- package/dist/adapters/biome/pluginContract.d.ts.map +1 -1
- package/dist/adapters/biome/pluginContract.js +2 -5
- package/dist/adapters/biome/pluginContract.js.map +1 -1
- package/dist/adapters/biome/run.d.ts.map +1 -1
- package/dist/adapters/biome/run.js +2 -0
- package/dist/adapters/biome/run.js.map +1 -1
- package/dist/adapters/biome/withExceptionConfig.d.ts.map +1 -1
- package/dist/adapters/biome/withExceptionConfig.js +21 -4
- package/dist/adapters/biome/withExceptionConfig.js.map +1 -1
- package/dist/adapters/changeKeyCheck.d.ts +10 -0
- package/dist/adapters/changeKeyCheck.d.ts.map +1 -0
- package/dist/adapters/{changeKeyFindings.js → changeKeyCheck.js} +8 -22
- package/dist/adapters/changeKeyCheck.js.map +1 -0
- package/dist/adapters/commandLine.d.ts +2 -0
- package/dist/adapters/commandLine.d.ts.map +1 -1
- package/dist/adapters/contextCaptureCheck.d.ts +9 -0
- package/dist/adapters/contextCaptureCheck.d.ts.map +1 -0
- package/dist/adapters/contextCaptureCheck.js +91 -0
- package/dist/adapters/contextCaptureCheck.js.map +1 -0
- package/dist/adapters/databaseUrlFindings.d.ts +1 -1
- package/dist/adapters/databaseUrlFindings.d.ts.map +1 -1
- package/dist/adapters/declaration-files/initialize.d.ts +6 -0
- package/dist/adapters/declaration-files/initialize.d.ts.map +1 -0
- package/dist/adapters/declaration-files/initialize.js +4 -0
- package/dist/adapters/declaration-files/initialize.js.map +1 -0
- package/dist/adapters/declaration-files/parse.d.ts +5 -0
- package/dist/adapters/declaration-files/parse.d.ts.map +1 -0
- package/dist/adapters/declaration-files/parse.js +6 -0
- package/dist/adapters/declaration-files/parse.js.map +1 -0
- package/dist/adapters/declaration-files/reader.d.ts +5 -0
- package/dist/adapters/declaration-files/reader.d.ts.map +1 -0
- package/dist/adapters/declaration-files/reader.js +23 -0
- package/dist/adapters/declaration-files/reader.js.map +1 -0
- package/dist/adapters/declaration-files/service.d.ts +9 -0
- package/dist/adapters/declaration-files/service.d.ts.map +1 -0
- package/dist/adapters/declaration-files/service.js +14 -0
- package/dist/adapters/declaration-files/service.js.map +1 -0
- package/dist/adapters/foreignResources.d.ts.map +1 -1
- package/dist/adapters/foreignResources.js +0 -4
- package/dist/adapters/foreignResources.js.map +1 -1
- package/dist/adapters/import-compiler/graph.d.ts +8 -2
- package/dist/adapters/import-compiler/graph.d.ts.map +1 -1
- package/dist/adapters/import-compiler/graph.js +4 -1
- package/dist/adapters/import-compiler/graph.js.map +1 -1
- package/dist/adapters/import-compiler/service.d.ts +7 -1
- package/dist/adapters/import-compiler/service.d.ts.map +1 -1
- package/dist/adapters/imports/graph.d.ts +6 -3
- package/dist/adapters/imports/graph.d.ts.map +1 -1
- package/dist/adapters/imports/graph.js +31 -18
- package/dist/adapters/imports/graph.js.map +1 -1
- package/dist/adapters/knip/configuration.d.ts +1 -1
- package/dist/adapters/knip/configuration.d.ts.map +1 -1
- package/dist/adapters/knip/configuration.js +6 -4
- package/dist/adapters/knip/configuration.js.map +1 -1
- package/dist/adapters/knip/entryPointFindings.d.ts +1 -1
- package/dist/adapters/knip/entryPointFindings.d.ts.map +1 -1
- package/dist/adapters/knip/run.d.ts.map +1 -1
- package/dist/adapters/knip/run.js +4 -1
- package/dist/adapters/knip/run.js.map +1 -1
- package/dist/adapters/outsideImportFindings.d.ts +4 -2
- package/dist/adapters/outsideImportFindings.d.ts.map +1 -1
- package/dist/adapters/outsideImportFindings.js +12 -52
- package/dist/adapters/outsideImportFindings.js.map +1 -1
- package/dist/adapters/queueReadoutFindings.d.ts +1 -1
- package/dist/adapters/queueReadoutFindings.d.ts.map +1 -1
- package/dist/adapters/rule.d.ts +9 -1
- package/dist/adapters/rule.d.ts.map +1 -1
- package/dist/adapters/rule.js +21 -6
- package/dist/adapters/rule.js.map +1 -1
- package/dist/adapters/runMain.d.ts +3 -4
- package/dist/adapters/runMain.d.ts.map +1 -1
- package/dist/adapters/runMain.js +2 -1
- package/dist/adapters/runMain.js.map +1 -1
- package/dist/adapters/serviceModelCheck.d.ts +9 -0
- package/dist/adapters/serviceModelCheck.d.ts.map +1 -0
- package/dist/adapters/{serviceModelFindings.js → serviceModelCheck.js} +9 -23
- package/dist/adapters/serviceModelCheck.js.map +1 -0
- package/dist/adapters/sharedErrorCatalog.d.ts +13 -0
- package/dist/adapters/sharedErrorCatalog.d.ts.map +1 -0
- package/dist/adapters/sharedErrorCatalog.js +28 -0
- package/dist/adapters/sharedErrorCatalog.js.map +1 -0
- package/dist/adapters/sharedErrorModules.d.ts +1 -1
- package/dist/adapters/sharedErrorModules.d.ts.map +1 -1
- package/dist/adapters/sharedErrorModules.js.map +1 -1
- package/dist/adapters/specReaderSources.d.ts +3 -2
- package/dist/adapters/specReaderSources.d.ts.map +1 -1
- package/dist/adapters/specReaderSources.js +6 -3
- package/dist/adapters/specReaderSources.js.map +1 -1
- package/dist/adapters/storyProgram.d.ts +2 -0
- package/dist/adapters/storyProgram.d.ts.map +1 -1
- package/dist/adapters/storyProgram.js +13 -3
- package/dist/adapters/storyProgram.js.map +1 -1
- package/dist/adapters/typeScriptProgram.d.ts +5 -0
- package/dist/adapters/typeScriptProgram.d.ts.map +1 -0
- package/dist/adapters/typeScriptProgram.js +43 -0
- package/dist/adapters/typeScriptProgram.js.map +1 -0
- package/dist/baseline/compare.d.ts +2 -0
- package/dist/baseline/compare.d.ts.map +1 -1
- package/dist/baseline/compare.js +43 -17
- package/dist/baseline/compare.js.map +1 -1
- package/dist/baseline/format.d.ts +1 -0
- package/dist/baseline/format.d.ts.map +1 -1
- package/dist/baseline/format.js +6 -2
- package/dist/baseline/format.js.map +1 -1
- package/dist/baseline/merge.d.ts.map +1 -1
- package/dist/baseline/merge.js +14 -1
- package/dist/baseline/merge.js.map +1 -1
- package/dist/baseline/rewrite.d.ts.map +1 -1
- package/dist/baseline/rewrite.js +3 -1
- package/dist/baseline/rewrite.js.map +1 -1
- package/dist/baseline/update.d.ts +7 -0
- package/dist/baseline/update.d.ts.map +1 -1
- package/dist/baseline/update.js +29 -8
- package/dist/baseline/update.js.map +1 -1
- package/dist/biome/exceptionConfig.d.ts +3 -0
- package/dist/biome/exceptionConfig.d.ts.map +1 -1
- package/dist/biome/exceptionConfig.js +15 -1
- package/dist/biome/exceptionConfig.js.map +1 -1
- package/dist/biome/scannerRules.d.ts +3 -0
- package/dist/biome/scannerRules.d.ts.map +1 -0
- package/dist/biome/scannerRules.js +42 -0
- package/dist/biome/scannerRules.js.map +1 -0
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +10 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/baseline.d.ts.map +1 -1
- package/dist/cli/baseline.js +5 -1
- package/dist/cli/baseline.js.map +1 -1
- package/dist/cli/lint.d.ts +3 -2
- package/dist/cli/lint.d.ts.map +1 -1
- package/dist/cli/lint.js +13 -5
- package/dist/cli/lint.js.map +1 -1
- package/dist/cli/misplaced.d.ts +6 -0
- package/dist/cli/misplaced.d.ts.map +1 -1
- package/dist/cli/misplaced.js +4 -2
- package/dist/cli/misplaced.js.map +1 -1
- package/dist/cli/program.js +1 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/runSet.d.ts +5 -0
- package/dist/cli/runSet.d.ts.map +1 -0
- package/dist/cli/runSet.js +15 -0
- package/dist/cli/runSet.js.map +1 -0
- package/dist/cli/shrink.d.ts +4 -4
- package/dist/cli/shrink.d.ts.map +1 -1
- package/dist/cli/shrink.js.map +1 -1
- package/dist/cli/usage.d.ts +1 -1
- package/dist/cli/usage.d.ts.map +1 -1
- package/dist/cli/usage.js +7 -2
- package/dist/cli/usage.js.map +1 -1
- package/dist/config/decode.d.ts +1 -0
- package/dist/config/decode.d.ts.map +1 -1
- package/dist/config/decode.js +1 -0
- package/dist/config/decode.js.map +1 -1
- package/dist/config/load.d.ts +2 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +1 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/resolve.d.ts +2 -1
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +9 -4
- package/dist/config/resolve.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/engine/childStarted.d.ts +4 -0
- package/dist/engine/childStarted.d.ts.map +1 -0
- package/dist/engine/childStarted.js +7 -0
- package/dist/engine/childStarted.js.map +1 -0
- package/dist/engine/evaluate.d.ts +1 -0
- package/dist/engine/evaluate.d.ts.map +1 -1
- package/dist/engine/evaluate.js +2 -1
- package/dist/engine/evaluate.js.map +1 -1
- package/dist/engine/runRule.d.ts +21 -0
- package/dist/engine/runRule.d.ts.map +1 -0
- package/dist/engine/runRule.js +70 -0
- package/dist/engine/runRule.js.map +1 -0
- package/dist/engine/runRules.d.ts +5 -12
- package/dist/engine/runRules.d.ts.map +1 -1
- package/dist/engine/runRules.js +49 -65
- package/dist/engine/runRules.js.map +1 -1
- package/dist/engine/session.d.ts +2 -1
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/session.js +20 -6
- package/dist/engine/session.js.map +1 -1
- package/dist/engine/violation.d.ts +7 -0
- package/dist/engine/violation.d.ts.map +1 -1
- package/dist/engine/violation.js +9 -0
- package/dist/engine/violation.js.map +1 -1
- package/dist/exceptions/biomeFindings.d.ts +5 -1
- package/dist/exceptions/biomeFindings.d.ts.map +1 -1
- package/dist/exceptions/biomeFindings.js +17 -18
- package/dist/exceptions/biomeFindings.js.map +1 -1
- package/dist/exceptions/registry.d.ts.map +1 -1
- package/dist/exceptions/registry.js +2 -2
- package/dist/exceptions/registry.js.map +1 -1
- package/dist/hooks/preCommit.d.ts +1 -2
- package/dist/hooks/preCommit.d.ts.map +1 -1
- package/dist/hooks/preCommit.js +11 -1
- package/dist/hooks/preCommit.js.map +1 -1
- package/dist/hooks/stagedCheck.d.ts +5 -0
- package/dist/hooks/stagedCheck.d.ts.map +1 -0
- package/dist/hooks/stagedCheck.js +43 -0
- package/dist/hooks/stagedCheck.js.map +1 -0
- package/dist/hooks/withStagedContent.d.ts +5 -0
- package/dist/hooks/withStagedContent.d.ts.map +1 -0
- package/dist/hooks/withStagedContent.js +84 -0
- package/dist/hooks/withStagedContent.js.map +1 -0
- package/dist/imports/browserGlobals.d.ts +1 -1
- package/dist/imports/browserGlobals.d.ts.map +1 -1
- package/dist/imports/browserNames.d.ts +1 -1
- package/dist/imports/browserNames.d.ts.map +1 -1
- package/dist/imports/browserNames.js +5 -3
- package/dist/imports/browserNames.js.map +1 -1
- package/dist/imports/fences/check.d.ts +1 -1
- package/dist/imports/fences/check.d.ts.map +1 -1
- package/dist/imports/fences/compilePolicy.js +1 -1
- package/dist/imports/fences/compilePolicy.js.map +1 -1
- package/dist/imports/fences/evaluate.d.ts +1 -1
- package/dist/imports/fences/evaluate.d.ts.map +1 -1
- package/dist/imports/fences/evaluate.js +1 -1
- package/dist/imports/fences/evaluate.js.map +1 -1
- package/dist/imports/graph.d.ts +6 -1
- package/dist/imports/graph.d.ts.map +1 -1
- package/dist/imports/graph.js +30 -2
- package/dist/imports/graph.js.map +1 -1
- package/dist/imports/withoutGenerated.js +1 -1
- package/dist/imports/withoutGenerated.js.map +1 -1
- package/dist/inventory/programmaticBuilds.d.ts +1 -1
- package/dist/inventory/programmaticBuilds.d.ts.map +1 -1
- package/dist/inventory/trackedPaths.d.ts +1 -0
- package/dist/inventory/trackedPaths.d.ts.map +1 -1
- package/dist/inventory/trackedPaths.js +9 -3
- package/dist/inventory/trackedPaths.js.map +1 -1
- package/dist/naming/testCode.d.ts +1 -1
- package/dist/naming/testCode.d.ts.map +1 -1
- package/dist/report/render.d.ts +1 -0
- package/dist/report/render.d.ts.map +1 -1
- package/dist/report/render.js +10 -3
- package/dist/report/render.js.map +1 -1
- package/dist/report/runSetLine.d.ts +3 -0
- package/dist/report/runSetLine.d.ts.map +1 -0
- package/dist/report/runSetLine.js +13 -0
- package/dist/report/runSetLine.js.map +1 -0
- package/dist/report/staleSections.d.ts.map +1 -1
- package/dist/report/staleSections.js +13 -0
- package/dist/report/staleSections.js.map +1 -1
- package/dist/rule.d.ts +30 -4
- package/dist/rule.d.ts.map +1 -1
- package/dist/rule.js +4 -2
- package/dist/rule.js.map +1 -1
- package/dist/rules/biome.d.ts +18 -1
- package/dist/rules/biome.d.ts.map +1 -1
- package/dist/rules/biome.js +32 -7
- package/dist/rules/biome.js.map +1 -1
- package/dist/rules/builtIn.d.ts +8 -8
- package/dist/rules/builtIn.d.ts.map +1 -1
- package/dist/rules/builtIn.js +0 -2
- package/dist/rules/builtIn.js.map +1 -1
- package/dist/rules/effect/adapterImports.d.ts +1 -1
- package/dist/rules/effect/adapterImports.d.ts.map +1 -1
- package/dist/rules/effect/adapterImports.js +1 -1
- package/dist/rules/effect/adapterImports.js.map +1 -1
- package/dist/rules/effect/boundary.d.ts +1 -1
- package/dist/rules/effect/boundary.d.ts.map +1 -1
- package/dist/rules/effect/boundary.js +60 -75
- package/dist/rules/effect/boundary.js.map +1 -1
- package/dist/rules/effect/boundaryFindings.d.ts +4 -0
- package/dist/rules/effect/boundaryFindings.d.ts.map +1 -0
- package/dist/rules/effect/boundaryFindings.js +63 -0
- package/dist/rules/effect/boundaryFindings.js.map +1 -0
- package/dist/rules/effect/boundaryReference.d.ts +4 -0
- package/dist/rules/effect/boundaryReference.d.ts.map +1 -1
- package/dist/rules/effect/boundaryReference.js +6 -3
- package/dist/rules/effect/boundaryReference.js.map +1 -1
- package/dist/rules/effect/contextCapture.d.ts.map +1 -1
- package/dist/rules/effect/contextCapture.js +3 -2
- package/dist/rules/effect/contextCapture.js.map +1 -1
- package/dist/rules/effect/errorTags.d.ts +10 -0
- package/dist/rules/effect/errorTags.d.ts.map +1 -0
- package/dist/rules/effect/errorTags.js +57 -0
- package/dist/rules/effect/errorTags.js.map +1 -0
- package/dist/rules/effect/failureHonesty.d.ts +1 -1
- package/dist/rules/effect/failureHonesty.d.ts.map +1 -1
- package/dist/rules/effect/failureHonesty.js +6 -5
- package/dist/rules/effect/failureHonesty.js.map +1 -1
- package/dist/rules/effect/policy.d.ts +1 -1
- package/dist/rules/effect/policy.d.ts.map +1 -1
- package/dist/rules/effect/policy.js +0 -2
- package/dist/rules/effect/policy.js.map +1 -1
- package/dist/rules/effect/promiseBridge.d.ts +3 -0
- package/dist/rules/effect/promiseBridge.d.ts.map +1 -0
- package/dist/rules/effect/promiseBridge.js +60 -0
- package/dist/rules/effect/promiseBridge.js.map +1 -0
- package/dist/rules/effect/rpcBoundary.d.ts.map +1 -1
- package/dist/rules/effect/rpcBoundary.js +92 -3
- package/dist/rules/effect/rpcBoundary.js.map +1 -1
- package/dist/rules/effect/serviceModel.d.ts.map +1 -1
- package/dist/rules/effect/serviceModel.js +3 -2
- package/dist/rules/effect/serviceModel.js.map +1 -1
- package/dist/rules/effect/serviceParameterCheck.d.ts +7 -0
- package/dist/rules/effect/serviceParameterCheck.d.ts.map +1 -0
- package/dist/rules/effect/serviceParameterCheck.js +15 -0
- package/dist/rules/effect/serviceParameterCheck.js.map +1 -0
- package/dist/rules/effect/serviceParameters.d.ts.map +1 -1
- package/dist/rules/effect/serviceParameters.js +4 -36
- package/dist/rules/effect/serviceParameters.js.map +1 -1
- package/dist/rules/effect/sharedErrorClasses.d.ts.map +1 -1
- package/dist/rules/effect/sharedErrorClasses.js +31 -2
- package/dist/rules/effect/sharedErrorClasses.js.map +1 -1
- package/dist/rules/effect/workspaceProgram.d.ts +5 -0
- package/dist/rules/effect/workspaceProgram.d.ts.map +1 -0
- package/dist/rules/effect/workspaceProgram.js +32 -0
- package/dist/rules/effect/workspaceProgram.js.map +1 -0
- package/dist/rules/imports/adminPaths.d.ts +1 -1
- package/dist/rules/imports/adminPaths.d.ts.map +1 -1
- package/dist/rules/imports/cycles.d.ts +1 -1
- package/dist/rules/imports/cycles.d.ts.map +1 -1
- package/dist/rules/imports/fences.d.ts +1 -1
- package/dist/rules/imports/fences.d.ts.map +1 -1
- package/dist/rules/imports/manifest.d.ts +1 -1
- package/dist/rules/imports/manifest.d.ts.map +1 -1
- package/dist/rules/imports/noTestCode.d.ts +1 -1
- package/dist/rules/imports/noTestCode.d.ts.map +1 -1
- package/dist/rules/imports/runtime.d.ts +1 -1
- package/dist/rules/imports/runtime.d.ts.map +1 -1
- package/dist/rules/imports/runtime.js +32 -5
- package/dist/rules/imports/runtime.js.map +1 -1
- package/dist/rules/manifestsNoTestKits.js +1 -1
- package/dist/rules/manifestsNoTestKits.js.map +1 -1
- package/dist/rules/maxLines.d.ts +1 -1
- package/dist/rules/maxLines.d.ts.map +1 -1
- package/dist/rules/packageFindings.d.ts +31 -0
- package/dist/rules/packageFindings.d.ts.map +1 -0
- package/dist/rules/packageFindings.js +65 -0
- package/dist/rules/packageFindings.js.map +1 -0
- package/dist/rules/parse.d.ts +4 -1
- package/dist/rules/parse.d.ts.map +1 -1
- package/dist/rules/parse.js +35 -2
- package/dist/rules/parse.js.map +1 -1
- package/dist/rules/rootedFindings.d.ts +5 -0
- package/dist/rules/rootedFindings.d.ts.map +1 -0
- package/dist/rules/rootedFindings.js +16 -0
- package/dist/rules/rootedFindings.js.map +1 -0
- package/dist/rules/stories/adapterOnlyFakes.d.ts +1 -1
- package/dist/rules/stories/adapterOnlyFakes.d.ts.map +1 -1
- package/dist/rules/stories/adapterOnlyFakes.js +1 -0
- package/dist/rules/stories/adapterOnlyFakes.js.map +1 -1
- package/dist/rules/stories/databaseUrl.d.ts +1 -1
- package/dist/rules/stories/databaseUrl.d.ts.map +1 -1
- package/dist/rules/stories/databaseUrl.js +1 -0
- package/dist/rules/stories/databaseUrl.js.map +1 -1
- package/dist/rules/stories/domainOutcomes.d.ts +1 -1
- package/dist/rules/stories/domainOutcomes.d.ts.map +1 -1
- package/dist/rules/stories/domainOutcomes.js +1 -0
- package/dist/rules/stories/domainOutcomes.js.map +1 -1
- package/dist/rules/stories/engine.d.ts +1 -1
- package/dist/rules/stories/engine.d.ts.map +1 -1
- package/dist/rules/stories/engine.js +1 -0
- package/dist/rules/stories/engine.js.map +1 -1
- package/dist/rules/stories/globalRetries.d.ts +1 -1
- package/dist/rules/stories/globalRetries.d.ts.map +1 -1
- package/dist/rules/stories/globalRetries.js +1 -0
- package/dist/rules/stories/globalRetries.js.map +1 -1
- package/dist/rules/stories/groupedOutcomes.d.ts +1 -1
- package/dist/rules/stories/groupedOutcomes.d.ts.map +1 -1
- package/dist/rules/stories/groupedOutcomes.js +1 -0
- package/dist/rules/stories/groupedOutcomes.js.map +1 -1
- package/dist/rules/stories/importedChangeKeys.js +2 -2
- package/dist/rules/stories/importedChangeKeys.js.map +1 -1
- package/dist/rules/stories/namedValues.d.ts +1 -1
- package/dist/rules/stories/namedValues.d.ts.map +1 -1
- package/dist/rules/stories/namedValues.js +1 -0
- package/dist/rules/stories/namedValues.js.map +1 -1
- package/dist/rules/stories/noExpect.d.ts +1 -1
- package/dist/rules/stories/noExpect.d.ts.map +1 -1
- package/dist/rules/stories/noLimitImports.d.ts +1 -1
- package/dist/rules/stories/noLimitImports.d.ts.map +1 -1
- package/dist/rules/stories/noLimitImports.js +1 -0
- package/dist/rules/stories/noLimitImports.js.map +1 -1
- package/dist/rules/stories/positiveRefusals.d.ts +1 -1
- package/dist/rules/stories/positiveRefusals.d.ts.map +1 -1
- package/dist/rules/stories/positiveRefusals.js +1 -0
- package/dist/rules/stories/positiveRefusals.js.map +1 -1
- package/dist/rules/stories/queueReadouts.d.ts +1 -1
- package/dist/rules/stories/queueReadouts.d.ts.map +1 -1
- package/dist/rules/stories/queueReadouts.js +1 -0
- package/dist/rules/stories/queueReadouts.js.map +1 -1
- package/dist/rules/stories/sources.d.ts +2 -2
- package/dist/rules/stories/sources.d.ts.map +1 -1
- package/dist/rules/stories/specHelpers.d.ts +1 -1
- package/dist/rules/stories/specHelpers.d.ts.map +1 -1
- package/dist/rules/stories/specHelpers.js +3 -2
- package/dist/rules/stories/specHelpers.js.map +1 -1
- package/dist/rules/stories/specs.d.ts +1 -1
- package/dist/rules/stories/specs.d.ts.map +1 -1
- package/dist/rules/stories/specs.js +1 -0
- package/dist/rules/stories/specs.js.map +1 -1
- package/dist/rules/stories/waitOnEvents.d.ts +1 -1
- package/dist/rules/stories/waitOnEvents.d.ts.map +1 -1
- package/dist/rules/stories/waitOnEvents.js +3 -3
- package/dist/rules/stories/waitOnEvents.js.map +1 -1
- package/dist/rules/suppressions/noDoubleCast.d.ts.map +1 -1
- package/dist/rules/suppressions/noDoubleCast.js +4 -49
- package/dist/rules/suppressions/noDoubleCast.js.map +1 -1
- package/dist/rules/suppressions/typedCastCheck.d.ts +10 -0
- package/dist/rules/suppressions/typedCastCheck.d.ts.map +1 -0
- package/dist/rules/suppressions/typedCastCheck.js +48 -0
- package/dist/rules/suppressions/typedCastCheck.js.map +1 -0
- package/dist/rules/unusedCode.d.ts.map +1 -1
- package/dist/rules/unusedCode.js +1 -0
- package/dist/rules/unusedCode.js.map +1 -1
- package/dist/testing/adapters/cli.d.ts +1 -0
- package/dist/testing/adapters/cli.d.ts.map +1 -1
- package/dist/testing/adapters/cli.js +10 -8
- package/dist/testing/adapters/cli.js.map +1 -1
- package/dist/testing/adapters/git.d.ts +1 -16
- package/dist/testing/adapters/git.d.ts.map +1 -1
- package/dist/testing/adapters/git.js +5 -10
- package/dist/testing/adapters/git.js.map +1 -1
- package/dist/testing/adapters/hookRepository.d.ts +3 -2
- package/dist/testing/adapters/hookRepository.d.ts.map +1 -1
- package/dist/testing/adapters/hookRepository.js +11 -8
- package/dist/testing/adapters/hookRepository.js.map +1 -1
- package/dist/testing/adapters/imports.d.ts.map +1 -1
- package/dist/testing/adapters/imports.js +4 -1
- package/dist/testing/adapters/imports.js.map +1 -1
- package/dist/testing/ruleStory.d.ts +1 -1
- package/dist/testing/ruleStory.js +2 -2
- package/dist/testing/ruleStory.js.map +1 -1
- package/docs/debt-and-hooks.md +5 -3
- package/package.json +19 -19
- package/src/adapters/biome/pluginContract.ts +2 -5
- package/src/adapters/biome/run.ts +2 -0
- package/src/adapters/biome/withExceptionConfig.ts +26 -5
- package/src/adapters/{changeKeyFindings.ts → changeKeyCheck.ts} +8 -24
- package/src/adapters/contextCaptureCheck.ts +106 -0
- package/src/adapters/declaration-files/initialize.ts +4 -0
- package/src/adapters/declaration-files/parse.ts +9 -0
- package/src/adapters/declaration-files/reader.ts +28 -0
- package/src/adapters/declaration-files/service.ts +16 -0
- package/src/adapters/foreignResources.ts +0 -4
- package/src/adapters/import-compiler/graph.ts +7 -2
- package/src/adapters/imports/graph.ts +43 -18
- package/src/adapters/knip/configuration.ts +6 -4
- package/src/adapters/knip/run.ts +4 -1
- package/src/adapters/outsideImportFindings.ts +21 -65
- package/src/adapters/rule.ts +29 -6
- package/src/adapters/runMain.ts +7 -6
- package/src/adapters/{serviceModelFindings.ts → serviceModelCheck.ts} +10 -25
- package/src/adapters/sharedErrorCatalog.ts +43 -0
- package/src/adapters/sharedErrorModules.ts +1 -1
- package/src/adapters/specReaderSources.ts +6 -3
- package/src/adapters/storyProgram.ts +20 -3
- package/src/adapters/typeScriptProgram.ts +57 -0
- package/src/baseline/compare.ts +59 -19
- package/src/baseline/format.ts +7 -2
- package/src/baseline/merge.ts +15 -1
- package/src/baseline/rewrite.ts +3 -1
- package/src/baseline/update.ts +38 -8
- package/src/biome/exceptionConfig.ts +24 -3
- package/src/biome/scannerRules.ts +42 -0
- package/src/cli/args.ts +13 -2
- package/src/cli/baseline.ts +7 -1
- package/src/cli/lint.ts +14 -6
- package/src/cli/misplaced.ts +4 -2
- package/src/cli/program.ts +1 -1
- package/src/cli/runSet.ts +17 -0
- package/src/cli/shrink.ts +4 -11
- package/src/cli/usage.ts +7 -2
- package/src/config/decode.ts +1 -0
- package/src/config/load.ts +3 -0
- package/src/config/resolve.ts +11 -6
- package/src/config.ts +3 -0
- package/src/engine/childStarted.ts +8 -0
- package/src/engine/evaluate.ts +3 -1
- package/src/engine/runRule.ts +103 -0
- package/src/engine/runRules.ts +64 -86
- package/src/engine/session.ts +23 -5
- package/src/engine/violation.ts +16 -0
- package/src/exceptions/biomeFindings.ts +24 -21
- package/src/exceptions/registry.ts +2 -2
- package/src/hooks/preCommit.ts +15 -1
- package/src/hooks/stagedCheck.ts +54 -0
- package/src/hooks/withStagedContent.ts +111 -0
- package/src/imports/browserNames.ts +7 -5
- package/src/imports/fences/compilePolicy.ts +1 -1
- package/src/imports/fences/evaluate.ts +2 -2
- package/src/imports/graph.ts +47 -3
- package/src/imports/withoutGenerated.ts +1 -1
- package/src/inventory/trackedPaths.ts +10 -3
- package/src/report/render.ts +12 -3
- package/src/report/runSetLine.ts +14 -0
- package/src/report/staleSections.ts +14 -0
- package/src/rule.ts +38 -7
- package/src/rules/biome.ts +53 -7
- package/src/rules/builtIn.ts +0 -2
- package/src/rules/effect/adapterImports.ts +1 -1
- package/src/rules/effect/boundary.ts +82 -83
- package/src/rules/effect/boundaryFindings.ts +71 -0
- package/src/rules/effect/boundaryReference.ts +7 -3
- package/src/rules/effect/contextCapture.ts +3 -2
- package/src/rules/effect/errorTags.ts +72 -0
- package/src/rules/effect/failureHonesty.ts +9 -5
- package/src/rules/effect/policy.ts +0 -2
- package/src/rules/effect/promiseBridge.ts +65 -0
- package/src/rules/effect/rpcBoundary.ts +111 -4
- package/src/rules/effect/serviceModel.ts +3 -2
- package/src/rules/effect/serviceParameterCheck.ts +22 -0
- package/src/rules/effect/serviceParameters.ts +5 -37
- package/src/rules/effect/sharedErrorClasses.ts +41 -3
- package/src/rules/effect/workspaceProgram.ts +34 -0
- package/src/rules/imports/runtime.ts +43 -6
- package/src/rules/manifestsNoTestKits.ts +1 -1
- package/src/rules/packageFindings.ts +103 -0
- package/src/rules/parse.ts +54 -3
- package/src/rules/rootedFindings.ts +19 -0
- package/src/rules/stories/adapterOnlyFakes.ts +1 -0
- package/src/rules/stories/databaseUrl.ts +1 -0
- package/src/rules/stories/domainOutcomes.ts +1 -0
- package/src/rules/stories/engine.ts +1 -0
- package/src/rules/stories/globalRetries.ts +1 -0
- package/src/rules/stories/groupedOutcomes.ts +1 -0
- package/src/rules/stories/importedChangeKeys.ts +2 -2
- package/src/rules/stories/namedValues.ts +1 -0
- package/src/rules/stories/noLimitImports.ts +1 -0
- package/src/rules/stories/positiveRefusals.ts +1 -0
- package/src/rules/stories/queueReadouts.ts +1 -0
- package/src/rules/stories/specHelpers.ts +8 -5
- package/src/rules/stories/specs.ts +1 -0
- package/src/rules/stories/waitOnEvents.ts +6 -3
- package/src/rules/suppressions/noDoubleCast.ts +5 -55
- package/src/rules/suppressions/typedCastCheck.ts +55 -0
- package/src/rules/unusedCode.ts +1 -0
- package/src/testing/adapters/cli.ts +13 -9
- package/src/testing/adapters/git.ts +6 -11
- package/src/testing/adapters/hookRepository.ts +12 -7
- package/src/testing/adapters/imports.ts +4 -1
- package/src/testing/ruleStory.ts +2 -2
- package/dist/adapters/biome/presetConfig.d.ts +0 -21
- package/dist/adapters/biome/presetConfig.d.ts.map +0 -1
- package/dist/adapters/biome/presetConfig.js +0 -32
- package/dist/adapters/biome/presetConfig.js.map +0 -1
- package/dist/adapters/changeKeyFindings.d.ts +0 -4
- package/dist/adapters/changeKeyFindings.d.ts.map +0 -1
- package/dist/adapters/changeKeyFindings.js.map +0 -1
- package/dist/adapters/contextCaptureFindings.d.ts +0 -4
- package/dist/adapters/contextCaptureFindings.d.ts.map +0 -1
- package/dist/adapters/contextCaptureFindings.js +0 -51
- package/dist/adapters/contextCaptureFindings.js.map +0 -1
- package/dist/adapters/nativeTransactionFindings.d.ts +0 -4
- package/dist/adapters/nativeTransactionFindings.d.ts.map +0 -1
- package/dist/adapters/nativeTransactionFindings.js +0 -98
- package/dist/adapters/nativeTransactionFindings.js.map +0 -1
- package/dist/adapters/rpcBoundaryFindings.d.ts +0 -4
- package/dist/adapters/rpcBoundaryFindings.d.ts.map +0 -1
- package/dist/adapters/rpcBoundaryFindings.js +0 -90
- package/dist/adapters/rpcBoundaryFindings.js.map +0 -1
- package/dist/adapters/serviceModelFindings.d.ts +0 -4
- package/dist/adapters/serviceModelFindings.d.ts.map +0 -1
- package/dist/adapters/serviceModelFindings.js.map +0 -1
- package/dist/adapters/sharedErrorFindings.d.ts +0 -4
- package/dist/adapters/sharedErrorFindings.d.ts.map +0 -1
- package/dist/adapters/sharedErrorFindings.js +0 -71
- package/dist/adapters/sharedErrorFindings.js.map +0 -1
- package/dist/adapters/transactionChanges.d.ts +0 -3
- package/dist/adapters/transactionChanges.d.ts.map +0 -1
- package/dist/adapters/transactionChanges.js +0 -81
- package/dist/adapters/transactionChanges.js.map +0 -1
- package/dist/adapters/vitePort.d.ts +0 -2
- package/dist/adapters/vitePort.d.ts.map +0 -1
- package/dist/adapters/vitePort.js +0 -5
- package/dist/adapters/vitePort.js.map +0 -1
- package/dist/appTestConfig.d.ts +0 -4
- package/dist/appTestConfig.d.ts.map +0 -1
- package/dist/appTestConfig.js +0 -9
- package/dist/appTestConfig.js.map +0 -1
- package/dist/appViteConfig.d.ts +0 -23
- package/dist/appViteConfig.d.ts.map +0 -1
- package/dist/appViteConfig.js +0 -17
- package/dist/appViteConfig.js.map +0 -1
- package/dist/biome/recommendedRules.d.ts +0 -3
- package/dist/biome/recommendedRules.d.ts.map +0 -1
- package/dist/biome/recommendedRules.js +0 -20
- package/dist/biome/recommendedRules.js.map +0 -1
- package/dist/rules/effect/program.d.ts +0 -8
- package/dist/rules/effect/program.d.ts.map +0 -1
- package/dist/rules/effect/program.js +0 -53
- package/dist/rules/effect/program.js.map +0 -1
- package/dist/rules/effect/sqlTransact.d.ts +0 -2
- package/dist/rules/effect/sqlTransact.d.ts.map +0 -1
- package/dist/rules/effect/sqlTransact.js +0 -9
- package/dist/rules/effect/sqlTransact.js.map +0 -1
- package/dist/rules/suppressions/biomeRecommended.d.ts +0 -7
- package/dist/rules/suppressions/biomeRecommended.d.ts.map +0 -1
- package/dist/rules/suppressions/biomeRecommended.js +0 -47
- package/dist/rules/suppressions/biomeRecommended.js.map +0 -1
- package/src/adapters/biome/presetConfig.ts +0 -34
- package/src/adapters/contextCaptureFindings.ts +0 -60
- package/src/adapters/nativeTransactionFindings.ts +0 -108
- package/src/adapters/rpcBoundaryFindings.ts +0 -98
- package/src/adapters/sharedErrorFindings.ts +0 -84
- package/src/adapters/transactionChanges.ts +0 -85
- package/src/adapters/vitePort.ts +0 -5
- package/src/appTestConfig.ts +0 -10
- package/src/appViteConfig.ts +0 -24
- package/src/biome/recommendedRules.ts +0 -27
- package/src/rules/effect/program.ts +0 -57
- package/src/rules/effect/sqlTransact.ts +0 -10
- package/src/rules/suppressions/biomeRecommended.ts +0 -60
package/src/cli/args.ts
CHANGED
|
@@ -2,11 +2,12 @@ import { Result } from "effect";
|
|
|
2
2
|
import { commandLine } from "#adapters/commandLine.ts";
|
|
3
3
|
import { ACCEPTS, misplaced, type Values } from "#cli/misplaced.ts";
|
|
4
4
|
import { SUBCOMMANDS } from "#cli/subcommands.ts";
|
|
5
|
+
import type { RunSet } from "#engine/session.ts";
|
|
5
6
|
|
|
6
7
|
export type Command =
|
|
7
8
|
| { readonly _tag: "Ci"; readonly coverage: boolean }
|
|
8
9
|
| { readonly _tag: "Setup"; readonly config: string | undefined }
|
|
9
|
-
| { readonly _tag: "Lint"; readonly config: string | undefined }
|
|
10
|
+
| { readonly _tag: "Lint"; readonly config: string | undefined; readonly set: RunSet | undefined }
|
|
10
11
|
| { readonly _tag: "ExceptionsMigrate"; readonly config: string | undefined; readonly from: string | undefined }
|
|
11
12
|
| { readonly _tag: "Fix"; readonly config: string | undefined; readonly rules: readonly string[] }
|
|
12
13
|
| { readonly _tag: "BaselineMerge"; readonly base: string; readonly ours: string; readonly theirs: string }
|
|
@@ -39,6 +40,13 @@ function ref(against: string | undefined, command: Command): Parsed {
|
|
|
39
40
|
return against?.startsWith("-") === true ? usage(`--against takes a git ref, not "${against}".`) : parsed(command);
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
function runSetOf(values: Values): RunSet | undefined {
|
|
44
|
+
if (values.fast === true) {
|
|
45
|
+
return "fast";
|
|
46
|
+
}
|
|
47
|
+
return values.full === true ? "full" : undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
42
50
|
function commandFor(name: string, values: Values): Parsed {
|
|
43
51
|
const config = values.config;
|
|
44
52
|
switch (name) {
|
|
@@ -47,7 +55,10 @@ function commandFor(name: string, values: Values): Parsed {
|
|
|
47
55
|
case "setup":
|
|
48
56
|
return parsed({ _tag: "Setup", config });
|
|
49
57
|
case "lint":
|
|
50
|
-
|
|
58
|
+
if (values.fast === true && values.full === true) {
|
|
59
|
+
return usage("--fast and --full exclude each other.");
|
|
60
|
+
}
|
|
61
|
+
return parsed({ _tag: "Lint", config, set: runSetOf(values) });
|
|
51
62
|
case "exceptions migrate":
|
|
52
63
|
return parsed({ _tag: "ExceptionsMigrate", config, from: values.from });
|
|
53
64
|
case "fix":
|
package/src/cli/baseline.ts
CHANGED
|
@@ -43,6 +43,7 @@ function changes(pruned: Pruned): string {
|
|
|
43
43
|
`removed ${plural(pruned.removed, "entry", "entries")}`,
|
|
44
44
|
`lowered ${plural(pruned.lowered, "entry", "entries")}`,
|
|
45
45
|
...(pruned.moved > 0 ? [`carried ${plural(pruned.moved, "entry", "entries")} to moved files`] : []),
|
|
46
|
+
...(pruned.split > 0 ? [`recorded the deep half of ${plural(pruned.split, "entry", "entries")}`] : []),
|
|
46
47
|
];
|
|
47
48
|
return `${parts.slice(0, -1).join(", ")} and ${parts.at(-1)}`;
|
|
48
49
|
}
|
|
@@ -58,9 +59,14 @@ export const shrinkBaseline = Effect.fn("Cli.shrinkBaseline")(function* <TRequir
|
|
|
58
59
|
}
|
|
59
60
|
const pruned = prune(session.baseline.entries, unregistered(session), session.config, yield* scopeOf(session));
|
|
60
61
|
const emptyShard = [...session.baseline.files.values()].some((file) => file.entries.length === 0);
|
|
61
|
-
if (pruned.removed === 0 && pruned.lowered === 0 && pruned.moved === 0 && !emptyShard) {
|
|
62
|
+
if (pruned.removed === 0 && pruned.lowered === 0 && pruned.moved === 0 && pruned.split === 0 && !emptyShard) {
|
|
62
63
|
return yield* Console.log(`quality: ${session.config.baseline} is current.`);
|
|
63
64
|
}
|
|
64
65
|
yield* save(session, pruned.entries);
|
|
65
66
|
yield* Console.log(`quality: ${changes(pruned)} in ${session.config.baseline}.`);
|
|
67
|
+
for (const { by, file, rule } of pruned.grown) {
|
|
68
|
+
yield* Console.log(
|
|
69
|
+
`quality: ${rule}'s typed half reports ${plural(by, "finding")} more in ${file} than its entry allows; CI will report ${by === 1 ? "it" : "them"}.`,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
66
72
|
});
|
package/src/cli/lint.ts
CHANGED
|
@@ -3,11 +3,13 @@ import * as NodePath from "@effect/platform-node/NodePath";
|
|
|
3
3
|
import { Console, Effect, Path } from "effect";
|
|
4
4
|
import { withHeavyLock } from "@shivaedev/heavy-lock/withHeavyLock.ts";
|
|
5
5
|
import { looseStagedEntries } from "#baseline/looseStagedEntries.ts";
|
|
6
|
+
import { runSet } from "#cli/runSet.ts";
|
|
6
7
|
import { evaluate, type Outcome, passes } from "#engine/evaluate.ts";
|
|
7
|
-
import { openSession } from "#engine/session.ts";
|
|
8
|
+
import { openSession, type RunSet } from "#engine/session.ts";
|
|
8
9
|
import { keyOf } from "#engine/violation.ts";
|
|
9
10
|
import { GateFailed, SetupFailure } from "#failure.ts";
|
|
10
11
|
import { type ReportContext, render } from "#report/render.ts";
|
|
12
|
+
import { runSetLine } from "#report/runSetLine.ts";
|
|
11
13
|
import type { RuleServices } from "#rule.ts";
|
|
12
14
|
|
|
13
15
|
export interface LintResult {
|
|
@@ -16,10 +18,11 @@ export interface LintResult {
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export const reportLint = Effect.fn("Cli.reportLint")(
|
|
19
|
-
function* (cwd: string, config: string | undefined, staged: boolean): Effect.fn.Return<LintResult, SetupFailure, RuleServices> {
|
|
21
|
+
function* (cwd: string, config: string | undefined, staged: boolean, requested?: RunSet): Effect.fn.Return<LintResult, SetupFailure, RuleServices> {
|
|
20
22
|
const { relative } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
|
|
21
23
|
|
|
22
|
-
const
|
|
24
|
+
const set = yield* runSet(requested);
|
|
25
|
+
const session = yield* openSession(cwd, config, set);
|
|
23
26
|
const evaluated = evaluate(session.violations, session.registry, session.baseline.entries, session.config);
|
|
24
27
|
const loose = staged ? yield* looseStagedEntries(session) : [];
|
|
25
28
|
const rejected = new Set(loose.map(({ entry }) => keyOf(entry.rule, entry.file)));
|
|
@@ -35,7 +38,12 @@ export const reportLint = Effect.fn("Cli.reportLint")(
|
|
|
35
38
|
descriptions: new Map(session.config.active.map((rule) => [rule.id, rule.description])),
|
|
36
39
|
registry: session.config.exceptions.length === 0 ? session.config.registry : `${relative(session.config.root, session.config.file)} exceptions`,
|
|
37
40
|
};
|
|
38
|
-
|
|
41
|
+
const halves = session.config.active.flatMap((rule) => (rule.deepHalf === undefined ? [] : [`${rule.id} ${rule.deepHalf.name}`]));
|
|
42
|
+
const deep = [
|
|
43
|
+
...(set === "full" ? session.config.active.filter((rule) => rule.depth === "deep").map((rule) => rule.id) : session.config.skipped),
|
|
44
|
+
...halves,
|
|
45
|
+
];
|
|
46
|
+
yield* Console.log([render(outcome, context), ...runSetLine(set, deep, config)].join("\n\n"));
|
|
39
47
|
return { context, outcome };
|
|
40
48
|
},
|
|
41
49
|
(effect) =>
|
|
@@ -46,8 +54,8 @@ export const reportLint = Effect.fn("Cli.reportLint")(
|
|
|
46
54
|
),
|
|
47
55
|
);
|
|
48
56
|
|
|
49
|
-
export const lint = Effect.fn("Cli.lint")(function* (cwd: string, config: string | undefined) {
|
|
50
|
-
const { outcome } = yield* reportLint(cwd, config, false);
|
|
57
|
+
export const lint = Effect.fn("Cli.lint")(function* (cwd: string, config: string | undefined, requested: RunSet | undefined) {
|
|
58
|
+
const { outcome } = yield* reportLint(cwd, config, false, requested);
|
|
51
59
|
if (!passes(outcome)) {
|
|
52
60
|
return yield* new GateFailed();
|
|
53
61
|
}
|
package/src/cli/misplaced.ts
CHANGED
|
@@ -4,8 +4,10 @@ export const OPTIONS = {
|
|
|
4
4
|
against: { type: "string" },
|
|
5
5
|
config: { type: "string" },
|
|
6
6
|
coverage: { type: "boolean" },
|
|
7
|
+
fast: { type: "boolean" },
|
|
7
8
|
force: { type: "boolean" },
|
|
8
9
|
from: { type: "string" },
|
|
10
|
+
full: { type: "boolean" },
|
|
9
11
|
help: { short: "h", type: "boolean" },
|
|
10
12
|
rule: { multiple: true, type: "string" },
|
|
11
13
|
staged: { type: "boolean" },
|
|
@@ -15,7 +17,7 @@ export type Values = ReturnType<typeof parseArgs<{ options: typeof OPTIONS; allo
|
|
|
15
17
|
|
|
16
18
|
type Option = Exclude<keyof Values, "config" | "help">;
|
|
17
19
|
|
|
18
|
-
const COMMAND_OPTIONS: readonly Option[] = ["against", "coverage", "force", "from", "rule", "staged"];
|
|
20
|
+
const COMMAND_OPTIONS: readonly Option[] = ["against", "coverage", "fast", "force", "from", "full", "rule", "staged"];
|
|
19
21
|
|
|
20
22
|
export const ACCEPTS: Readonly<Record<string, readonly Option[]>> = {
|
|
21
23
|
"baseline install-driver": [],
|
|
@@ -30,7 +32,7 @@ export const ACCEPTS: Readonly<Record<string, readonly Option[]>> = {
|
|
|
30
32
|
"hooks pre-commit": [],
|
|
31
33
|
"hooks status": [],
|
|
32
34
|
"hooks uninstall": [],
|
|
33
|
-
lint: [],
|
|
35
|
+
lint: ["fast", "full"],
|
|
34
36
|
setup: [],
|
|
35
37
|
};
|
|
36
38
|
|
package/src/cli/program.ts
CHANGED
|
@@ -39,7 +39,7 @@ export const program = Effect.fn("Cli.program")(function* (args: readonly string
|
|
|
39
39
|
case "Setup":
|
|
40
40
|
return yield* setupHook({ config: command.config, cwd, launch });
|
|
41
41
|
case "Lint":
|
|
42
|
-
return yield* lint(cwd, command.config);
|
|
42
|
+
return yield* lint(cwd, command.config, command.set);
|
|
43
43
|
case "Fix":
|
|
44
44
|
return yield* command.rules.length === 0 ? fix(cwd, command.config) : fixRule(cwd, command.config, command.rules);
|
|
45
45
|
case "BaselineMerge":
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Config, Effect } from "effect";
|
|
2
|
+
import type { RunSet } from "#engine/session.ts";
|
|
3
|
+
import { SetupFailure } from "#failure.ts";
|
|
4
|
+
|
|
5
|
+
const everyRule = Config.all({
|
|
6
|
+
ci: Config.String("CI").pipe(Config.withDefault("")),
|
|
7
|
+
remote: Config.String("CLAUDE_CODE_REMOTE").pipe(Config.withDefault("")),
|
|
8
|
+
}).pipe(Config.map(({ ci, remote }) => ci !== "" || remote === "true"));
|
|
9
|
+
|
|
10
|
+
// CI and Claude Code cloud sessions run every rule, so a consumer's CI job and cloud commit hook keep the deep rules without changing a script.
|
|
11
|
+
export const runSet = Effect.fn("Cli.runSet")(function* (requested: RunSet | undefined) {
|
|
12
|
+
if (requested !== undefined) {
|
|
13
|
+
return requested;
|
|
14
|
+
}
|
|
15
|
+
const full = yield* everyRule.pipe(Effect.mapError((cause) => new SetupFailure({ cause, message: "cannot read CI or CLAUDE_CODE_REMOTE." })));
|
|
16
|
+
return full ? "full" : "fast";
|
|
17
|
+
});
|
package/src/cli/shrink.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Console, Effect
|
|
1
|
+
import { Console, Effect } from "effect";
|
|
2
2
|
import type { ChildProcessSpawner } from "effect/process";
|
|
3
3
|
import type { Scope } from "#baseline/update.ts";
|
|
4
4
|
import { shrinkBaseline } from "#cli/baseline.ts";
|
|
5
5
|
import type { SetupFailure } from "#failure.ts";
|
|
6
6
|
import { resolveBase } from "#git/base.ts";
|
|
7
7
|
import { changesSince } from "#git/history.ts";
|
|
8
|
+
import type { RuleServices } from "#rule.ts";
|
|
8
9
|
|
|
9
10
|
function followedMoves(root: string, against: string | undefined): Effect.Effect<Scope, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
|
|
10
11
|
return resolveBase(root, against).pipe(
|
|
@@ -17,18 +18,10 @@ function followedMoves(root: string, against: string | undefined): Effect.Effect
|
|
|
17
18
|
);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
export function pruneBaseline(
|
|
21
|
-
cwd: string,
|
|
22
|
-
config: string | undefined,
|
|
23
|
-
against: string | undefined,
|
|
24
|
-
): Effect.Effect<void, SetupFailure, FileSystem.FileSystem | ChildProcessSpawner.ChildProcessSpawner> {
|
|
21
|
+
export function pruneBaseline(cwd: string, config: string | undefined, against: string | undefined): Effect.Effect<void, SetupFailure, RuleServices> {
|
|
25
22
|
return shrinkBaseline(cwd, config, (session) => followedMoves(session.config.root, against));
|
|
26
23
|
}
|
|
27
24
|
|
|
28
|
-
export function tightenBaseline(
|
|
29
|
-
cwd: string,
|
|
30
|
-
config: string | undefined,
|
|
31
|
-
staged: boolean,
|
|
32
|
-
): Effect.Effect<void, SetupFailure, FileSystem.FileSystem | ChildProcessSpawner.ChildProcessSpawner> {
|
|
25
|
+
export function tightenBaseline(cwd: string, config: string | undefined, staged: boolean): Effect.Effect<void, SetupFailure, RuleServices> {
|
|
33
26
|
return shrinkBaseline(cwd, config, (session) => changesSince(session.config.root, staged ? ["--cached"] : ["HEAD"]));
|
|
34
27
|
}
|
package/src/cli/usage.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const USAGE = `Usage:
|
|
2
|
-
quality lint [--config <file>]
|
|
2
|
+
quality lint [--config <file>] [--fast | --full]
|
|
3
3
|
quality ci [--coverage]
|
|
4
4
|
quality setup [--config <file>]
|
|
5
5
|
quality fix [--config <file>] [--rule <id>]...
|
|
@@ -17,7 +17,9 @@ export const USAGE = `Usage:
|
|
|
17
17
|
|
|
18
18
|
ci Check pnpm peers, then run the application scripts lint, typecheck, build and test, stopping on failure.
|
|
19
19
|
setup Install the Quality hook when the current folder owns a .git entry; skip unversioned and enclosed apps.
|
|
20
|
-
lint Run
|
|
20
|
+
lint Run the fast rules, or every rule when CI is set, CLAUDE_CODE_REMOTE is true or --full is given.
|
|
21
|
+
A fast run names the deep rules and deep halves it skipped and sets aside the baseline entries and exceptions they own.
|
|
22
|
+
Exits 1 on an error-level violation, a file over its baseline, a stale registry entry
|
|
21
23
|
or a baseline entry for an unknown rule.
|
|
22
24
|
fix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.
|
|
23
25
|
With --rule, apply only that rule's safe mechanical fixes and report remaining findings (exit 1), including baseline debt. Unsupported rules exit 2.
|
|
@@ -34,8 +36,11 @@ hooks install Install the git pre-commit hook, shared by every worktree, tha
|
|
|
34
36
|
hooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.
|
|
35
37
|
hooks status Check that git's effective hooks path runs Quality's pre-commit hook and report global chaining.
|
|
36
38
|
hooks pre-commit Check lint and staged baseline counts, then package.json scripts typecheck and quality:commit when present.
|
|
39
|
+
With preCommit: "staged" outside a Claude Code cloud session, run only Biome on the staged content of staged files.
|
|
37
40
|
|
|
38
41
|
--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.
|
|
39
42
|
--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.
|
|
43
|
+
--fast Run only the fast rules, even in CI.
|
|
44
|
+
--full Run every rule, deep rules included.
|
|
40
45
|
--coverage Collect V8 coverage and JUnit from ci's single test run into coverage/, including failed tests.
|
|
41
46
|
Exit codes: 0 passed, 1 failed the gate, 2 could not run.`;
|
package/src/config/decode.ts
CHANGED
|
@@ -31,6 +31,7 @@ const ConfigInput = Schema.Struct({
|
|
|
31
31
|
extensions: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
32
32
|
local: Schema.optionalKey(Schema.Array(LocalRule)),
|
|
33
33
|
nonEffectFolders: Schema.optionalKey(NonEffectFolders),
|
|
34
|
+
preCommit: Schema.optionalKey(Schema.Literals(["full", "staged"])),
|
|
34
35
|
registry: Schema.optionalKey(Schema.String),
|
|
35
36
|
rules: Schema.optionalKey(Schema.Record(Schema.String, Setting)),
|
|
36
37
|
sources: Schema.optionalKey(Schema.Array(Schema.String)),
|
package/src/config/load.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { readConfig } from "#adapters/readConfig.ts";
|
|
|
4
4
|
import { type ConfigInput, decodeConfig } from "#config/decode.ts";
|
|
5
5
|
import { DEFAULT_EXTENSIONS } from "#config/defaultExtensions.ts";
|
|
6
6
|
import { type ResolvedRules, resolveRules } from "#config/resolve.ts";
|
|
7
|
+
import type { PreCommit } from "#config.ts";
|
|
7
8
|
import { validOrFail } from "#decoded.ts";
|
|
8
9
|
import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
|
|
9
10
|
import type { SetupFailure } from "#failure.ts";
|
|
@@ -18,6 +19,7 @@ export interface ResolvedConfig extends ResolvedRules, InventoryScope {
|
|
|
18
19
|
readonly exceptions: readonly ExceptionDeclaration[];
|
|
19
20
|
readonly file: string;
|
|
20
21
|
readonly nonEffectFolders: readonly string[];
|
|
22
|
+
readonly preCommit: PreCommit;
|
|
21
23
|
readonly registry: string;
|
|
22
24
|
readonly root: string;
|
|
23
25
|
}
|
|
@@ -40,6 +42,7 @@ function resolved(root: string, file: string, config: ConfigInput, rules: Resolv
|
|
|
40
42
|
extensions: config.extensions ?? DEFAULT_EXTENSIONS,
|
|
41
43
|
file,
|
|
42
44
|
nonEffectFolders: config.nonEffectFolders ?? [],
|
|
45
|
+
preCommit: config.preCommit ?? "full",
|
|
43
46
|
registry: config.registry ?? "quality/registry.json",
|
|
44
47
|
root,
|
|
45
48
|
sources: config.sources ?? ["."],
|
package/src/config/resolve.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { Effect } from "effect";
|
|
|
2
2
|
import { configureRegistered } from "#adapters/rule.ts";
|
|
3
3
|
import type { ConfigInput } from "#config/decode.ts";
|
|
4
4
|
import type { Decoded } from "#decoded.ts";
|
|
5
|
-
import type { ActiveRule } from "#engine/
|
|
5
|
+
import type { ActiveRule } from "#engine/runRule.ts";
|
|
6
6
|
import type { RuleIndex } from "#engine/violation.ts";
|
|
7
|
-
import type { RegisteredRule } from "#rule.ts";
|
|
7
|
+
import type { Configured, RegisteredRule } from "#rule.ts";
|
|
8
8
|
import { builtInRules } from "#rules/builtIn.ts";
|
|
9
9
|
|
|
10
10
|
export interface ResolvedRules extends RuleIndex {
|
|
@@ -27,13 +27,17 @@ function duplicateIssues(rules: readonly RegisteredRule[]): readonly string[] {
|
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function activeRule(rule: RegisteredRule,
|
|
30
|
+
function activeRule(rule: RegisteredRule, configured: Extract<Configured, { readonly _tag: "Ready" }>): ActiveRule {
|
|
31
|
+
const { halves } = configured;
|
|
31
32
|
return {
|
|
32
|
-
check,
|
|
33
|
+
check: halves?.fast ?? configured.check,
|
|
34
|
+
...(halves === undefined ? {} : { deepHalf: { check: halves.deep, name: halves.name } }),
|
|
35
|
+
depth: rule.depth ?? "fast",
|
|
33
36
|
description: rule.description,
|
|
34
37
|
family: rule.family === true,
|
|
35
38
|
id: rule.id,
|
|
36
39
|
level: "error",
|
|
40
|
+
...(rule.needs === undefined ? {} : { needs: rule.needs }),
|
|
37
41
|
registrable: rule.registrable !== false,
|
|
38
42
|
};
|
|
39
43
|
}
|
|
@@ -47,7 +51,7 @@ function activate(rule: RegisteredRule, setting: Setting | undefined): Effect.Ef
|
|
|
47
51
|
? { _tag: "Invalid", issues: configured.issues.map((issue) => `rules.${rule.id}.options: ${issue}`) }
|
|
48
52
|
: {
|
|
49
53
|
_tag: "Valid",
|
|
50
|
-
value: activeRule(rule, configured
|
|
54
|
+
value: activeRule(rule, configured),
|
|
51
55
|
},
|
|
52
56
|
}),
|
|
53
57
|
);
|
|
@@ -71,5 +75,6 @@ export const resolveRules = Effect.fn("Config.resolveRules")(function* (config:
|
|
|
71
75
|
const active = activated.flatMap((result) => (result._tag === "Valid" ? [result.value] : []));
|
|
72
76
|
const levels = new Map(rules.map((rule) => [rule.id, "error" as const]));
|
|
73
77
|
const unregistrable = new Set(rules.filter((rule) => rule.registrable === false).map((rule) => rule.id));
|
|
74
|
-
|
|
78
|
+
const split = new Set(active.filter((rule) => rule.deepHalf !== undefined).map((rule) => rule.id));
|
|
79
|
+
return { _tag: "Valid", value: { active, families, levels, skipped: new Set(), skippedHalves: new Set(), split, unregistrable } };
|
|
75
80
|
});
|
package/src/config.ts
CHANGED
|
@@ -4,6 +4,8 @@ import type { builtInRules } from "#rules/builtIn.ts";
|
|
|
4
4
|
|
|
5
5
|
export type Level = "error";
|
|
6
6
|
|
|
7
|
+
export type PreCommit = "full" | "staged";
|
|
8
|
+
|
|
7
9
|
export type RuleSetting<TInput> = "error" | { readonly level?: "error"; readonly options?: TInput };
|
|
8
10
|
|
|
9
11
|
type InputOf<TCandidate> = TCandidate extends Rule<string, infer TInput, unknown> ? TInput : unknown;
|
|
@@ -21,6 +23,7 @@ export interface QualityConfig<TLocal extends readonly RegisteredRule<unknown>[]
|
|
|
21
23
|
readonly extensions?: readonly string[];
|
|
22
24
|
readonly local?: TLocal;
|
|
23
25
|
readonly nonEffectFolders?: readonly string[];
|
|
26
|
+
readonly preCommit?: PreCommit;
|
|
24
27
|
readonly registry?: string;
|
|
25
28
|
readonly rules?: RuleSettings<readonly [...BuiltInRules, ...TLocal]>;
|
|
26
29
|
readonly sources?: readonly string[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Context, Effect } from "effect";
|
|
2
|
+
|
|
3
|
+
// A child-process check runs this once its child is running, so the run starts the in-process rules only after their synchronous work can no longer delay the child's start.
|
|
4
|
+
export const ChildStarted = Context.Reference<Effect.Effect<void>>("@shivaedev/quality/ChildStarted", { defaultValue: () => Effect.void });
|
|
5
|
+
|
|
6
|
+
export const childStarted = Effect.fn("Engine.childStarted")(function* () {
|
|
7
|
+
yield* yield* ChildStarted;
|
|
8
|
+
});
|
package/src/engine/evaluate.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { applyBaseline, type Regression, type StaleBaselineEntry } from "#baseline/compare.ts";
|
|
1
|
+
import { applyBaseline, type Regression, type StaleBaselineEntry, unsplitEntries } from "#baseline/compare.ts";
|
|
2
2
|
import type { BaselineEntry } from "#baseline/format.ts";
|
|
3
3
|
import { byLocation, type RuleIndex, type Violation } from "#engine/violation.ts";
|
|
4
4
|
import { applyRegistry, type RegistryEntry, type StaleRegistryEntry } from "#exceptions/registry.ts";
|
|
@@ -11,6 +11,7 @@ export interface Outcome {
|
|
|
11
11
|
readonly regressions: readonly Regression[];
|
|
12
12
|
readonly staleBaseline: readonly StaleBaselineEntry[];
|
|
13
13
|
readonly staleRegistry: readonly StaleRegistryEntry[];
|
|
14
|
+
readonly unsplitBaseline: readonly StaleBaselineEntry[];
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export function evaluate(
|
|
@@ -30,6 +31,7 @@ export function evaluate(
|
|
|
30
31
|
regressions: baselined.regressions,
|
|
31
32
|
staleBaseline: baselined.stale,
|
|
32
33
|
staleRegistry: registered.stale,
|
|
34
|
+
unsplitBaseline: unsplitEntries(baseline, rules),
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { basename, isAbsolute, relative } from "node:path";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { ManifestFailure } from "#adapters/manifestInventory.ts";
|
|
4
|
+
import { inNonEffectFolder } from "#config/nonEffectFolders.ts";
|
|
5
|
+
import type { ActiveLevel, Violation } from "#engine/violation.ts";
|
|
6
|
+
import { SetupFailure } from "#failure.ts";
|
|
7
|
+
import { FilesystemFailure } from "#inventory/filesystem.ts";
|
|
8
|
+
import { posix } from "#inventory/ignoreScope.ts";
|
|
9
|
+
import type { Finding, Need, RuleCheck, RuleInputs, RuleServices } from "#rule.ts";
|
|
10
|
+
|
|
11
|
+
export interface ActiveRule {
|
|
12
|
+
readonly check: RuleCheck;
|
|
13
|
+
readonly deepHalf?: { readonly check: RuleCheck; readonly name: string };
|
|
14
|
+
readonly depth: "deep" | "fast";
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly family: boolean;
|
|
17
|
+
readonly half?: "deep";
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly level: ActiveLevel;
|
|
20
|
+
readonly needs?: Need;
|
|
21
|
+
readonly registrable?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function messageOf(cause: unknown): string {
|
|
25
|
+
return cause instanceof Error ? cause.message : String(cause);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Registry and baseline entries match on the path, so every finding names its file the same way.
|
|
29
|
+
function repositoryPath(root: string, file: string): string {
|
|
30
|
+
return posix(isAbsolute(file) ? relative(root, file) : file).replace(/^(?:\.\/)+/u, "");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function exceptionHint(rule: ActiveRule, finding: Finding, file: string, config: string): string {
|
|
34
|
+
const id = rule.family && finding.subject !== undefined ? `${rule.id}/${finding.subject}` : rule.id;
|
|
35
|
+
const biome = /^biome\/(?:lint|assist)\/[a-zA-Z]+\/[a-zA-Z]+$/u.test(id);
|
|
36
|
+
if (!biome && rule.registrable === false) {
|
|
37
|
+
return "";
|
|
38
|
+
}
|
|
39
|
+
const shape = JSON.stringify({
|
|
40
|
+
files: [file],
|
|
41
|
+
reason: "Explain why this exception is permanent.",
|
|
42
|
+
rules: [id],
|
|
43
|
+
...(!rule.family && finding.subject !== undefined ? { subject: finding.subject } : {}),
|
|
44
|
+
});
|
|
45
|
+
return ` For a permanent exception, add to exceptions in ${config}: ${shape}.`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function violationOf(rule: ActiveRule, root: string, finding: Finding, exceptionFile: string): Violation {
|
|
49
|
+
return {
|
|
50
|
+
...finding,
|
|
51
|
+
...(rule.half === "deep" ? { deep: true } : {}),
|
|
52
|
+
file: repositoryPath(root, finding.file),
|
|
53
|
+
level: rule.level,
|
|
54
|
+
message: finding.message + exceptionHint(rule, finding, repositoryPath(root, finding.file), exceptionFile),
|
|
55
|
+
rule: rule.family && finding.subject !== undefined ? `${rule.id}/${finding.subject}` : rule.id,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function expectedFailure(rule: ActiveRule, root: string, cause: unknown): readonly Violation[] | undefined {
|
|
60
|
+
if (cause instanceof ManifestFailure || cause instanceof FilesystemFailure) {
|
|
61
|
+
const manifest = cause instanceof ManifestFailure || basename(cause.path) === "package.json";
|
|
62
|
+
return [
|
|
63
|
+
{
|
|
64
|
+
file: repositoryPath(root, cause.path),
|
|
65
|
+
level: rule.level,
|
|
66
|
+
message: cause.message,
|
|
67
|
+
rule: manifest ? "manifests/valid" : rule.id,
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function runRule(
|
|
75
|
+
rule: ActiveRule,
|
|
76
|
+
inputs: RuleInputs,
|
|
77
|
+
exceptionFile: string,
|
|
78
|
+
): Effect.Effect<readonly Violation[], SetupFailure, RuleServices> {
|
|
79
|
+
return Effect.suspend(() => rule.check(inputs)).pipe(
|
|
80
|
+
Effect.map((findings) =>
|
|
81
|
+
findings
|
|
82
|
+
.filter(
|
|
83
|
+
(finding) =>
|
|
84
|
+
!(rule.id.startsWith("effect/") && inNonEffectFolder(repositoryPath(inputs.root, finding.file), inputs.nonEffectFolders ?? [])),
|
|
85
|
+
)
|
|
86
|
+
.map((finding) => violationOf(rule, inputs.root, finding, exceptionFile)),
|
|
87
|
+
),
|
|
88
|
+
Effect.catch((cause) => {
|
|
89
|
+
const findings = expectedFailure(rule, inputs.root, cause);
|
|
90
|
+
if (findings !== undefined) {
|
|
91
|
+
return Effect.succeed(findings);
|
|
92
|
+
}
|
|
93
|
+
if (cause instanceof SetupFailure) {
|
|
94
|
+
return Effect.fail(new SetupFailure({ cause, message: `rule ${rule.id} failed: ${cause.message}` }));
|
|
95
|
+
}
|
|
96
|
+
return Effect.die(cause);
|
|
97
|
+
}),
|
|
98
|
+
Effect.catchDefect((cause) => {
|
|
99
|
+
const findings = expectedFailure(rule, inputs.root, cause);
|
|
100
|
+
return findings === undefined ? Effect.die(new Error(`rule ${rule.id} failed: ${messageOf(cause)}`, { cause })) : Effect.succeed(findings);
|
|
101
|
+
}),
|
|
102
|
+
);
|
|
103
|
+
}
|