@rt-tools/agent-kit 0.24.0 → 0.27.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/assets/agents/business-analyst.md +51 -50
- package/assets/agents/cargo-writer.md +54 -0
- package/assets/agents/conscience.md +37 -35
- package/assets/agents/project-manager.md +49 -48
- package/assets/agents/prose-editor.md +31 -29
- package/assets/agents/qa-engineer.md +50 -48
- package/assets/agents/rules-reviewer.md +63 -58
- package/assets/agents/skill-curator.md +83 -78
- package/assets/agents/spec-critic.md +34 -29
- package/assets/agents/spec-writer.md +35 -32
- package/assets/agents/strict-teacher.md +39 -37
- package/assets/checks/archive-age.mjs +48 -28
- package/assets/checks/archive-prune.mjs +16 -14
- package/assets/checks/board-epic-link.github.mjs +29 -0
- package/assets/checks/board-epics.github.mjs +286 -49
- package/assets/checks/board-folders.mjs +61 -0
- package/assets/checks/board-gh.github.mjs +35 -26
- package/assets/checks/board-long-work.github.mjs +29 -25
- package/assets/checks/board-paths.github.mjs +21 -16
- package/assets/checks/board-pull-state.github.mjs +168 -0
- package/assets/checks/board-runs.github.mjs +45 -43
- package/assets/checks/board-task-dirs.github.mjs +98 -0
- package/assets/checks/board-titles.github.mjs +19 -17
- package/assets/checks/board.github.mjs +133 -194
- package/assets/checks/check-archive-age.mjs +23 -19
- package/assets/checks/check-board.github.mjs +131 -263
- package/assets/checks/check-descriptions.mjs +30 -29
- package/assets/checks/check-doc-paths.mjs +91 -88
- package/assets/checks/check-dupes.mjs +84 -80
- package/assets/checks/check-file-size.mjs +74 -71
- package/assets/checks/check-glossary.mjs +47 -37
- package/assets/checks/check-hook-scope.mjs +30 -27
- package/assets/checks/check-lib-layers.mjs +22 -21
- package/assets/checks/check-profile-drift.mjs +48 -43
- package/assets/checks/check-prose-style.mjs +138 -39
- package/assets/checks/check-push-gate.mjs +53 -50
- package/assets/checks/check-reuse.mjs +50 -40
- package/assets/checks/check-schema-drift.mjs +104 -84
- package/assets/checks/check-specs.mjs +155 -134
- package/assets/checks/check-state-next.mjs +66 -52
- package/assets/checks/check-states.mjs +32 -30
- package/assets/checks/check-styles.mjs +52 -51
- package/assets/checks/check-turn-map.mjs +54 -46
- package/assets/checks/epic-table.github.mjs +268 -0
- package/assets/checks/lib-boundaries.mjs +32 -30
- package/assets/checks/lib-common.mjs +30 -29
- package/assets/checks/lib-domains.mjs +34 -34
- package/assets/checks/lib-manifests.mjs +17 -15
- package/assets/checks/lib-reexports.mjs +18 -18
- package/assets/checks/rt-kit-checks.config.mjs +187 -142
- package/assets/checks/signals.mjs +43 -39
- package/assets/checks/spec-anchors.mjs +114 -87
- package/assets/checks/spec-common.mjs +128 -84
- package/assets/checks/spec-contract.mjs +30 -30
- package/assets/checks/spec-proposed.mjs +27 -24
- package/assets/checks/spec-scenarios.mjs +51 -28
- package/assets/checks/specs-for.mjs +214 -0
- package/assets/checks/task-new.github.mjs +315 -61
- package/assets/commands/feedback.md +65 -59
- package/assets/commands/next-session.md +64 -57
- package/assets/commands/night.md +115 -0
- package/assets/commands/skill-curator.md +83 -79
- package/assets/defaults/gate-map.sh +108 -97
- package/assets/defaults/project.sh +232 -185
- package/assets/defaults/shell.sh +73 -68
- package/assets/defaults/turn-map.md +47 -44
- package/assets/docs/GLOSSARY.md +142 -65
- package/assets/hooks/browser-device-id.sh +16 -12
- package/assets/hooks/browser-guard-device-id.sh +34 -28
- package/assets/hooks/browser-guard-no-asking.sh +5 -4
- package/assets/hooks/browser-guard-no-listing.sh +12 -11
- package/assets/hooks/browser-guard-no-other-drivers.sh +48 -42
- package/assets/hooks/browser-guard-require-select.sh +34 -23
- package/assets/hooks/claim-guard.sh +62 -56
- package/assets/hooks/commit-msg.sh +14 -10
- package/assets/hooks/conscience-guard.sh +91 -45
- package/assets/hooks/constitution-index.sh +16 -16
- package/assets/hooks/deny-tail.sh +28 -26
- package/assets/hooks/dev-server-guard.sh +50 -43
- package/assets/hooks/dispatch.sh +60 -46
- package/assets/hooks/docs-guard.sh +100 -91
- package/assets/hooks/epic-over.sh +49 -0
- package/assets/hooks/epic-stop-guard.sh +108 -0
- package/assets/hooks/exam-guard.sh +105 -93
- package/assets/hooks/git-guard-delivery-conflict.sh +41 -36
- package/assets/hooks/git-guard-delivery-draft.sh +48 -38
- package/assets/hooks/git-guard-delivery-epic.sh +167 -0
- package/assets/hooks/git-guard-delivery-folder.sh +50 -43
- package/assets/hooks/git-guard-delivery-signature.sh +119 -53
- package/assets/hooks/git-guard-delivery.sh +223 -183
- package/assets/hooks/git-guard-main.sh +38 -34
- package/assets/hooks/git-guard-push-tests.sh +99 -87
- package/assets/hooks/glossary-load.sh +23 -22
- package/assets/hooks/grill-gate-ask.sh +12 -11
- package/assets/hooks/grill-gate.sh +94 -87
- package/assets/hooks/guard-note.sh +20 -19
- package/assets/hooks/handoff-entry-guard.sh +45 -25
- package/assets/hooks/handoff-write.sh +74 -67
- package/assets/hooks/hook-input.sh +67 -58
- package/assets/hooks/lint-after-edit.sh +95 -61
- package/assets/hooks/observe.sh +28 -26
- package/assets/hooks/override-write-guard.sh +23 -21
- package/assets/hooks/postmortem-guard.sh +42 -39
- package/assets/hooks/profile-check.sh +22 -20
- package/assets/hooks/proposal-guard.sh +57 -49
- package/assets/hooks/prose-style-guard.sh +49 -24
- package/assets/hooks/qa-dataid-guard.sh +83 -58
- package/assets/hooks/rerun-guard.sh +31 -30
- package/assets/hooks/reuse-first-guard.sh +108 -87
- package/assets/hooks/roles.sh +14 -14
- package/assets/hooks/rule-article.sh +39 -34
- package/assets/hooks/rule-source-guard.sh +47 -42
- package/assets/hooks/skill-gate-layers.sh +63 -57
- package/assets/hooks/skill-gate-rearm.sh +15 -8
- package/assets/hooks/skill-gate.sh +89 -81
- package/assets/hooks/skill-loaded.sh +10 -6
- package/assets/hooks/sql-guard-parse.sh +71 -66
- package/assets/hooks/sql-guard-request.sh +51 -46
- package/assets/hooks/sql-guard-target.sh +60 -51
- package/assets/hooks/sql-guard-write.sh +87 -79
- package/assets/hooks/sql-guard.sh +52 -47
- package/assets/hooks/stand-login-guard.sh +43 -37
- package/assets/hooks/task-context-load.sh +60 -55
- package/assets/hooks/task-flow-context.sh +87 -69
- package/assets/hooks/task-flow-draft-guard.sh +55 -48
- package/assets/hooks/task-flow-guard.sh +67 -64
- package/assets/hooks/turn-entry-load.sh +39 -32
- package/assets/hooks/turn-exit-guard.sh +260 -204
- package/assets/hooks/turn-exit-patterns.sh +63 -0
- package/assets/hooks/utf8.sh +14 -11
- package/assets/hooks/waiting-turn-guard.sh +104 -94
- package/assets/hooks/window-fill-guard.sh +70 -62
- package/assets/hooks/work-start-guard.sh +52 -49
- package/assets/hooks/write-targets.sh +99 -44
- package/assets/laws/autonomous-work.md +29 -27
- package/assets/laws/code-structure.md +31 -30
- package/assets/laws/delivery.md +170 -137
- package/assets/laws/entity-editing.md +52 -50
- package/assets/laws/entity-models.md +14 -13
- package/assets/laws/frontend-application.md +39 -38
- package/assets/laws/lib-imports.md +27 -27
- package/assets/laws/lists.md +31 -29
- package/assets/laws/navigation.md +37 -37
- package/assets/laws/observability.md +41 -40
- package/assets/laws/project-documentation.md +106 -99
- package/assets/laws/reuse-first.md +31 -29
- package/assets/laws/shared-code.md +27 -27
- package/assets/laws/verifiability.md +131 -124
- package/assets/laws/work-conduct.md +250 -244
- package/assets/patterns/admin-lists-screen.md +72 -69
- package/assets/patterns/admin-nav-item.md +51 -46
- package/assets/patterns/angular-patterns-state.md +32 -31
- package/assets/patterns/api-layer-pair.md +33 -31
- package/assets/patterns/autonomous-work-run.md +50 -49
- package/assets/patterns/browser-verification-measure.md +124 -88
- package/assets/patterns/browser-verification-stand.md +169 -157
- package/assets/patterns/component-structure-new.md +51 -42
- package/assets/patterns/dependencies-upgrade.md +55 -39
- package/assets/patterns/doc-style-human.md +55 -37
- package/assets/patterns/doc-style-sweep.md +82 -79
- package/assets/patterns/doc-style-trace.md +87 -81
- package/assets/patterns/doc-style-write.md +130 -122
- package/assets/patterns/entity-aside.md +77 -63
- package/assets/patterns/entity-models-new.md +37 -37
- package/assets/patterns/entity-store.md +33 -33
- package/assets/patterns/git-workflow-commit.azure.md +94 -87
- package/assets/patterns/git-workflow-commit.github.md +160 -142
- package/assets/patterns/git-workflow-commit.gitlab.md +96 -90
- package/assets/patterns/git-workflow-docker.md +165 -147
- package/assets/patterns/git-workflow-freshness.md +45 -45
- package/assets/patterns/git-workflow-merge.md +102 -94
- package/assets/patterns/git-workflow-migration.md +54 -52
- package/assets/patterns/git-workflow-pr-ready.md +57 -56
- package/assets/patterns/git-workflow-pr.azure.md +127 -122
- package/assets/patterns/git-workflow-pr.github.md +186 -177
- package/assets/patterns/git-workflow-pr.gitlab.md +139 -132
- package/assets/patterns/git-workflow-restart.md +35 -31
- package/assets/patterns/git-workflow-secrets.md +80 -73
- package/assets/patterns/git-workflow-stack.md +136 -107
- package/assets/patterns/lib-layers-move.md +62 -53
- package/assets/patterns/lib-layers-new.md +59 -45
- package/assets/patterns/observability-record.md +72 -67
- package/assets/patterns/platform-access-di.md +31 -29
- package/assets/patterns/reuse-first-extend.md +66 -61
- package/assets/patterns/shared-code-new.md +39 -38
- package/assets/patterns/spec-driven-domain.md +161 -151
- package/assets/patterns/spec-driven-rule.md +179 -168
- package/assets/patterns/spec-driven-sweep.md +41 -39
- package/assets/patterns/status-report-table.github.md +48 -36
- package/assets/patterns/styling-bem-component.md +42 -42
- package/assets/patterns/styling-bem-layout.md +39 -34
- package/assets/patterns/styling-bem-sheet.md +59 -58
- package/assets/patterns/task-flow-archive.md +222 -215
- package/assets/patterns/task-flow-close.md +234 -203
- package/assets/patterns/task-flow-handoff.md +154 -145
- package/assets/patterns/task-flow-resume.md +138 -133
- package/assets/patterns/task-flow-start.md +228 -202
- package/assets/patterns/testing-e2e.md +102 -101
- package/assets/patterns/testing-unit.md +77 -70
- package/assets/patterns/ts-procedure.md +32 -29
- package/assets/patterns/turn-entry-map.md +50 -48
- package/assets/pitfalls/agent-kit.md +172 -142
- package/assets/pitfalls/doc-style.md +96 -91
- package/assets/pitfalls/git-workflow.azure.md +49 -46
- package/assets/pitfalls/git-workflow.github.md +270 -234
- package/assets/pitfalls/git-workflow.gitlab.md +49 -45
- package/assets/pitfalls/spec-driven.md +73 -71
- package/assets/pitfalls/styling-bem.md +46 -40
- package/assets/pitfalls/task-flow.md +262 -246
- package/assets/pitfalls/testing.md +99 -92
- package/assets/pitfalls/turn-conduct.md +96 -81
- package/assets/rules/angular-patterns.md +81 -80
- package/assets/rules/api-layer.md +77 -74
- package/assets/rules/autonomous-work.md +87 -74
- package/assets/rules/browser-verification.md +223 -214
- package/assets/rules/component-structure.md +72 -69
- package/assets/rules/dependencies.md +74 -67
- package/assets/rules/deploy-flow.azure.md +118 -108
- package/assets/rules/deploy-flow.github.md +145 -135
- package/assets/rules/deploy-flow.gitlab.md +120 -110
- package/assets/rules/doc-style.md +201 -173
- package/assets/rules/entity-conventions.needs-admin.md +81 -79
- package/assets/rules/entity-models.md +73 -70
- package/assets/rules/git-workflow.azure.md +224 -228
- package/assets/rules/git-workflow.github.md +268 -239
- package/assets/rules/git-workflow.gitlab.md +218 -217
- package/assets/rules/lib-layers.md +85 -86
- package/assets/rules/lists.md +101 -97
- package/assets/rules/navigation.md +78 -78
- package/assets/rules/observability.needs-app.md +165 -153
- package/assets/rules/platform-access.md +76 -75
- package/assets/rules/reuse-first.md +153 -143
- package/assets/rules/shared-code.md +82 -79
- package/assets/rules/spec-driven.md +279 -260
- package/assets/rules/status-report.md +62 -58
- package/assets/rules/styling-bem.md +81 -77
- package/assets/rules/task-flow.md +303 -270
- package/assets/rules/testing.md +224 -209
- package/assets/rules/turn-conduct.md +262 -258
- package/assets/rules/turn-entry.md +92 -87
- package/assets/rules/typescript-conventions.md +94 -88
- package/assets/samples/specs/_template/spec.md +47 -47
- package/assets/samples/tasks/_template/grill.md +20 -20
- package/assets/samples/tasks/_template/plan.md +32 -30
- package/assets/samples/tasks/_template/progress.md +16 -16
- package/assets/skills/agent-kit-extend.md +129 -113
- package/assets/skills/agent-kit.md +259 -233
- package/assets/skills/write-a-skill.md +76 -71
- package/assets/templates/findings.md +19 -19
- package/assets/templates/gate-map.sh +16 -14
- package/assets/templates/implementation.md +28 -27
- package/assets/templates/pattern.md +17 -17
- package/assets/templates/pitfalls.md +6 -6
- package/assets/templates/postmortem.md +24 -23
- package/assets/templates/project.sh +24 -24
- package/assets/templates/proposal.md +62 -60
- package/assets/templates/rule.md +38 -38
- package/assets/workflows/feature.js +46 -46
- package/assets/workflows/plan.js +54 -54
- package/bin/agent-kit.d.ts.map +1 -1
- package/bin/agent-kit.js +8 -1
- package/bin/agent-kit.js.map +1 -1
- package/lib/cargo-prose.d.ts +41 -0
- package/lib/cargo-prose.d.ts.map +1 -0
- package/lib/cargo-prose.js +88 -0
- package/lib/cargo-prose.js.map +1 -0
- package/lib/cargo.d.ts +12 -1
- package/lib/cargo.d.ts.map +1 -1
- package/lib/cargo.js +8 -2
- package/lib/cargo.js.map +1 -1
- package/lib/catalog.d.ts +2 -0
- package/lib/catalog.d.ts.map +1 -1
- package/lib/catalog.js +4 -3
- package/lib/catalog.js.map +1 -1
- package/lib/commands.d.ts.map +1 -1
- package/lib/commands.js +5 -2
- package/lib/commands.js.map +1 -1
- package/lib/companion.js +3 -2
- package/lib/companion.js.map +1 -1
- package/lib/enroll.d.ts +7 -1
- package/lib/enroll.d.ts.map +1 -1
- package/lib/enroll.js +12 -3
- package/lib/enroll.js.map +1 -1
- package/lib/fate.d.ts +29 -0
- package/lib/fate.d.ts.map +1 -0
- package/lib/fate.js +147 -0
- package/lib/fate.js.map +1 -0
- package/lib/override-marks.d.ts +7 -0
- package/lib/override-marks.d.ts.map +1 -1
- package/lib/override-marks.js +14 -0
- package/lib/override-marks.js.map +1 -1
- package/lib/plan.d.ts +11 -0
- package/lib/plan.d.ts.map +1 -1
- package/lib/plan.js +10 -1
- package/lib/plan.js.map +1 -1
- package/lib/ship.d.ts +29 -9
- package/lib/ship.d.ts.map +1 -1
- package/lib/ship.js +44 -2
- package/lib/ship.js.map +1 -1
- package/lib/shipment.d.ts.map +1 -1
- package/lib/shipment.fixture.d.ts +8 -1
- package/lib/shipment.fixture.d.ts.map +1 -1
- package/lib/shipment.fixture.js +9 -0
- package/lib/shipment.fixture.js.map +1 -1
- package/lib/shipment.js +38 -5
- package/lib/shipment.js.map +1 -1
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +45 -11
- package/lib/sync.js.map +1 -1
- package/package.json +1 -1
- package/rt-tools-agent-kit-0.27.0.tgz +0 -0
- package/rt-tools-agent-kit-0.24.0.tgz +0 -0
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* A check that a pattern is not written a second time.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* A duplicate appears silently: a domain writes its own enumeration of statuses because
|
|
6
|
+
* someone else's lies in a lib it cannot see — and from then on the two sets drift apart
|
|
7
|
+
* one value at a time. Neither lint, nor the build, nor the tests see this: each copy
|
|
8
|
+
* on its own is sound.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* It is caught by these signs:
|
|
11
11
|
*
|
|
12
|
-
* 1.
|
|
13
|
-
*
|
|
14
|
-
* 2.
|
|
15
|
-
*
|
|
16
|
-
* 3.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* 4.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
12
|
+
* 1. One name exported from two different libs. The name is not the same by chance —
|
|
13
|
+
* it was chosen for one and the same notion.
|
|
14
|
+
* 2. Two enumerations with the same set of members under different names.
|
|
15
|
+
* The name drifted, the notion stayed one.
|
|
16
|
+
* 3. A setting under one name declared in two libs. It has no export, so the first
|
|
17
|
+
* sign did not see it: `DEFAULT_PAGE_SIZE` drifted into six declarations, and one
|
|
18
|
+
* of them had already become `25` against `20` in the others. Only names of the
|
|
19
|
+
* form `SCREAMING_SNAKE_CASE` count — the form in which this code writes settings,
|
|
20
|
+
* not local variables.
|
|
21
|
+
* 4. An enumeration repeating a set from an external package. The sets of `@rt-tools/utils`
|
|
22
|
+
* are read from its `.d.ts` alongside the libs: a copy of the condition operator and of
|
|
23
|
+
* the sort direction lay on the backend verbatim, while sign 2 compared only libs
|
|
24
|
+
* with each other and never reached `node_modules`.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
* `
|
|
26
|
+
* Members are compared in lower case without underscores, so `NOT_EQUALS` of the contract
|
|
27
|
+
* and `NotEquals` of the application count as one member.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* The duplicate key carries the list of libs too: without it a third copy of an already
|
|
30
|
+
* known name passed silently — the set changed, the key stayed the same.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* What had piled up by the time the check was created lies in tools/dupes-allowlist.json
|
|
33
|
+
* and is not counted as a refusal: the gate fails on a NEW duplicate, and the old ones stay
|
|
34
|
+
* visible as a number in the summary. The debt is handled by separate tasks — otherwise
|
|
35
|
+
* the check would have to be created together with an edit of forty places.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
37
|
+
* A non-zero exit code and the list of discrepancies.
|
|
38
38
|
*/
|
|
39
39
|
import { createRequire } from 'node:module';
|
|
40
40
|
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
@@ -44,17 +44,18 @@ import { allowlistOf, baselineOf, CONFIG, ROOT, parseAllowlist } from './rt-kit-
|
|
|
44
44
|
|
|
45
45
|
const ALLOWLIST = allowlistOf('dupes');
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
47
|
+
* Where duplicates are looked for. The roots come from the settings: a hard-coded name silently
|
|
48
|
+
* found not a single file in a tree that keeps its code differently, and the check went green
|
|
49
|
+
* on an empty walk.
|
|
49
50
|
*/
|
|
50
51
|
const SOURCE_ROOTS = CONFIG.sourceRoots;
|
|
51
52
|
/**
|
|
52
|
-
* `gen`
|
|
53
|
-
*
|
|
54
|
-
*
|
|
53
|
+
* `gen` and `generated` are the contract and the Prisma client: their declarations are the
|
|
54
|
+
* source the rest is compared against. Counting them as a copy would mean demanding an edit
|
|
55
|
+
* of what the generator rebuilds.
|
|
55
56
|
*/
|
|
56
57
|
const SKIPPED_DIRS = CONFIG.skippedDirs;
|
|
57
|
-
/**
|
|
58
|
+
/** The minimum of members at which a matching enumeration set says something */
|
|
58
59
|
const MIN_ENUM_MEMBERS = 2;
|
|
59
60
|
|
|
60
61
|
const allowlist = parseAllowlist('dupes');
|
|
@@ -78,15 +79,17 @@ function collectFiles(dir) {
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
/**
|
|
81
|
-
*
|
|
82
|
+
* The declarations directory of an external package — by module resolution, not by a path
|
|
83
|
+
* in `node_modules`.
|
|
82
84
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
85
|
+
* There are several resolution points: the root of the tree and each of its subprojects that
|
|
86
|
+
* declared this package as a dependency. A subproject's package does not lie in the root at all,
|
|
87
|
+
* and resolution from the root does not find it; the package manager meanwhile may keep several
|
|
88
|
+
* versions side by side, and walking the store by a path pattern would pick the one nobody
|
|
89
|
+
* installs.
|
|
87
90
|
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
91
|
+
* Not found — `null`, and external sets are simply not counted: a tree without this package
|
|
92
|
+
* must get an audit of its own duplicates, not a refusal to read the directory.
|
|
90
93
|
*/
|
|
91
94
|
function resolveExternalDir({ package: name, dir }) {
|
|
92
95
|
for (const from of [ROOT, ...holdersOf(name)]) {
|
|
@@ -97,14 +100,14 @@ function resolveExternalDir({ package: name, dir }) {
|
|
|
97
100
|
return found;
|
|
98
101
|
}
|
|
99
102
|
} catch {
|
|
100
|
-
//
|
|
103
|
+
// This point does not see the package — the next one is tried.
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
return null;
|
|
105
108
|
}
|
|
106
109
|
|
|
107
|
-
/**
|
|
110
|
+
/** Subprojects that declared the package as a dependency: their manifests are the resolution points. */
|
|
108
111
|
function holdersOf(name) {
|
|
109
112
|
const found = [];
|
|
110
113
|
for (const root of SOURCE_ROOTS) {
|
|
@@ -127,7 +130,7 @@ function holdersOf(name) {
|
|
|
127
130
|
return found;
|
|
128
131
|
}
|
|
129
132
|
|
|
130
|
-
/**
|
|
133
|
+
/** The root of a lib: the path up to the `src` directory. A duplicate inside one lib is not a duplicate */
|
|
131
134
|
function libOf(path) {
|
|
132
135
|
const parts = path.split('/');
|
|
133
136
|
const at = parts.indexOf('src');
|
|
@@ -138,58 +141,59 @@ const EXPORT_RE = /^export (?:const|function|interface|enum|type|class|abstract
|
|
|
138
141
|
const ENUM_RE = /export (?:declare )?enum (\w+)\s*\{([^}]*)\}/g;
|
|
139
142
|
const MEMBER_RE = /(\w+)\s*=/g;
|
|
140
143
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
144
|
+
* A numeric setting: an upper-case name and a value made of digits only — a limit,
|
|
145
|
+
* a size, a duration. Strings and lookup tables are deliberately left out:
|
|
146
|
+
* `LOG_CONTEXT` is declared in eight libs, and in each one it means its own thing,
|
|
147
|
+
* while a matching name of a number means a matching notion.
|
|
145
148
|
*/
|
|
146
149
|
const SETTING_RE = /^(?:export )?const ([A-Z][A-Z0-9_]*)\s*(?::\s*number\s*)?=\s*\d[\d\s*+\-/_.]*;/gm;
|
|
147
150
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
151
|
+
* A string setting and a list setting. They are compared by value, not by name: one name
|
|
152
|
+
* means different things here — `BEM_BLOCK` is declared in thirty-six libs, `LOG_CONTEXT`
|
|
153
|
+
* in ten, and each lib has its own. The same value under different names is the opposite:
|
|
154
|
+
* almost always one notion written twice — the name of an edit event, the refusal code
|
|
155
|
+
* about a duplicate, the set of accepted attachment types.
|
|
153
156
|
*/
|
|
154
157
|
const STRING_SETTING_RE =
|
|
155
158
|
/^(?:export )?const ([A-Z][A-Z0-9_]*)\s*(?::[^=]*)?=\s*('[^']*'|"[^"]*"|`[^`]*`|\[[^\]]*\])\s*(?:as const\s*)?;/gm;
|
|
156
|
-
/**
|
|
159
|
+
/** A lookup table: status into contract, columns into sort fields, label keys */
|
|
157
160
|
const TABLE_RE = /^(?:export )?const ([A-Z][A-Z0-9_]*)\s*(?::[^=]*)?=\s*\{([^}]*?)\}\s*(?:as const\s*)?;/gms;
|
|
158
161
|
const PAIR_RE = /([\w'"[\].]+)\s*:\s*([^,\n]+)/g;
|
|
159
162
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
163
|
+
* A value shorter than this says nothing about matching notions: an empty string, a hyphen
|
|
164
|
+
* and `id` match everywhere.
|
|
162
165
|
*/
|
|
163
166
|
const MIN_VALUE_LENGTH = 4;
|
|
164
|
-
/**
|
|
167
|
+
/** The minimum of pairs at which matching tables say something */
|
|
165
168
|
const MIN_TABLE_PAIRS = 2;
|
|
166
169
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
+
* The share of matching pairs from which tables count as one. Full equality is blind exactly
|
|
171
|
+
* where a copy drifted from the original by one line — and that is the very case for which
|
|
172
|
+
* copies are merged. The threshold is high: tables of one domain share two or three pairs
|
|
173
|
+
* without any kinship.
|
|
170
174
|
*/
|
|
171
175
|
const MIN_TABLE_SHARE = 0.8;
|
|
172
176
|
|
|
173
177
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
178
|
+
* Packages whose sets count alongside the libs. An enumeration of one's own under a set
|
|
179
|
+
* already declared there is the same copy as one between two libs.
|
|
176
180
|
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
+
* The package name and the directory inside it are declared by the tree; the path in
|
|
182
|
+
* `node_modules` is not hard-coded here. A package declared as a subproject dependency does not
|
|
183
|
+
* lie in the root `node_modules` at all — the package manager keeps it in its store — and the
|
|
184
|
+
* check ended with a refusal to read the directory without reaching the audit even once.
|
|
181
185
|
*/
|
|
182
186
|
const EXTERNAL_ENUM_SOURCES = CONFIG.externalEnums ?? [];
|
|
183
187
|
|
|
184
188
|
const exportsByName = new Map();
|
|
185
189
|
const settingsByName = new Map();
|
|
186
190
|
const enums = [];
|
|
187
|
-
/**
|
|
191
|
+
/** String settings and lists keyed by value: `value → [{ name, lib }]` */
|
|
188
192
|
const namesByValue = new Map();
|
|
189
|
-
/**
|
|
193
|
+
/** Lookup tables: the set of pairs under a key, with the name and the lib next to it */
|
|
190
194
|
const tables = [];
|
|
191
195
|
|
|
192
|
-
/**
|
|
196
|
+
/** The value without quotes and spaces; a list — as a sorted set of members */
|
|
193
197
|
function valueOf(raw) {
|
|
194
198
|
if (raw.startsWith('[')) {
|
|
195
199
|
const items = [...raw.matchAll(/'([^']*)'|"([^"]*)"|`([^`]*)`/g)].map((item) => item[1] ?? item[2] ?? item[3]);
|
|
@@ -269,7 +273,7 @@ for (const [name, libs] of [...exportsByName.entries()].sort()) {
|
|
|
269
273
|
continue;
|
|
270
274
|
}
|
|
271
275
|
const where = [...libs].sort().join(', ');
|
|
272
|
-
findings.push({ key: `export ${name} @ ${where}`, text: `${name}
|
|
276
|
+
findings.push({ key: `export ${name} @ ${where}`, text: `${name} is exported from ${libs.size} libs: ${where}` });
|
|
273
277
|
}
|
|
274
278
|
|
|
275
279
|
for (const [name, libs] of [...settingsByName.entries()].sort()) {
|
|
@@ -277,7 +281,7 @@ for (const [name, libs] of [...settingsByName.entries()].sort()) {
|
|
|
277
281
|
continue;
|
|
278
282
|
}
|
|
279
283
|
const where = [...libs].sort().join(', ');
|
|
280
|
-
findings.push({ key: `setting ${name} @ ${where}`, text: `${name}
|
|
284
|
+
findings.push({ key: `setting ${name} @ ${where}`, text: `${name} is declared in ${libs.size} libs: ${where}` });
|
|
281
285
|
}
|
|
282
286
|
|
|
283
287
|
for (const [value, places] of [...namesByValue.entries()].sort()) {
|
|
@@ -289,12 +293,12 @@ for (const [value, places] of [...namesByValue.entries()].sort()) {
|
|
|
289
293
|
.map((place) => `${place.name} @ ${place.lib}`)
|
|
290
294
|
.sort()
|
|
291
295
|
.join(' ~ ');
|
|
292
|
-
findings.push({ key: `value ${value} @ ${where}`, text:
|
|
296
|
+
findings.push({ key: `value ${value} @ ${where}`, text: `the value ${value} is declared in ${libs.size} libs: ${where}` });
|
|
293
297
|
}
|
|
294
298
|
|
|
295
299
|
/**
|
|
296
|
-
*
|
|
297
|
-
*
|
|
300
|
+
* The share of matching pairs is counted from the larger table: from the smaller one, a table
|
|
301
|
+
* of two pairs lying entirely inside a table of twenty would read as a full copy.
|
|
298
302
|
*/
|
|
299
303
|
const tableOverlap = (first, second) => {
|
|
300
304
|
let same = 0;
|
|
@@ -320,8 +324,8 @@ for (let i = 0; i < tables.length; i++) {
|
|
|
320
324
|
}
|
|
321
325
|
const key = `table ${[`${first.name} @ ${first.lib}`, `${second.name} @ ${second.lib}`].sort().join(' ~ ')}`;
|
|
322
326
|
const apart = larger - same;
|
|
323
|
-
const tail = apart === 0 ? '
|
|
324
|
-
findings.push({ key, text: `${first.name} (${first.lib})
|
|
327
|
+
const tail = apart === 0 ? 'one table of matches' : `one table of matches, diverged on ${apart} of ${larger} pairs`;
|
|
328
|
+
findings.push({ key, text: `${first.name} (${first.lib}) and ${second.name} (${second.lib}) — ${tail}` });
|
|
325
329
|
}
|
|
326
330
|
}
|
|
327
331
|
|
|
@@ -337,7 +341,7 @@ for (let i = 0; i < enums.length; i++) {
|
|
|
337
341
|
const key = `enum ${[`${first.name} @ ${first.lib}`, `${second.name} @ ${second.lib}`].sort().join(' ~ ')}`;
|
|
338
342
|
findings.push({
|
|
339
343
|
key,
|
|
340
|
-
text: `${first.name} (${first.lib})
|
|
344
|
+
text: `${first.name} (${first.lib}) and ${second.name} (${second.lib}) — one set of members: ${[...first.members].sort().join(', ')}`,
|
|
341
345
|
});
|
|
342
346
|
}
|
|
343
347
|
}
|
|
@@ -352,13 +356,13 @@ if (process.argv.includes('--baseline')) {
|
|
|
352
356
|
|
|
353
357
|
const problems = [
|
|
354
358
|
...fresh.map((finding) => finding.text),
|
|
355
|
-
...staleKeys.map((key) => `${key}:
|
|
359
|
+
...staleKeys.map((key) => `${key}: listed in ${ALLOWLIST}, and the duplication is gone — remove the line`),
|
|
356
360
|
];
|
|
357
361
|
|
|
358
362
|
if (problems.length > 0) {
|
|
359
|
-
console.error(`check-dupes:
|
|
363
|
+
console.error(`check-dupes: divergences ${problems.length}\n`);
|
|
360
364
|
problems.forEach((problem) => console.error(` ${problem}`));
|
|
361
365
|
process.exit(1);
|
|
362
366
|
}
|
|
363
367
|
|
|
364
|
-
console.log(`check-dupes:
|
|
368
|
+
console.log(`check-dupes: duplications ${findings.length}, of them accepted ${findings.length - debt.size}, debt ${debt.size} — no new ones`);
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* The check that a file is no longer than the limit.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* A file that does not fit on the screen whole is read in parts, and an edit in it is made without
|
|
6
|
+
* having seen the rest. For code the linter watches the length; here is everything it does not
|
|
7
|
+
* reach: prose, styles, templates, the development harness and the guards themselves.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Judged are `.md`, `.scss`, `.html`, `.js`, `.mjs` and `.sh`. Data is not judged at all: a locale
|
|
10
|
+
* dictionary and a build setting are read by search, not in a row, and there is nothing to split
|
|
11
|
+
* them into. Code in a language where the linter watches the length is not judged either — two
|
|
12
|
+
* refusals on one file read as two different claims.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* проверок дерева одно понятие длины.
|
|
14
|
+
* All lines are counted, empty ones and comments included, and the same way the linter counts
|
|
15
|
+
* them: by the number of breaks plus one. A file ending with a line break therefore weighs one
|
|
16
|
+
* line more than `wc -l` shows — but both checks of the tree have one notion of length.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* The archive is taken out of the count: by its make-up it lists what is no longer in the tree,
|
|
19
|
+
* and a task folder dies with the merge. What is generated is taken out by directory: the
|
|
20
|
+
* generator rewrites it whole, and there is no one there to argue with it about length.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
22
|
+
* What piled up by the moment the check was started lies in the known list and does not count as a
|
|
23
|
+
* refusal: the gate falls on a NEW long file, while the old stays a visible number in the digest.
|
|
24
|
+
* Accepted and debt differ there: what is accepted the tree is not going to split, for a debt work
|
|
25
|
+
* has been started. A line is removed together with the splitting of its file, and the check
|
|
26
|
+
* itself says which line it is time to take away.
|
|
28
27
|
*
|
|
29
|
-
*
|
|
28
|
+
* A non-zero exit code and the list of discrepancies.
|
|
30
29
|
*/
|
|
31
30
|
import { execFileSync } from 'node:child_process';
|
|
32
31
|
import { existsSync, readFileSync } from 'node:fs';
|
|
@@ -35,40 +34,41 @@ import { join } from 'node:path';
|
|
|
35
34
|
import { allowlistOf, baselineOf, CONFIG, ROOT, parseAllowlist } from './rt-kit-checks.config.mjs';
|
|
36
35
|
|
|
37
36
|
const ALLOWLIST = allowlistOf('file-size');
|
|
38
|
-
/**
|
|
37
|
+
/** There are two limits: code and the text of the rules layer; each refusal line names which one. */
|
|
39
38
|
const LIMIT = CONFIG.fileSizeLimit;
|
|
40
39
|
const PROSE_LIMIT = CONFIG.proseSizeLimit ?? CONFIG.fileSizeLimit;
|
|
41
40
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* 272
|
|
45
|
-
*
|
|
46
|
-
*
|
|
41
|
+
* The second limit of text is in characters. Lines measure how much text fits on the screen, but do
|
|
42
|
+
* not measure the weight at all: the rule about PRs takes 282 lines at 13 595 characters, and the
|
|
43
|
+
* delivery rule 272 lines at 21 508. Squeezing the layer cuts characters and leaves the number of
|
|
44
|
+
* breaks as it was, so the line limit does not fix what has been reached. A tree that has not named
|
|
45
|
+
* this number is judged by lines alone, as before.
|
|
47
46
|
*/
|
|
48
47
|
const PROSE_CHARS = CONFIG.proseCharLimit ?? 0;
|
|
49
|
-
/**
|
|
48
|
+
/** The roots of the rules-layer text; a tree that has not named them is judged by one limit. */
|
|
50
49
|
const PROSE_ROOTS = CONFIG.proseRoots ?? [];
|
|
51
50
|
|
|
52
|
-
/**
|
|
51
|
+
/** The limit for a file and its name for a refusal: by root, not by extension — code lies in `.md` too. */
|
|
53
52
|
function limitOf(path) {
|
|
54
53
|
return PROSE_ROOTS.some((root) => root && path.startsWith(root))
|
|
55
|
-
? { limit: PROSE_LIMIT, title: '
|
|
56
|
-
: { limit: LIMIT, title: '
|
|
54
|
+
? { limit: PROSE_LIMIT, title: 'the limit for prose' }
|
|
55
|
+
: { limit: LIMIT, title: 'the limit for code' };
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
/**
|
|
58
|
+
/** The kinds of files the linter does not read. Code stays with it. */
|
|
60
59
|
const JUDGED = ['.md', '.scss', '.html', '.js', '.mjs', '.sh'];
|
|
61
60
|
|
|
62
|
-
/**
|
|
61
|
+
/** The archive, the task folder and what the generator rewrites. */
|
|
63
62
|
const SKIPPED_PREFIXES = [CONFIG.archiveDir, `${CONFIG.tasksDir}/`, ...CONFIG.generatedDirs];
|
|
64
63
|
|
|
65
64
|
/**
|
|
66
|
-
*
|
|
65
|
+
* The tree is asked of the version control system: otherwise directories with a dot are not seen,
|
|
66
|
+
* while the build is.
|
|
67
67
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
68
|
+
* What was taken out of the working tree is sifted out here, not in the counters: version control
|
|
69
|
+
* remembers a file until the removal is entered into the history, and there is nothing to read it
|
|
70
|
+
* with — the check fell with an `ENOENT` trace and read as broken, though only the unrecorded
|
|
71
|
+
* removal was broken. There are two counters, and the protection at each of them would diverge.
|
|
72
72
|
*/
|
|
73
73
|
function trackedFiles() {
|
|
74
74
|
return execFileSync('git', ['ls-files'], { cwd: ROOT, encoding: 'utf8', maxBuffer: 1024 * 1024 * 32 })
|
|
@@ -85,29 +85,29 @@ function judged(path) {
|
|
|
85
85
|
return JUDGED.some((extension) => path.endsWith(extension));
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
/**
|
|
88
|
+
/** The same way the linter counts: the number of breaks plus one. */
|
|
89
89
|
function lineCount(path) {
|
|
90
90
|
return readFileSync(join(ROOT, path), 'utf8').split('\n').length;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
/**
|
|
93
|
+
/** A companion is a table of links, not prose: the companion of a rule and the scenario list of a spec. */
|
|
94
94
|
function companion(path) {
|
|
95
95
|
return path.endsWith('/implementation.md') || path.endsWith('/scenarios.md');
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
/**
|
|
98
|
+
/** Characters, not bytes: Cyrillic weighs two bytes, and a byte count would judge the language, not the text. */
|
|
99
99
|
function charCount(path) {
|
|
100
100
|
return readFileSync(join(ROOT, path), 'utf8').length;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
104
|
+
* The known list is read apart from the common reader: this check has no file — that is not an
|
|
105
|
+
* empty list but an unreadable setting, and staying silent about it is not allowed. An empty list
|
|
106
|
+
* is lawful exactly once — in a tree where there are no long files at all.
|
|
107
107
|
*/
|
|
108
108
|
const allowlist = parseAllowlist('file-size');
|
|
109
109
|
const { accepted, debt } = allowlist;
|
|
110
|
-
const known = new Map([...[...accepted.keys()].map((path) => [path, '
|
|
110
|
+
const known = new Map([...[...accepted.keys()].map((path) => [path, 'accepted']), ...[...debt.keys()].map((path) => [path, 'debt'])]);
|
|
111
111
|
|
|
112
112
|
const tooLong = new Map();
|
|
113
113
|
const tracked = trackedFiles().filter(judged);
|
|
@@ -120,15 +120,17 @@ for (const path of tracked) {
|
|
|
120
120
|
tooLong.set(path, lines);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
//
|
|
124
|
-
//
|
|
123
|
+
// Weight is judged only for the text of the rules layer and only where the tree has named the
|
|
124
|
+
// number: for code the length is watched by the linter as well, and for prose by these two
|
|
125
|
+
// limits alone.
|
|
125
126
|
//
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
|
|
127
|
+
// Companions are taken out of the weight count. The companion of a rule and the scenario list
|
|
128
|
+
// are tables of links: the heading of a binding repeats the statement word for word, because
|
|
129
|
+
// the link goes by its text, and there is nothing to cut there without tearing the link itself.
|
|
130
|
+
// The weight of such a file grows with the number of statements, not with wordiness: the
|
|
131
|
+
// delivery rule has seventy-six bindings at 24 326 characters, of which the explanations are
|
|
132
|
+
// only 5 729. The line limit on them stays — it catches something else.
|
|
133
|
+
if (PROSE_CHARS > 0 && PROSE_ROOTS.length > 0 && limitOf(path).title === 'the limit for prose' && !companion(path)) {
|
|
132
134
|
const chars = charCount(path);
|
|
133
135
|
if (chars > PROSE_CHARS) {
|
|
134
136
|
overweight.set(path, chars);
|
|
@@ -142,46 +144,47 @@ if (process.argv.includes('--baseline')) {
|
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
const fresh = [...tooLong].filter(([path]) => !known.has(path));
|
|
145
|
-
/**
|
|
147
|
+
/** A line about a file that is not in the tree is stale: otherwise the list piles up the dead. */
|
|
146
148
|
const gone = [...known.keys()].filter((path) => !existsSync(join(ROOT, path)));
|
|
147
149
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
150
|
+
* The file was split and the line was left: the list would stop answering for what stands in it.
|
|
151
|
+
* A file heavy by characters does not fall under the line limit, and without the second check its
|
|
152
|
+
* record would read as stale — a debt could be neither written down nor left.
|
|
151
153
|
*/
|
|
152
154
|
const shrunk = [...known.keys()].filter(
|
|
153
155
|
(path) => !tooLong.has(path) && !overweight.has(path) && existsSync(join(ROOT, path))
|
|
154
156
|
);
|
|
155
157
|
|
|
156
|
-
/**
|
|
158
|
+
/** What is heavy by characters is judged by the same known list: one debt per file, not two. */
|
|
157
159
|
const heavy = [...overweight].filter(([path]) => !known.has(path) && !tooLong.has(path));
|
|
158
160
|
|
|
159
161
|
const problems = [
|
|
160
|
-
...heavy.map(([path, chars]) => `${path}: ${chars}
|
|
162
|
+
...heavy.map(([path, chars]) => `${path}: ${chars} characters, the weight limit for prose is ${PROSE_CHARS} — cut the argument instead of adding a line to ${ALLOWLIST}`),
|
|
161
163
|
...fresh.map(([path, lines]) => {
|
|
162
164
|
const { limit, title } = limitOf(path);
|
|
163
|
-
return `${path}: ${lines}
|
|
165
|
+
return `${path}: ${lines} lines, ${title} ${limit} — split it instead of adding a line to ${ALLOWLIST}`;
|
|
164
166
|
}),
|
|
165
|
-
...gone.map((path) => `${path}:
|
|
166
|
-
...shrunk.map((path) => `${path}:
|
|
167
|
+
...gone.map((path) => `${path}: the line in ${ALLOWLIST} is stale — there is no such file in the tree`),
|
|
168
|
+
...shrunk.map((path) => `${path}: listed in ${ALLOWLIST}, and it is already shorter than the limit — remove the line`),
|
|
167
169
|
];
|
|
168
170
|
|
|
169
171
|
if (problems.length > 0) {
|
|
170
|
-
console.error(`check-file-size:
|
|
172
|
+
console.error(`check-file-size: divergences ${problems.length}\n`);
|
|
171
173
|
problems.forEach((problem) => console.error(` ${problem}`));
|
|
172
|
-
console.error('\
|
|
174
|
+
console.error('\nThe file length limit is the rule about the language for code and the rule about texts for prose.');
|
|
173
175
|
process.exit(1);
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
const limits = PROSE_ROOTS.length > 0 ?
|
|
178
|
+
const limits = PROSE_ROOTS.length > 0 ? `the limit for code ${LIMIT}, the limit for prose ${PROSE_LIMIT}` : `the limit ${LIMIT}`;
|
|
177
179
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
180
|
+
* The weight limit is named only where the tree has set both the number and the roots of the text:
|
|
181
|
+
* weight is judged for the prose of the rules layer, and a tree that has not named its roots is
|
|
182
|
+
* judged by the number of lines alone — a second figure in the digest would speak of a check that
|
|
183
|
+
* does not work there.
|
|
181
184
|
*/
|
|
182
|
-
const weight = PROSE_CHARS > 0 && PROSE_ROOTS.length > 0 ? `,
|
|
185
|
+
const weight = PROSE_CHARS > 0 && PROSE_ROOTS.length > 0 ? `, the weight limit for prose ${PROSE_CHARS} characters` : '';
|
|
183
186
|
|
|
184
187
|
console.log(
|
|
185
|
-
`check-file-size:
|
|
186
|
-
|
|
188
|
+
`check-file-size: checked ${tracked.length} files, ${limits}${weight}, longer than the limit ${tooLong.size}, ` +
|
|
189
|
+
`of them accepted ${accepted.size}, debt ${debt.size} — no new ones`
|
|
187
190
|
);
|