@shivaedev/quality 0.60.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +36 -15
- package/dist/adapters/biome/relocateConfig.d.ts +1 -1
- package/dist/adapters/biome/relocateConfig.d.ts.map +1 -1
- package/dist/adapters/biome/relocateConfig.js +6 -5
- package/dist/adapters/biome/relocateConfig.js.map +1 -1
- package/dist/adapters/biome/run.d.ts +1 -1
- package/dist/adapters/biome/run.d.ts.map +1 -1
- package/dist/adapters/biome/run.js +2 -2
- package/dist/adapters/biome/run.js.map +1 -1
- package/dist/adapters/biome/withExceptionConfig.d.ts +1 -1
- package/dist/adapters/biome/withExceptionConfig.d.ts.map +1 -1
- package/dist/adapters/biome/withExceptionConfig.js +3 -3
- package/dist/adapters/biome/withExceptionConfig.js.map +1 -1
- package/dist/biome/nonEffectPlugins.d.ts +7 -0
- package/dist/biome/nonEffectPlugins.d.ts.map +1 -0
- package/dist/biome/nonEffectPlugins.js +24 -0
- package/dist/biome/nonEffectPlugins.js.map +1 -0
- package/dist/biome/report.d.ts +1 -1
- package/dist/biome/report.d.ts.map +1 -1
- package/dist/biome/report.js +5 -5
- package/dist/biome/report.js.map +1 -1
- package/dist/cli/baseline.d.ts.map +1 -1
- package/dist/cli/baseline.js +0 -6
- package/dist/cli/baseline.js.map +1 -1
- package/dist/cli/fix.d.ts.map +1 -1
- package/dist/cli/fix.js +7 -7
- package/dist/cli/fix.js.map +1 -1
- package/dist/cli/messages.d.ts +1 -1
- package/dist/cli/messages.d.ts.map +1 -1
- package/dist/cli/messages.js +1 -1
- package/dist/config/decode.d.ts +1 -0
- package/dist/config/decode.d.ts.map +1 -1
- package/dist/config/decode.js +2 -0
- package/dist/config/decode.js.map +1 -1
- package/dist/config/load.d.ts +1 -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/nonEffectFolders.d.ts +5 -0
- package/dist/config/nonEffectFolders.d.ts.map +1 -0
- package/dist/config/nonEffectFolders.js +17 -0
- package/dist/config/nonEffectFolders.js.map +1 -0
- package/dist/config/resolve.d.ts +1 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/engine/runRules.d.ts.map +1 -1
- package/dist/engine/runRules.js +4 -1
- package/dist/engine/runRules.js.map +1 -1
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/session.js +1 -0
- package/dist/engine/session.js.map +1 -1
- package/dist/rule.d.ts +1 -0
- package/dist/rule.d.ts.map +1 -1
- package/dist/rule.js.map +1 -1
- package/dist/rules/biome.js +2 -2
- package/dist/rules/biome.js.map +1 -1
- package/dist/rules/effect/boundary.js +1 -1
- package/dist/rules/effect/boundary.js.map +1 -1
- package/dist/rules/effect/serviceParameters.js +1 -1
- package/dist/rules/effect/serviceParameters.js.map +1 -1
- package/dist/rules/stories/sources.d.ts +1 -0
- package/dist/rules/stories/sources.d.ts.map +1 -1
- package/dist/rules/stories/sources.js +17 -0
- package/dist/rules/stories/sources.js.map +1 -1
- package/dist/rules/stories/waitOnEvents.d.ts.map +1 -1
- package/dist/rules/stories/waitOnEvents.js +74 -10
- package/dist/rules/stories/waitOnEvents.js.map +1 -1
- package/dist/testing/ruleStory.d.ts +1 -0
- package/dist/testing/ruleStory.d.ts.map +1 -1
- package/dist/testing/ruleStory.js +4 -0
- package/dist/testing/ruleStory.js.map +1 -1
- package/docs/debt-and-hooks.md +1 -1
- package/package.json +3 -3
- package/src/adapters/biome/relocateConfig.ts +6 -4
- package/src/adapters/biome/run.ts +17 -12
- package/src/adapters/biome/withExceptionConfig.ts +3 -2
- package/src/biome/nonEffectPlugins.ts +27 -0
- package/src/biome/report.ts +5 -3
- package/src/cli/baseline.ts +0 -6
- package/src/cli/fix.ts +13 -5
- package/src/cli/messages.ts +1 -1
- package/src/config/decode.ts +2 -0
- package/src/config/load.ts +2 -0
- package/src/config/nonEffectFolders.ts +26 -0
- package/src/config.ts +1 -0
- package/src/engine/runRules.ts +9 -1
- package/src/engine/session.ts +1 -0
- package/src/rule.ts +1 -0
- package/src/rules/biome.ts +2 -2
- package/src/rules/effect/boundary.ts +1 -1
- package/src/rules/effect/serviceParameters.ts +1 -1
- package/src/rules/stories/sources.ts +18 -0
- package/src/rules/stories/waitOnEvents.ts +89 -10
- package/src/testing/ruleStory.ts +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ruleStory.d.ts","sourceRoot":"","sources":["../../src/testing/ruleStory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAIlD,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,KAAK,GAAG,EAAc,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEvE,UAAU,UAAU;IACnB,MAAM,EAAE,GAAG,GAAG,SAAS,CAAC;IACxB,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAgBD,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEnD;AA6BD,wBAAgB,aAAa;YAcqB,MAAM
|
|
1
|
+
{"version":3,"file":"ruleStory.d.ts","sourceRoot":"","sources":["../../src/testing/ruleStory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAIlD,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,KAAK,GAAG,EAAc,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEvE,UAAU,UAAU;IACnB,MAAM,EAAE,GAAG,GAAG,SAAS,CAAC;IACxB,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAgBD,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEnD;AA6BD,wBAAgB,aAAa;YAcqB,MAAM;;;;;0BAkB/B,MAAM;;;;;uBAoBT,SAAS,QAAQ,EAAE;;;uCAOP,SAAS,QAAQ,EAAE;qCAIrB,MAAM,UAAU,MAAM;EAqBrD"}
|
|
@@ -75,6 +75,10 @@ export function makeRuleStory() {
|
|
|
75
75
|
}),
|
|
76
76
|
gateOutcome: () => Effect.map(answered(engine), outcomeOf),
|
|
77
77
|
gateReport: () => Effect.map(answered(engine), (answer) => answer.stdout + answer.stderr),
|
|
78
|
+
gateReports: (prefix) => Effect.map(answered(engine), (answer) => answer.stdout
|
|
79
|
+
.split("\n\n")
|
|
80
|
+
.filter((section) => section.startsWith(`error ${prefix}`))
|
|
81
|
+
.join("\n\n")),
|
|
78
82
|
locations: () => Effect.map(checked(engine), (findings) => findings.map(locationOf)),
|
|
79
83
|
messages: () => Effect.map(checked(engine), (findings) => findings.map((finding) => finding.message)),
|
|
80
84
|
optionIssues: Effect.fn("RuleStory.optionIssues")(function* (rule, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ruleStory.js","sourceRoot":"","sources":["../../src/testing/ruleStory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC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AAC,iCAAiC,EAAE,WAAW,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,OAAO,GAIT,EAAE,GAAG,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;IACvE,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
package/docs/debt-and-hooks.md
CHANGED
|
@@ -4,7 +4,7 @@ The [README](../README.md) introduces the gate. This page explains how the basel
|
|
|
4
4
|
|
|
5
5
|
## Baseline
|
|
6
6
|
|
|
7
|
-
For a shared policy upgrade, `quality baseline write --first-adoption --rule <id
|
|
7
|
+
`quality baseline write --first-adoption` records existing findings of every rule when there is no baseline, including rules that permit config exceptions and findings in unchanged files. For a shared policy upgrade with an existing baseline, name the rules with `quality baseline write --first-adoption --rule <id>`; every rule is eligible, and unrelated entries remain unchanged. An existing baseline refuses an unnamed write, including with `--first-adoption`. Ordinary later writes still require named rules and changed file selections. Review each new or raised entry and state why that debt needs a separate migration.
|
|
8
8
|
|
|
9
9
|
```jsonl
|
|
10
10
|
{"path":"src/legacy/sync.ts","rule":"comments/no-jsdoc","count":3}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/quality",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"description": "Repository quality gate with typed rules, a baseline of existing debt and a registry of reasoned exceptions",
|
|
5
5
|
"homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/quality#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@effect/platform-node-shared": "4.0.6",
|
|
66
66
|
"@effect/vitest": "4.0.6",
|
|
67
67
|
"@shivaedev/test": "0.15.0",
|
|
68
|
-
"@shivaedev/test-story": "0.
|
|
68
|
+
"@shivaedev/test-story": "0.39.0",
|
|
69
69
|
"@types/node": "24.19.2",
|
|
70
70
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
71
71
|
"effect": "4.0.6",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@effect/platform-node": "4.0.6",
|
|
76
76
|
"@effect/platform-node-shared": "4.0.6",
|
|
77
|
-
"@shivaedev/test-story": "0.
|
|
77
|
+
"@shivaedev/test-story": "0.39.0",
|
|
78
78
|
"effect": "4.0.6",
|
|
79
79
|
"vitest": "5.0.5"
|
|
80
80
|
},
|
|
@@ -2,6 +2,7 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import { dirname, resolve } from "node:path";
|
|
3
3
|
import { Effect, FileSystem, type PlatformError, Schema, type Scope } from "effect";
|
|
4
4
|
import ts from "typescript";
|
|
5
|
+
import { nonEffectPlugins } from "#biome/nonEffectPlugins.ts";
|
|
5
6
|
|
|
6
7
|
const ObjectConfig = Schema.Record(Schema.String, Schema.Unknown);
|
|
7
8
|
|
|
@@ -17,6 +18,7 @@ const writeConfig = Effect.fn("Biome.writeConfig")(function* (
|
|
|
17
18
|
original: string,
|
|
18
19
|
config: Readonly<Record<string, unknown>>,
|
|
19
20
|
paths: Map<string, string>,
|
|
21
|
+
nonEffectFolders: readonly string[],
|
|
20
22
|
): Effect.fn.Return<string, PlatformError.PlatformError | Schema.SchemaError, FileSystem.FileSystem | Scope.Scope> {
|
|
21
23
|
const existing = paths.get(original);
|
|
22
24
|
if (existing !== undefined) {
|
|
@@ -30,7 +32,7 @@ const writeConfig = Effect.fn("Biome.writeConfig")(function* (
|
|
|
30
32
|
for (const specifier of Array.isArray(config.extends) ? config.extends : []) {
|
|
31
33
|
const source = specifier.startsWith(".") ? resolve(dirname(original), specifier) : require.resolve(specifier);
|
|
32
34
|
const inherited = yield* parseConfig(source, yield* fs.readFileString(source));
|
|
33
|
-
extended.push(yield* writeConfig(root, source, inherited, paths));
|
|
35
|
+
extended.push(yield* writeConfig(root, source, inherited, paths, nonEffectFolders));
|
|
34
36
|
}
|
|
35
37
|
const vcs = config.vcs ?? {};
|
|
36
38
|
const generated = {
|
|
@@ -38,7 +40,7 @@ const writeConfig = Effect.fn("Biome.writeConfig")(function* (
|
|
|
38
40
|
...(Array.isArray(config.extends) ? { extends: extended } : {}),
|
|
39
41
|
...(Array.isArray(config.plugins)
|
|
40
42
|
? {
|
|
41
|
-
plugins: config.plugins.map((plugin) =>
|
|
43
|
+
plugins: nonEffectPlugins(config.plugins, nonEffectFolders).map((plugin) =>
|
|
42
44
|
typeof plugin === "string" ? resolve(root, plugin) : { ...plugin, path: resolve(root, plugin.path) },
|
|
43
45
|
),
|
|
44
46
|
}
|
|
@@ -54,6 +56,6 @@ const writeConfig = Effect.fn("Biome.writeConfig")(function* (
|
|
|
54
56
|
return path;
|
|
55
57
|
});
|
|
56
58
|
|
|
57
|
-
export function relocateConfig(root: string, original: string, config: Readonly<Record<string, unknown
|
|
58
|
-
return writeConfig(root, original, config, new Map());
|
|
59
|
+
export function relocateConfig(root: string, original: string, config: Readonly<Record<string, unknown>>, nonEffectFolders: readonly string[] = []) {
|
|
60
|
+
return writeConfig(root, original, config, new Map(), nonEffectFolders);
|
|
59
61
|
}
|
|
@@ -18,6 +18,7 @@ export const runBiome = Effect.fn("Biome.runBiome")(function* (
|
|
|
18
18
|
root: string,
|
|
19
19
|
args: readonly string[],
|
|
20
20
|
exceptions: readonly ExceptionDeclaration[] = [],
|
|
21
|
+
nonEffectFolders: readonly string[] = [],
|
|
21
22
|
) {
|
|
22
23
|
const files = yield* shadcnFiles(root);
|
|
23
24
|
const toolOwned: readonly ExceptionDeclaration[] = [
|
|
@@ -28,18 +29,22 @@ export const runBiome = Effect.fn("Biome.runBiome")(function* (
|
|
|
28
29
|
},
|
|
29
30
|
];
|
|
30
31
|
return yield* Effect.scoped(
|
|
31
|
-
withExceptionConfig(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
withExceptionConfig(
|
|
33
|
+
root,
|
|
34
|
+
[...exceptions, ...toolOwned],
|
|
35
|
+
(configArgs) =>
|
|
36
|
+
Effect.gen(function* () {
|
|
37
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
38
|
+
const child = yield* spawner.spawn(
|
|
39
|
+
ChildProcess.make(process.execPath, [BIN, ...args, ...configArgs, "--colors=off"], { cwd: root, stdin: "ignore" }),
|
|
40
|
+
);
|
|
41
|
+
const [stdout, stderr, code] = yield* Effect.all(
|
|
42
|
+
[Stream.mkString(Stream.decodeText(child.stdout)), Stream.mkString(Stream.decodeText(child.stderr)), child.exitCode],
|
|
43
|
+
{ concurrency: "unbounded" },
|
|
44
|
+
);
|
|
45
|
+
return { code: Number(code), stderr, stdout };
|
|
46
|
+
}),
|
|
47
|
+
nonEffectFolders,
|
|
43
48
|
),
|
|
44
49
|
);
|
|
45
50
|
});
|
|
@@ -9,9 +9,10 @@ export const withExceptionConfig = Effect.fn("Biome.withExceptionConfig")(functi
|
|
|
9
9
|
root: string,
|
|
10
10
|
declarations: readonly ExceptionDeclaration[],
|
|
11
11
|
run: (args: readonly string[]) => Effect.Effect<TValue, TError, TRequirements>,
|
|
12
|
+
nonEffectFolders: readonly string[] = [],
|
|
12
13
|
) {
|
|
13
14
|
const { includes, overrides } = exceptionConfig(declarations);
|
|
14
|
-
if (includes.length === 0 && overrides.length === 0) {
|
|
15
|
+
if (includes.length === 0 && overrides.length === 0 && nonEffectFolders.length === 0) {
|
|
15
16
|
return yield* run([]);
|
|
16
17
|
}
|
|
17
18
|
const { config, text } = yield* Effect.gen(function* () {
|
|
@@ -40,6 +41,6 @@ export const withExceptionConfig = Effect.fn("Biome.withExceptionConfig")(functi
|
|
|
40
41
|
files: { ...files, includes: [...previousIncludes, ...includes.filter((pattern) => pattern !== "**"), "!.worktrees", "!.quality-biome-*"] },
|
|
41
42
|
overrides: [...previousOverrides, ...overrides],
|
|
42
43
|
};
|
|
43
|
-
const path = yield* relocateConfig(root, join(root, config), generated);
|
|
44
|
+
const path = yield* relocateConfig(root, join(root, config), generated, nonEffectFolders);
|
|
44
45
|
return yield* run([`--config-path=${path}`]);
|
|
45
46
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { nonEffectFolderPath } from "#config/nonEffectFolders.ts";
|
|
2
|
+
|
|
3
|
+
const EFFECT_PLUGINS: ReadonlySet<string> = new Set([
|
|
4
|
+
"ambient-runtime.grit",
|
|
5
|
+
"effect-fn-spans.grit",
|
|
6
|
+
"effect-fn-functions.grit",
|
|
7
|
+
"effect-test-bodies.grit",
|
|
8
|
+
"schema-names.grit",
|
|
9
|
+
"schema-struct-keys.grit",
|
|
10
|
+
"service-layers.grit",
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
type Plugin = string | { readonly path: string; readonly includes?: readonly string[] };
|
|
14
|
+
|
|
15
|
+
export function nonEffectPlugins(plugins: readonly Plugin[], folders: readonly string[]) {
|
|
16
|
+
return plugins.map((plugin) => {
|
|
17
|
+
const path = typeof plugin === "string" ? plugin : plugin.path;
|
|
18
|
+
if (!EFFECT_PLUGINS.has(path.replaceAll("\\", "/").split("/").at(-1) ?? "") || folders.length === 0) {
|
|
19
|
+
return plugin;
|
|
20
|
+
}
|
|
21
|
+
const includes = typeof plugin === "string" ? ["**"] : (plugin.includes ?? ["**"]);
|
|
22
|
+
return {
|
|
23
|
+
...(typeof plugin === "string" ? { path } : plugin),
|
|
24
|
+
includes: [...includes, ...folders.map((folder) => `!${nonEffectFolderPath(folder)}/**`)],
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
}
|
package/src/biome/report.ts
CHANGED
|
@@ -41,9 +41,10 @@ const reportFor = Effect.fn("Biome.reportFor")(function* (
|
|
|
41
41
|
args: readonly string[],
|
|
42
42
|
paths: readonly string[],
|
|
43
43
|
exceptions: readonly ExceptionDeclaration[],
|
|
44
|
+
nonEffectFolders: readonly string[],
|
|
44
45
|
) {
|
|
45
46
|
const command = [...args, "--reporter=json", "--max-diagnostics=none", ...paths];
|
|
46
|
-
const run = yield* runBiome(root, command, exceptions);
|
|
47
|
+
const run = yield* runBiome(root, command, exceptions, nonEffectFolders);
|
|
47
48
|
const report = decodeReport(run.stdout.trim());
|
|
48
49
|
if (report._tag === "None") {
|
|
49
50
|
return yield* Effect.fail(failure(command, run, "a report", [run.stdout, run.stderr].join("\n")));
|
|
@@ -64,10 +65,11 @@ export const biomeReport = Effect.fn("Biome.biomeReport")(function* (
|
|
|
64
65
|
args: readonly string[],
|
|
65
66
|
exceptions: readonly ExceptionDeclaration[] = [],
|
|
66
67
|
files: readonly string[] = ["."],
|
|
68
|
+
nonEffectFolders: readonly string[] = [],
|
|
67
69
|
) {
|
|
68
70
|
const { relative, sep } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
|
|
69
71
|
|
|
70
|
-
const [report, tracked] = yield* Effect.all([reportFor(root, args, files, exceptions), ignoredTrackedPaths(root)], {
|
|
72
|
+
const [report, tracked] = yield* Effect.all([reportFor(root, args, files, exceptions, nonEffectFolders), ignoredTrackedPaths(root)], {
|
|
71
73
|
concurrency: "unbounded",
|
|
72
74
|
});
|
|
73
75
|
const paths = tracked
|
|
@@ -75,7 +77,7 @@ export const biomeReport = Effect.fn("Biome.biomeReport")(function* (
|
|
|
75
77
|
.filter((path) => files.includes(".") || files.includes(path))
|
|
76
78
|
.filter((path) => !path.split(sep).some((part) => part === ".git" || part === ".worktrees" || part === "node_modules"));
|
|
77
79
|
const extraArgs = [...args, "--vcs-enabled=false", ...(args.includes("--no-errors-on-unmatched") ? [] : ["--no-errors-on-unmatched"])];
|
|
78
|
-
const extra = paths.length === 0 ? undefined : yield* reportFor(root, extraArgs, paths, exceptions);
|
|
80
|
+
const extra = paths.length === 0 ? undefined : yield* reportFor(root, extraArgs, paths, exceptions, nonEffectFolders);
|
|
79
81
|
const diagnostics = [...report.diagnostics, ...(extra?.diagnostics ?? [])];
|
|
80
82
|
const unique = [...new Map(diagnostics.map((diagnostic) => [JSON.stringify(diagnostic), diagnostic])).values()];
|
|
81
83
|
return {
|
package/src/cli/baseline.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { BaselineEntry } from "#baseline/format.ts";
|
|
|
4
4
|
import { saveShards } from "#baseline/shards.ts";
|
|
5
5
|
import { adopt, type Pruned, prune, type Scope } from "#baseline/update.ts";
|
|
6
6
|
import { openSession, type Session } from "#engine/session.ts";
|
|
7
|
-
import { registrable } from "#engine/violation.ts";
|
|
8
7
|
import { applyRegistry } from "#exceptions/registry.ts";
|
|
9
8
|
import { SetupFailure } from "#failure.ts";
|
|
10
9
|
import { changesSince } from "#git/history.ts";
|
|
@@ -30,11 +29,6 @@ export const writeBaseline = Effect.fn("Cli.writeBaseline")(function* (
|
|
|
30
29
|
|
|
31
30
|
const session = yield* openSession(cwd, config);
|
|
32
31
|
const existing = session.baseline.files.size === 0 ? undefined : session.baseline.entries;
|
|
33
|
-
if (firstAdoption && (rules.length === 0 || rules.some((rule) => registrable(session.config, rule)))) {
|
|
34
|
-
return yield* new SetupFailure({
|
|
35
|
-
message: "baseline write refused: --first-adoption requires explicit --rule ids that refuse config exceptions.",
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
32
|
if (existing !== undefined && files.length === 0 && !firstAdoption) {
|
|
39
33
|
return yield* new SetupFailure({
|
|
40
34
|
message: "baseline write refused: a baseline exists. Record a rule with --rule <id> and --file <path>; use prune for moved or fixed debt.",
|
package/src/cli/fix.ts
CHANGED
|
@@ -45,14 +45,21 @@ function changedBy(
|
|
|
45
45
|
root: string,
|
|
46
46
|
args: readonly string[],
|
|
47
47
|
exceptions: readonly ExceptionDeclaration[],
|
|
48
|
+
nonEffectFolders: readonly string[],
|
|
48
49
|
): Effect.Effect<number, SetupFailure, RuleServices> {
|
|
49
50
|
return Effect.map(
|
|
50
|
-
biomeReport(root, args, exceptions
|
|
51
|
+
biomeReport(root, args, exceptions, ["."], nonEffectFolders).pipe(
|
|
52
|
+
Effect.mapError((cause) => new SetupFailure({ cause, message: cause.message })),
|
|
53
|
+
),
|
|
51
54
|
(report) => report.summary.changed,
|
|
52
55
|
);
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
function biomePasses(
|
|
58
|
+
function biomePasses(
|
|
59
|
+
root: string,
|
|
60
|
+
exceptions: readonly ExceptionDeclaration[],
|
|
61
|
+
nonEffectFolders: readonly string[],
|
|
62
|
+
): readonly Pass<SetupFailure, RuleServices>[] {
|
|
56
63
|
return [
|
|
57
64
|
{
|
|
58
65
|
label: "with fixes",
|
|
@@ -60,9 +67,10 @@ function biomePasses(root: string, exceptions: readonly ExceptionDeclaration[]):
|
|
|
60
67
|
root,
|
|
61
68
|
["check", "--write", "--unsafe", "--skip=assist/source/useSortedKeys", "--skip=lint/suspicious/noDuplicateObjectKeys"],
|
|
62
69
|
exceptions,
|
|
70
|
+
nonEffectFolders,
|
|
63
71
|
),
|
|
64
72
|
},
|
|
65
|
-
{ label: "with the format pass", run: changedBy(root, ["format", "--write"], exceptions) },
|
|
73
|
+
{ label: "with the format pass", run: changedBy(root, ["format", "--write"], exceptions, nonEffectFolders) },
|
|
66
74
|
];
|
|
67
75
|
}
|
|
68
76
|
|
|
@@ -124,8 +132,8 @@ export const settle = Effect.fn("Cli.settle")(function* <TFailure, TRequirements
|
|
|
124
132
|
});
|
|
125
133
|
|
|
126
134
|
export const fix = Effect.fn("Cli.fix")(function* (cwd: string, config: string | undefined): Effect.fn.Return<void, SetupFailure, RuleServices> {
|
|
127
|
-
const { root, exceptions } = yield* loadConfig(cwd, config);
|
|
135
|
+
const { root, exceptions, nonEffectFolders } = yield* loadConfig(cwd, config);
|
|
128
136
|
const sorted = yield* Effect.mapError(sortManifests(root), (failure) => new SetupFailure({ cause: failure, message: failure.message }));
|
|
129
137
|
yield* Console.log(`quality: sort-package-json rewrote ${plural(sorted, "manifest")}.`);
|
|
130
|
-
yield* settle({ passes: biomePasses(root, exceptions), snapshot: snapshotOf(root) });
|
|
138
|
+
yield* settle({ passes: biomePasses(root, exceptions, nonEffectFolders), snapshot: snapshotOf(root) });
|
|
131
139
|
});
|
package/src/cli/messages.ts
CHANGED
|
@@ -25,7 +25,7 @@ exceptions migrate Move legacy registry entries and Biome declarations into qual
|
|
|
25
25
|
baseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.
|
|
26
26
|
baseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.
|
|
27
27
|
baseline write Adopt initial debt once, or record named rules only for --file paths changed since HEAD. Stage new files first.
|
|
28
|
-
--first-adoption records
|
|
28
|
+
--first-adoption records any rule, including unchanged files. With an existing baseline, name explicit --rule ids.
|
|
29
29
|
baseline prune Drop fixed debt, lower entries to what is left and carry entries to files git saw move. Never adds or raises an entry.
|
|
30
30
|
baseline tighten Prune only the entries of files changed since HEAD, or with --staged, in the index.
|
|
31
31
|
baseline migrate Move a JSON or JSON Lines baseline (--from, quality/baseline.json by default) into root and package shards.
|
package/src/config/decode.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { ruleConfiguration } from "#adapters/rule.ts";
|
|
3
|
+
import { NonEffectFolders } from "#config/nonEffectFolders.ts";
|
|
3
4
|
import { type Decoded, decodeWith } from "#decoded.ts";
|
|
4
5
|
import { ExceptionDeclaration } from "#exceptions/declaration.ts";
|
|
5
6
|
import type { RegisteredRule } from "#rule.ts";
|
|
@@ -28,6 +29,7 @@ const ConfigInput = Schema.Struct({
|
|
|
28
29
|
exceptions: Schema.optionalKey(Schema.Array(ExceptionDeclaration)),
|
|
29
30
|
extensions: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
30
31
|
local: Schema.optionalKey(Schema.Array(LocalRule)),
|
|
32
|
+
nonEffectFolders: Schema.optionalKey(NonEffectFolders),
|
|
31
33
|
registry: Schema.optionalKey(Schema.String),
|
|
32
34
|
rules: Schema.optionalKey(Schema.Record(Schema.String, Setting)),
|
|
33
35
|
sources: Schema.optionalKey(Schema.Array(Schema.String)),
|
package/src/config/load.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface ResolvedConfig extends ResolvedRules, InventoryScope {
|
|
|
16
16
|
readonly biomeDeclarations: readonly Declaration[];
|
|
17
17
|
readonly exceptions: readonly ExceptionDeclaration[];
|
|
18
18
|
readonly file: string;
|
|
19
|
+
readonly nonEffectFolders: readonly string[];
|
|
19
20
|
readonly registry: string;
|
|
20
21
|
readonly root: string;
|
|
21
22
|
}
|
|
@@ -36,6 +37,7 @@ function resolved(root: string, file: string, config: ConfigInput, rules: Resolv
|
|
|
36
37
|
exclude: [],
|
|
37
38
|
extensions: config.extensions ?? DEFAULT_EXTENSIONS,
|
|
38
39
|
file,
|
|
40
|
+
nonEffectFolders: config.nonEffectFolders ?? [],
|
|
39
41
|
registry: config.registry ?? "quality/registry.json",
|
|
40
42
|
root,
|
|
41
43
|
sources: config.sources ?? ["."],
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
|
|
3
|
+
export function nonEffectFolderPath(folder: string): string {
|
|
4
|
+
return folder
|
|
5
|
+
.split("/")
|
|
6
|
+
.filter((part) => part !== "" && part !== ".")
|
|
7
|
+
.join("/");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Folder = Schema.NonEmptyString.check(
|
|
11
|
+
Schema.makeFilter(
|
|
12
|
+
(folder) =>
|
|
13
|
+
folder.trim().length > 0
|
|
14
|
+
&& !folder.startsWith("/")
|
|
15
|
+
&& !/[:*?![\]{}\\]/u.test(folder)
|
|
16
|
+
&& !folder.split("/").includes("..")
|
|
17
|
+
&& nonEffectFolderPath(folder) !== "",
|
|
18
|
+
{ message: "Name an explicit repository-relative folder, without parent traversal or glob patterns." },
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const NonEffectFolders = Schema.Array(Folder);
|
|
23
|
+
|
|
24
|
+
export function inNonEffectFolder(file: string, folders: readonly string[]): boolean {
|
|
25
|
+
return folders.some((folder) => file.startsWith(`${nonEffectFolderPath(folder)}/`));
|
|
26
|
+
}
|
package/src/config.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface QualityConfig<TLocal extends readonly RegisteredRule<unknown>[]
|
|
|
19
19
|
readonly exceptions?: readonly ExceptionDeclaration[];
|
|
20
20
|
readonly extensions?: readonly string[];
|
|
21
21
|
readonly local?: TLocal;
|
|
22
|
+
readonly nonEffectFolders?: readonly string[];
|
|
22
23
|
readonly registry?: string;
|
|
23
24
|
readonly rules?: RuleSettings<readonly [...BuiltInRules, ...TLocal]>;
|
|
24
25
|
readonly sources?: readonly string[];
|
package/src/engine/runRules.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { basename, isAbsolute, relative } from "node:path";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { ManifestFailure } from "#adapters/manifestInventory.ts";
|
|
4
|
+
import { inNonEffectFolder } from "#config/nonEffectFolders.ts";
|
|
4
5
|
import { SetupFailure } from "#failure.ts";
|
|
5
6
|
import { FilesystemFailure } from "#inventory/filesystem.ts";
|
|
6
7
|
import { posix } from "#inventory/ignoreScope.ts";
|
|
@@ -67,7 +68,14 @@ function expectedFailure(rule: ActiveRule, root: string, cause: unknown): readon
|
|
|
67
68
|
|
|
68
69
|
function runRule(rule: ActiveRule, inputs: RuleInputs, exceptionFile: string): Effect.Effect<readonly Violation[], SetupFailure, RuleServices> {
|
|
69
70
|
return Effect.suspend(() => rule.check(inputs)).pipe(
|
|
70
|
-
Effect.map((findings) =>
|
|
71
|
+
Effect.map((findings) =>
|
|
72
|
+
findings
|
|
73
|
+
.filter(
|
|
74
|
+
(finding) =>
|
|
75
|
+
!(rule.id.startsWith("effect/") && inNonEffectFolder(repositoryPath(inputs.root, finding.file), inputs.nonEffectFolders ?? [])),
|
|
76
|
+
)
|
|
77
|
+
.map((finding) => violationOf(rule, inputs.root, finding, exceptionFile)),
|
|
78
|
+
),
|
|
71
79
|
Effect.catch((cause) => {
|
|
72
80
|
const findings = expectedFailure(rule, inputs.root, cause);
|
|
73
81
|
if (findings !== undefined) {
|
package/src/engine/session.ts
CHANGED
|
@@ -40,6 +40,7 @@ export const scan = Effect.fn("Engine.scan")(function* (
|
|
|
40
40
|
configFile: relative(config.root, config.file),
|
|
41
41
|
exceptions: config.exceptions,
|
|
42
42
|
files: inventory.files,
|
|
43
|
+
nonEffectFolders: config.nonEffectFolders,
|
|
43
44
|
readText,
|
|
44
45
|
root: config.root,
|
|
45
46
|
sources: inventory.sources,
|
package/src/rule.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface RuleInputs {
|
|
|
25
25
|
readonly configFile?: string;
|
|
26
26
|
readonly exceptions?: readonly ExceptionDeclaration[];
|
|
27
27
|
readonly files: readonly string[];
|
|
28
|
+
readonly nonEffectFolders?: readonly string[];
|
|
28
29
|
readonly readText: (path: string) => Promise<string | undefined>;
|
|
29
30
|
readonly root: string;
|
|
30
31
|
readonly signal?: AbortSignal;
|
package/src/rules/biome.ts
CHANGED
|
@@ -26,9 +26,9 @@ const presetFinding = Effect.fn("Biome.presetFinding")(function* (inputs: Pick<R
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const bridge = defineRule({
|
|
29
|
-
check: ({ exceptions, readText, root }) =>
|
|
29
|
+
check: ({ exceptions, nonEffectFolders, readText, root }) =>
|
|
30
30
|
Effect.gen(function* () {
|
|
31
|
-
const [preset, report] = yield* Effect.all([presetFinding({ readText }), biomeReport(root, ["check"], exceptions)], {
|
|
31
|
+
const [preset, report] = yield* Effect.all([presetFinding({ readText }), biomeReport(root, ["check"], exceptions, ["."], nonEffectFolders)], {
|
|
32
32
|
concurrency: "unbounded",
|
|
33
33
|
});
|
|
34
34
|
const failing = report.diagnostics.filter((diagnostic) => FAILING.has(diagnostic.severity));
|
|
@@ -93,7 +93,7 @@ export const effectBoundary = defineRule({
|
|
|
93
93
|
return [...groups.values()].flatMap((sources) => checkBoundary({ ...inputs, sources }));
|
|
94
94
|
},
|
|
95
95
|
description:
|
|
96
|
-
"Use Effect instead of Promise syntax and parameters, synchronous Node IO, throwing helper calls or Effect.sync with throwing APIs. Runners belong at entry points (including main.tsx and entry.tsx), tool configs and tests.
|
|
96
|
+
"Use Effect instead of Promise syntax and parameters, synchronous Node IO, throwing helper calls or Effect.sync with throwing APIs. Runners belong at entry points (including main.tsx and entry.tsx), tool configs and tests. Within Effect code, adapters/ and test-support/ folders are exempt; calls to throwing helpers defined in adapters/ are accepted. Use Effect services and tagged errors; bridge outside libraries in adapters/. No config exceptions or inline suppressions; baseline existing debt.",
|
|
97
97
|
id: "effect/boundary",
|
|
98
98
|
registrable: false,
|
|
99
99
|
});
|
|
@@ -25,7 +25,7 @@ export const serviceParameters = defineRule({
|
|
|
25
25
|
return [...groups.values()].flatMap((sources) => checkServices({ ...inputs, sources }, names));
|
|
26
26
|
}),
|
|
27
27
|
description:
|
|
28
|
-
"Exported functions and public methods take services from Effect's environment, including aliases, constraints, inferred/destructured parameters and factory returns. Service keys/classes, non-empty Contexts and implementation shapes are services; Effect/Stream requirements are computations. Service implementation methods and Layer constructors are accepted.
|
|
28
|
+
"Exported functions and public methods take services from Effect's environment, including aliases, constraints, inferred/destructured parameters and factory returns. Service keys/classes, non-empty Contexts and implementation shapes are services; Effect/Stream requirements are computations. Service implementation methods and Layer constructors are accepted. Within Effect code, test-support/ folders are exempt. The fixed adapters/ convention bridges outside libraries to Effect values; adapters still follow this rule and ambient runtime bans. No config exceptions or inline suppressions; baseline existing debt.",
|
|
29
29
|
id: "effect/service-parameters",
|
|
30
30
|
registrable: false,
|
|
31
31
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import ts from "typescript";
|
|
3
|
+
import { outgoing } from "#imports/fences/reach.ts";
|
|
3
4
|
import { importGraph } from "#imports/graph.ts";
|
|
4
5
|
import { packageOf } from "#imports/workspace.ts";
|
|
5
6
|
import { isTestSupport, testName } from "#naming/testName.ts";
|
|
@@ -30,3 +31,20 @@ export const storySources = Effect.fn("Stories.storySources")(function* (inputs:
|
|
|
30
31
|
return source !== undefined && hasStory(source);
|
|
31
32
|
});
|
|
32
33
|
});
|
|
34
|
+
|
|
35
|
+
export const storyWaitSources = Effect.fn("Stories.storyWaitSources")(function* (inputs: RuleInputs) {
|
|
36
|
+
const stories = yield* storySources(inputs);
|
|
37
|
+
const graph = yield* importGraph(inputs);
|
|
38
|
+
const edges = outgoing(graph.edges.filter((edge) => edge.kind === "import" && !edge.type));
|
|
39
|
+
const reached = new Set(stories.map((file) => file.path));
|
|
40
|
+
const queue = [...reached];
|
|
41
|
+
for (const file of queue) {
|
|
42
|
+
for (const edge of edges.get(file) ?? []) {
|
|
43
|
+
if (edge.to.kind === "file" && !reached.has(edge.to.path)) {
|
|
44
|
+
reached.add(edge.to.path);
|
|
45
|
+
queue.push(edge.to.path);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return inputs.sources.filter((file) => stories.includes(file) || (isTestSupport(file.path) && reached.has(file.path)));
|
|
50
|
+
});
|