@avi2dg/checks 0.55.0 → 0.56.1
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 +16 -0
- package/docs/bins.md +2 -3
- package/docs/configs/dependency-rules.md +3 -3
- package/docs/configs/native-settings.md +4 -4
- package/docs/design.md +4 -3
- package/docs/gates/checks-ci-wiring.md +1 -1
- package/docs/gates/checks-copy.md +1 -1
- package/docs/gates/checks-css-size.md +1 -1
- package/docs/gates/checks-effect-scope.md +1 -1
- package/docs/gates/checks-frontend-syntax.md +1 -1
- package/docs/gates/checks-graphwalk.md +126 -0
- package/docs/gates/checks-lint-coverage.md +1 -1
- package/docs/gates/checks-lint.md +15 -6
- package/docs/gates/checks-no-plain-js.md +2 -2
- package/docs/gates/checks-test-layout.md +1 -1
- package/package.json +5 -7
- package/src/complexity/graphwalk.ts +374 -0
- package/src/complexity/knip.ts +2 -17
- package/src/core/gates.ts +2 -4
- package/src/core/lint.ts +40 -4
- package/src/core/main.ts +12 -8
- package/src/core/scope.ts +54 -0
- package/docs/gates/checks-exports.md +0 -104
- package/docs/gates/checks-imports.md +0 -64
- package/docs/gates/checks-unused.md +0 -66
- package/src/complexity/exports.ts +0 -189
- package/src/complexity/unused.ts +0 -49
- package/src/dependencies/imports.ts +0 -94
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Every release of `@avi2dg/checks`, newest first, written by the release from its conventional commits.
|
|
4
4
|
|
|
5
|
+
## 0.56.1
|
|
6
|
+
|
|
7
|
+
Released 2026-10-27.
|
|
8
|
+
|
|
9
|
+
### Fixes
|
|
10
|
+
|
|
11
|
+
- **complexity:** merge unused, exports and imports walks into one pass [#12](https://github.com/avi2d/checks/pull/12)
|
|
12
|
+
|
|
13
|
+
## 0.56.0
|
|
14
|
+
|
|
15
|
+
Released 2026-10-27.
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- **core:** scope lint gates by changed paths and add desk run [#11](https://github.com/avi2d/checks/pull/11)
|
|
20
|
+
|
|
5
21
|
## 0.55.0
|
|
6
22
|
|
|
7
23
|
Released 2026-10-27.
|
package/docs/bins.md
CHANGED
|
@@ -10,6 +10,7 @@ The kit ships one bin per check, each named `checks-` and called from a package
|
|
|
10
10
|
|
|
11
11
|
`checks-lint` runs each of these gates that applies to the repository, and names every one that fails.
|
|
12
12
|
A gate reads either the working tree or the range `checks-lint` resolves.
|
|
13
|
+
It scopes tree gates to the change unless `--full` forces the full run, and `--desk` runs the fast tree gates.
|
|
13
14
|
The table groups the gates by vector, the part of a repository each one judges.
|
|
14
15
|
|
|
15
16
|
<!-- generated gates: bun run build writes it from KIT_GATES in src/core/gates.ts and scripts/doc-blocks.ts -->
|
|
@@ -18,8 +19,7 @@ The table groups the gates by vector, the part of a repository each one judges.
|
|
|
18
19
|
| --- | --- | --- | --- |
|
|
19
20
|
| complexity | [`checks-suppressions-ratchet`](gates/checks-suppressions-ratchet.md) | the range | every repository |
|
|
20
21
|
| complexity | [`checks-repetition`](gates/checks-repetition.md) | the range | a repository tracking `*.ts` or `*.tsx` |
|
|
21
|
-
| complexity | [`checks-
|
|
22
|
-
| complexity | [`checks-exports`](gates/checks-exports.md) | the range | a repository tracking `*.ts` or `*.tsx` |
|
|
22
|
+
| complexity | [`checks-graphwalk`](gates/checks-graphwalk.md) | the range | a repository tracking `*.ts` or `*.tsx` or `*.astro` |
|
|
23
23
|
| quality | [`checks-lint-coverage`](gates/checks-lint-coverage.md) | the working tree | a repository tracking `*.ts` or `*.tsx` or `*.astro` |
|
|
24
24
|
| quality | [`checks-comment-gate`](gates/checks-comment-gate.md) | the range | every repository |
|
|
25
25
|
| quality | [`checks-effect-scope`](gates/checks-effect-scope.md) | the working tree | a repository tracking `oxlint.config.ts` |
|
|
@@ -33,7 +33,6 @@ The table groups the gates by vector, the part of a repository each one judges.
|
|
|
33
33
|
| delivery | [`checks-commit-identity`](gates/checks-commit-identity.md) | the range | every repository |
|
|
34
34
|
| delivery | [`checks-ci-wiring`](gates/checks-ci-wiring.md) | the working tree | every repository |
|
|
35
35
|
| delivery | [`checks-secrets`](gates/checks-secrets.md) | the range | every repository |
|
|
36
|
-
| dependencies | [`checks-imports`](gates/checks-imports.md) | the working tree | a repository tracking `*.ts` or `*.tsx` |
|
|
37
36
|
| dependencies | [`checks-advisories`](gates/checks-advisories.md) | the range | a repository tracking `bun.lock` |
|
|
38
37
|
|
|
39
38
|
<!-- end generated gates -->
|
|
@@ -11,7 +11,7 @@ The kit's dependency-cruiser rules hold a repository's imports, and a repository
|
|
|
11
11
|
`defineConfig` from `@avi2dg/checks/dependency-cruiser` returns these rules, with or without a config of the repository's own:
|
|
12
12
|
|
|
13
13
|
- `no-circular`
|
|
14
|
-
- `no-orphans`, which a repository that depends on `astro` gets only by listing its own, as [checks-
|
|
14
|
+
- `no-orphans`, which a repository that depends on `astro` gets only by listing its own, as [checks-graphwalk](../gates/checks-graphwalk.md) explains
|
|
15
15
|
- `not-to-dev-dep`, which refuses shipped source importing a dev-only package, and a package listed in `peerDependencies` too is not dev-only
|
|
16
16
|
- `no-non-package-json`, which refuses an import of an installed package that the nearest `package.json` does not declare, and counts a peer that `peerDependenciesMeta` marks optional as declared
|
|
17
17
|
- `not-to-unresolvable`, which refuses a specifier nothing installed answers
|
|
@@ -61,9 +61,9 @@ A rule under `forbidden` that takes a kit rule's name replaces that rule whole,
|
|
|
61
61
|
|
|
62
62
|
## Running it
|
|
63
63
|
|
|
64
|
-
`checks-lint` runs [checks-
|
|
64
|
+
`checks-lint` runs [checks-graphwalk](../gates/checks-graphwalk.md) in the full run, which cruises every tracked TypeScript file against `dependency-cruiser.config.ts`, or against the kit's defaults when the repository holds no config.
|
|
65
65
|
|
|
66
66
|
## Related topics
|
|
67
67
|
|
|
68
|
-
- [checks-
|
|
68
|
+
- [checks-graphwalk](../gates/checks-graphwalk.md)
|
|
69
69
|
- [Why it is shaped this way](../design.md)
|
|
@@ -14,11 +14,11 @@ A consuming repository puts each setting in the file its tool reads, and no mani
|
|
|
14
14
|
| `oxlint.config.ts` | Effect paths and their exemptions, ignore patterns, and any rule or budget the repository sets over the kit's defaults | oxlint and `checks-effect-scope` |
|
|
15
15
|
| `oxlint-suppressions.json` | The existing violations oxlint suppresses, per file and rule | oxlint and `checks-suppressions-ratchet` |
|
|
16
16
|
| `stylelint-suppressions.json` | The existing violations stylelint suppresses, per file and rule | stylelint, `checks-frontend-syntax` and `checks-suppressions-ratchet` |
|
|
17
|
-
| `exports-baseline.json` | The existing unused exports and types, per file, kind and name | `checks-
|
|
17
|
+
| `exports-baseline.json` | The existing unused exports and types, per file, kind and name | `checks-graphwalk` |
|
|
18
18
|
| `.jscpd.json` | The `path` and `ignore` globs of the files repetition is measured in | jscpd and `checks-repetition` |
|
|
19
|
-
| `knip.config.ts` | The `entry` globs Knip traces unreferenced files from | Knip
|
|
19
|
+
| `knip.config.ts` | The `entry` globs Knip traces unreferenced files from | Knip and `checks-graphwalk` |
|
|
20
20
|
| `stylelint.config.ts` | The Baseline target, the token files, the CSS families the repository turns on, and any stylelint rule the repository sets over the kit's families | `checks-frontend-syntax` |
|
|
21
|
-
| `dependency-cruiser.config.ts` | Entry points nothing imports, paths that may import dev dependencies, and import boundaries, when the kit's defaults do not fit | `checks-
|
|
21
|
+
| `dependency-cruiser.config.ts` | Entry points nothing imports, paths that may import dev dependencies, and import boundaries, when the kit's defaults do not fit | `checks-graphwalk` |
|
|
22
22
|
| `tsconfig.json` | Compiler options, and the Effect language service plugin whose `overrides` and kit severities `checks-effect-scope` writes, keeping every other key | TypeScript and Effect language service |
|
|
23
23
|
| `package.json` | `scripts` with the `checks-vendor` arguments in `prepare`, `author` and `contributors` | Bun, `checks-commit-identity` and `checks-vendor` |
|
|
24
24
|
| `bunfig.toml` | Test discovery and quarantine exclusion | Bun and `checks-test-layout` |
|
|
@@ -69,7 +69,7 @@ import { defineConfig } from "@avi2dg/checks/knip";
|
|
|
69
69
|
export default defineConfig({ entry: ["src/index.ts"] });
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
`dependency-cruiser.config.ts` is optional, since `checks-
|
|
72
|
+
`dependency-cruiser.config.ts` is optional, since `checks-graphwalk` cruises against the kit's defaults without one:
|
|
73
73
|
|
|
74
74
|
```ts
|
|
75
75
|
import { defineConfig } from "@avi2dg/checks/dependency-cruiser";
|
package/docs/design.md
CHANGED
|
@@ -123,10 +123,11 @@ So the three packages move together at one exact version.
|
|
|
123
123
|
`checks-lint` runs each gate in a child process rather than importing it.
|
|
124
124
|
A gate then behaves the same alone or through `checks-lint`, and `lint-coverage.sh` can stay a shell script.
|
|
125
125
|
The gates run one at a time and pass their output straight through, so each report reads whole and in the order of the gate table.
|
|
126
|
-
`checks-lint` picks the gates that apply from the tracked files, and a repository cannot select gates.
|
|
127
|
-
A
|
|
126
|
+
`checks-lint` picks the gates that apply from the tracked files for the full run, and a repository cannot select gates.
|
|
127
|
+
A scoped run selects a subset by changed paths, and the desk run selects the fast tree gates.
|
|
128
|
+
A TypeScript gate applies as soon as the repository tracks TypeScript source, and `checks-lint-coverage` and `checks-graphwalk` also apply on tracked Astro source.
|
|
128
129
|
|
|
129
|
-
dependency-cruiser runs
|
|
130
|
+
dependency-cruiser runs inside the `checks-graphwalk` gate rather than as a script each repository adds to `lint`, so the full run keeps it.
|
|
130
131
|
A repository with no config of its own is cruised against the kit's defaults, since every rule has one.
|
|
131
132
|
The gate cruises the tracked TypeScript, so a build output or a linked library outside git never reaches the cruise.
|
|
132
133
|
It runs dependency-cruiser under Bun, which loads a TypeScript config wherever it sits, the kit's defaults under `node_modules` among them.
|
|
@@ -107,7 +107,7 @@ copy: no violation in 2 file(s) from 2 declared input(s)
|
|
|
107
107
|
|
|
108
108
|
## When it runs
|
|
109
109
|
|
|
110
|
-
`checks-lint` runs it when the repository tracks `copy.json` at its root.
|
|
110
|
+
`checks-lint` runs it in the full run when the repository tracks `copy.json` at its root.
|
|
111
111
|
A repository without that file never runs it and needs no html-validate.
|
|
112
112
|
|
|
113
113
|
## Related topics
|
|
@@ -55,7 +55,7 @@ effect-scope: the @effect/language-service entry in tsconfig.json differs from t
|
|
|
55
55
|
## When it runs
|
|
56
56
|
|
|
57
57
|
A repository runs `checks-effect-scope` from its `build` script, so CI's `git diff --exit-code` after the build fails on a stale `tsconfig.json` too.
|
|
58
|
-
`checks-lint` runs it with `--check` when the repository tracks `oxlint.config.ts`.
|
|
58
|
+
`checks-lint` runs it with `--check` in the full run when the repository tracks `oxlint.config.ts`.
|
|
59
59
|
|
|
60
60
|
## Related topics
|
|
61
61
|
|
|
@@ -177,7 +177,7 @@ frontend-syntax: no violation in 2 file(s) from 2 declared input(s)
|
|
|
177
177
|
|
|
178
178
|
## When it runs
|
|
179
179
|
|
|
180
|
-
`checks-lint` runs it when the repository tracks `frontend-syntax.json` at its root.
|
|
180
|
+
`checks-lint` runs it in the full run when the repository tracks `frontend-syntax.json` at its root.
|
|
181
181
|
A repository without that file never runs it and needs neither `stylelint.config.ts` nor the peers.
|
|
182
182
|
|
|
183
183
|
## Related topics
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: reference
|
|
3
|
+
audience: consumers
|
|
4
|
+
---
|
|
5
|
+
# checks-graphwalk
|
|
6
|
+
|
|
7
|
+
`checks-graphwalk` is the gate that judges unreferenced files, unused exports and import violations together, running Knip once over the working tree for unreferenced files and unused exports and dependency-cruiser once for import violations, plus Knip once more on the base checkout when the range adds baseline entries.
|
|
8
|
+
|
|
9
|
+
## What it checks
|
|
10
|
+
|
|
11
|
+
It runs Knip once with the repository's own configuration and names each `.ts`, `.tsx` or `.astro` file no entry reaches.
|
|
12
|
+
It names each exported value and type no file imports from the same run, so one graph build feeds both findings.
|
|
13
|
+
It reads only the files, exports and types issue types, so an unused dependency never fails it.
|
|
14
|
+
It asks Knip for those issue types itself, so a configuration that narrows `include` or excludes them still judges them.
|
|
15
|
+
A configuration that turns the exports or types rules off silences those symbols, so keep both rules on.
|
|
16
|
+
A configuration that turns the files rule off still has its files judged.
|
|
17
|
+
It holds each reported symbol against `exports-baseline.json`, and fails on any symbol the baseline does not hold.
|
|
18
|
+
It fails on any baseline entry the range adds unless Knip reports that same symbol unused at the base, so the baseline records debt that already existed and never debt the range creates.
|
|
19
|
+
It fails on any baseline entry Knip no longer reports, so the baseline only shrinks.
|
|
20
|
+
It runs dependency-cruiser over every tracked `.ts`, `.tsx`, `.mts` and `.cts` file and names each violation with its rule, the importing module and the module it reaches.
|
|
21
|
+
It fails on a violation whose rule has `error` severity, and lists a `warn` or `info` violation without failing.
|
|
22
|
+
It fails when the repository tracks no `.ts`, `.tsx`, `.astro`, `.mts` or `.cts` file, since an empty scan would pass without judging anything.
|
|
23
|
+
It fails when the repository holds no Knip configuration, since Knip's default entries cannot tell a dead file from an entry point.
|
|
24
|
+
|
|
25
|
+
In a repository whose `package.json` lists `astro` under `dependencies` or `devDependencies`, the kit's defaults leave `no-orphans` out.
|
|
26
|
+
The cruise never reads an `.astro` file, so a `.ts` module only a page imports would read as an orphan.
|
|
27
|
+
The unreferenced-files section already names each file no entry reaches there, and it reads `.astro` imports.
|
|
28
|
+
A repository that wants the rule back lists its own `no-orphans` under `forbidden` in `dependency-cruiser.config.ts`.
|
|
29
|
+
|
|
30
|
+
## What it reads
|
|
31
|
+
|
|
32
|
+
It runs Knip and dependency-cruiser over the working tree, so an uncommitted file is judged like a committed one.
|
|
33
|
+
It reads the repository's Knip configuration, which names the entries.
|
|
34
|
+
The repository writes `knip.config.ts` with the kit's builder, which requires `entry`, the files nothing imports:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { defineConfig } from "@avi2dg/checks/knip";
|
|
38
|
+
|
|
39
|
+
export default defineConfig({ entry: ["src/index.ts"] });
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The builder sets `include` to unreferenced files alone, and adds `tests/**/*.test.ts`, `dependency-cruiser.config.ts` and `oxlint.config.ts` to the entries.
|
|
43
|
+
In a repository that depends on `astro`, Knip reads `.astro` imports, so a file only an `.astro` entry imports counts as used and an `.astro` file no entry reaches is named.
|
|
44
|
+
The gate resolves the Knip binary from the installed kit, so a consumer installs nothing beyond the kit.
|
|
45
|
+
It reads `exports-baseline.json` in the repository root, which holds each accepted unused export as a file, kind and name triple.
|
|
46
|
+
It reads `exports-baseline.json` again at the base of the range, where a commit without the file counts as empty.
|
|
47
|
+
When the range adds baseline entries, it runs Knip again on a temporary checkout of the base and removes the checkout when it ends.
|
|
48
|
+
That checkout links the repository's `node_modules`, so a configuration importing the kit's builder loads there too.
|
|
49
|
+
It cruises against the first config it finds there:
|
|
50
|
+
|
|
51
|
+
1. `dependency-cruiser.config.ts`, which calls `defineConfig` from `@avi2dg/checks/dependency-cruiser`.
|
|
52
|
+
1. A config under one of dependency-cruiser's own names, such as `.dependency-cruiser.cjs`.
|
|
53
|
+
1. The kit's defaults, which `defineConfig()` returns with no argument.
|
|
54
|
+
|
|
55
|
+
It runs dependency-cruiser from the installed kit under Bun, which loads a TypeScript config wherever it sits.
|
|
56
|
+
It leaves out a tracked file the working tree no longer holds.
|
|
57
|
+
|
|
58
|
+
## Arguments
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
checks-graphwalk
|
|
62
|
+
checks-graphwalk <ref>
|
|
63
|
+
checks-graphwalk <base-ref> <head-ref>
|
|
64
|
+
checks-graphwalk --write
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
With no argument it judges `HEAD` alone.
|
|
68
|
+
With one the base is that commit's parent, or the empty tree for a repository's first commit, where nothing counts as already unused.
|
|
69
|
+
With two arguments the base is where the head branched off, at their merge-base.
|
|
70
|
+
When the checked-out commit is a merge of the head ref and one other commit, as a pull request's default checkout is, the base is that other commit instead.
|
|
71
|
+
So under `checks-lint` a pull request's merge checkout is judged against the base branch tip it merges, and a symbol that branch already baselined does not count as added.
|
|
72
|
+
With `--write` it records every unused export and type Knip reports into `exports-baseline.json`, the way `oxlint --suppress-all` seeds `oxlint-suppressions.json`.
|
|
73
|
+
|
|
74
|
+
A repository adopting the gate runs `checks-graphwalk --write` on a branch that changes no source and commits the file it writes.
|
|
75
|
+
The gate passes that range, since Knip reports every seeded symbol unused at the base too.
|
|
76
|
+
A seed written after the range adds a dead export, or after it removes the last import of one, fails on that symbol.
|
|
77
|
+
|
|
78
|
+
## Exit codes
|
|
79
|
+
|
|
80
|
+
| Code | When |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| 0 | no file is unreferenced, no symbol is unlisted, added or stale, and no import breaks an `error` rule, or `--write` recorded the baseline |
|
|
83
|
+
| 1 | a file is unreferenced, a symbol is unlisted, added or stale, an import breaks an `error` rule, or the repository holds no Knip configuration |
|
|
84
|
+
| 2 | a ref does not resolve, a scanner cannot run, or a Knip report, a cruise report or the baseline does not parse |
|
|
85
|
+
|
|
86
|
+
The gate exits 1 when any section reports a violation, and exits 2 only when no section reports one and at least one section cannot decide.
|
|
87
|
+
|
|
88
|
+
It also exits 2 when the repository tracks no `.ts`, `.tsx`, `.astro`, `.mts` or `.cts` file, or, with `--write`, when it tracks no TypeScript file.
|
|
89
|
+
A repository that tracks `.astro` files but no `.ts`, `.tsx`, `.mts` or `.cts` file prints only the unreferenced-files section.
|
|
90
|
+
|
|
91
|
+
## Sample output
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
unused: 1 unreferenced file(s):
|
|
95
|
+
src/dead.ts
|
|
96
|
+
exports: 2 unused export(s) not in exports-baseline.json:
|
|
97
|
+
src/used.ts: unusedExport (export)
|
|
98
|
+
src/used.ts: UnusedOptions (type)
|
|
99
|
+
imports: 1 violation(s) in 5 module(s) cruised against the kit's defaults
|
|
100
|
+
error no-orphans: src/dead.ts
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
A passing run counts what each section judged:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
unused: no unreferenced files among 3 tracked .ts/.tsx/.astro file(s)
|
|
107
|
+
exports: no unused exports or types
|
|
108
|
+
imports: 3 module(s) cruised against the kit's defaults, no violation
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
A passing run with a held baseline counts what it holds:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
exports: 2 unused export(s) in exports-baseline.json, and no new ones
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## When it runs
|
|
118
|
+
|
|
119
|
+
`checks-lint` runs it over each pull request's range when the repository tracks a `.ts`, `.tsx` or `.astro` file.
|
|
120
|
+
Such a repository names its entries in a Knip configuration.
|
|
121
|
+
|
|
122
|
+
## Related topics
|
|
123
|
+
|
|
124
|
+
- [checks-lint](checks-lint.md)
|
|
125
|
+
- [checks-repetition](checks-repetition.md)
|
|
126
|
+
- [The dependency rules](../configs/dependency-rules.md)
|
|
@@ -53,7 +53,7 @@ lint-coverage: the program tsconfig.json builds holds the ts-reset rules is-arra
|
|
|
53
53
|
|
|
54
54
|
## When it runs
|
|
55
55
|
|
|
56
|
-
`checks-lint` runs it when the repository tracks a `.ts`, `.tsx` or `.astro` file.
|
|
56
|
+
`checks-lint` runs it in the full run when the repository tracks a `.ts`, `.tsx` or `.astro` file.
|
|
57
57
|
|
|
58
58
|
## Related topics
|
|
59
59
|
|
|
@@ -4,13 +4,18 @@ audience: consumers
|
|
|
4
4
|
---
|
|
5
5
|
# checks-lint
|
|
6
6
|
|
|
7
|
-
`checks-lint` runs every applicable kit lint gate over one range and reports each failure.
|
|
7
|
+
`checks-lint` runs every applicable kit lint gate in the selected set over one range and reports each failure.
|
|
8
8
|
|
|
9
9
|
## What it checks
|
|
10
10
|
|
|
11
11
|
It runs the gates under [What runs](../bins.md#what-runs), each in its own process.
|
|
12
|
+
It scopes the run to the gates the change reaches, and the full run stays the fallback.
|
|
13
|
+
Applicability below selects the full run, and a scoped or desk run selects a subset.
|
|
14
|
+
A Markdown change runs the range gates plus `checks-copy`.
|
|
15
|
+
A TypeScript source change runs every applicable gate.
|
|
16
|
+
A test file classifies as TypeScript, so its change runs every applicable gate too.
|
|
12
17
|
Gates requiring tracked TypeScript files begin running when the repository tracks TypeScript.
|
|
13
|
-
`checks-lint-coverage` and `checks-
|
|
18
|
+
`checks-lint-coverage` and `checks-graphwalk` also begin running when the repository tracks an `.astro` file.
|
|
14
19
|
`checks-advisories` begins running when the repository tracks `bun.lock`.
|
|
15
20
|
`checks-lint` defers its scan to the scheduled run, so the desk and the pull request fetch no database.
|
|
16
21
|
`checks-frontend-syntax` begins running when the repository tracks `frontend-syntax.json` at its root.
|
|
@@ -31,16 +36,19 @@ Tree gates read the working tree rather than the range.
|
|
|
31
36
|
|
|
32
37
|
```sh
|
|
33
38
|
checks-lint
|
|
34
|
-
checks-lint
|
|
39
|
+
checks-lint [--full | --desk]
|
|
40
|
+
checks-lint [--full | --desk] <base-ref> <head-ref>
|
|
35
41
|
```
|
|
36
42
|
|
|
37
43
|
With two arguments, the base and head override range discovery.
|
|
44
|
+
`--full` forces the unscoped run.
|
|
45
|
+
`--desk` runs the fast tree gates.
|
|
38
46
|
|
|
39
47
|
## Exit codes
|
|
40
48
|
|
|
41
49
|
| Code | Result |
|
|
42
50
|
| --- | --- |
|
|
43
|
-
| 0 | Every
|
|
51
|
+
| 0 | Every gate that ran passed. |
|
|
44
52
|
| 1 | At least one gate found a violation. |
|
|
45
53
|
| 2 | The range could not resolve or no failed gate could decide. |
|
|
46
54
|
|
|
@@ -50,7 +58,7 @@ With two arguments, the base and head override range discovery.
|
|
|
50
58
|
|
|
51
59
|
```
|
|
52
60
|
checks-lint: range 2504acf098d120e73a8ece3c96f22b934f35c6a8..10ba7d8935b73ed72624120a1542e51bd21ca7c7 from HEAD against origin/main
|
|
53
|
-
checks-lint: 1 of
|
|
61
|
+
checks-lint: 1 of 17 gate(s) failed: checks-comment-gate
|
|
54
62
|
```
|
|
55
63
|
|
|
56
64
|
<!-- end generated lint-sample -->
|
|
@@ -58,8 +66,9 @@ checks-lint: 1 of 19 gate(s) failed: checks-comment-gate
|
|
|
58
66
|
## When it runs
|
|
59
67
|
|
|
60
68
|
A repository runs it from `bun run lint` in a pull request workflow that fetches the whole git history.
|
|
61
|
-
It leaves out the TypeScript gates while the repository tracks no TypeScript file, except that `checks-lint-coverage` and `checks-
|
|
69
|
+
It leaves out the TypeScript gates while the repository tracks no TypeScript file, except that `checks-lint-coverage` and `checks-graphwalk` run when it tracks an `.astro` file.
|
|
62
70
|
It never runs `checks-browser`, which a product runs after it builds its site.
|
|
71
|
+
A pull request run scopes the gates to the change.
|
|
63
72
|
|
|
64
73
|
## Related topics
|
|
65
74
|
|
|
@@ -51,10 +51,10 @@ no-plain-js: 2 violation(s)
|
|
|
51
51
|
|
|
52
52
|
## When it runs
|
|
53
53
|
|
|
54
|
-
`checks-lint` runs it when the repository tracks TypeScript.
|
|
54
|
+
`checks-lint` runs it in the full run when the repository tracks TypeScript.
|
|
55
55
|
|
|
56
56
|
## Related topics
|
|
57
57
|
|
|
58
58
|
- [checks-lint](checks-lint.md)
|
|
59
59
|
- [checks-test-layout](checks-test-layout.md)
|
|
60
|
-
- [checks-
|
|
60
|
+
- [checks-graphwalk](checks-graphwalk.md)
|
|
@@ -87,7 +87,7 @@ test-layout: 4 violation(s)
|
|
|
87
87
|
|
|
88
88
|
## When it runs
|
|
89
89
|
|
|
90
|
-
`checks-lint` runs it when the repository tracks TypeScript.
|
|
90
|
+
`checks-lint` runs it in the full run when the repository tracks TypeScript.
|
|
91
91
|
A repository without TypeScript needs neither the `checks-test` script nor `bunfig.toml`.
|
|
92
92
|
|
|
93
93
|
## Related topics
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avi2dg/checks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.1",
|
|
4
4
|
"description": "Deterministic checks shared across a set of TypeScript repositories",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "avi2d",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"src/core/gates.ts",
|
|
35
35
|
"src/core/declared-inputs.ts",
|
|
36
36
|
"src/core/lint.ts",
|
|
37
|
+
"src/core/scope.ts",
|
|
37
38
|
"src/delivery/changelog.ts",
|
|
38
39
|
"src/delivery/changelog-write.ts",
|
|
39
40
|
"src/delivery/release-notes.ts",
|
|
@@ -89,8 +90,7 @@
|
|
|
89
90
|
"src/quality/browser/",
|
|
90
91
|
"src/complexity/suppressions-ratchet.ts",
|
|
91
92
|
"src/complexity/repetition.ts",
|
|
92
|
-
"src/complexity/
|
|
93
|
-
"src/complexity/exports.ts",
|
|
93
|
+
"src/complexity/graphwalk.ts",
|
|
94
94
|
"src/complexity/knip.ts",
|
|
95
95
|
"src/testing/quarantine-clock.ts",
|
|
96
96
|
"src/docs/sentence-length.ts",
|
|
@@ -120,7 +120,6 @@
|
|
|
120
120
|
"src/quality/presets/stylelint.ts",
|
|
121
121
|
"src/quality/effect-scope.ts",
|
|
122
122
|
"src/quality/jsonc-patch.ts",
|
|
123
|
-
"src/dependencies/imports.ts",
|
|
124
123
|
"src/dependencies/kit-defaults.ts",
|
|
125
124
|
"oxlintrc.json",
|
|
126
125
|
"stryker.preset.js",
|
|
@@ -187,8 +186,7 @@
|
|
|
187
186
|
"checks-css-size": "src/quality/css-size.ts",
|
|
188
187
|
"checks-suppressions-ratchet": "src/complexity/suppressions-ratchet.ts",
|
|
189
188
|
"checks-repetition": "src/complexity/repetition.ts",
|
|
190
|
-
"checks-
|
|
191
|
-
"checks-exports": "src/complexity/exports.ts",
|
|
189
|
+
"checks-graphwalk": "src/complexity/graphwalk.ts",
|
|
192
190
|
"checks-quarantine-clock": "src/testing/quarantine-clock.ts",
|
|
193
191
|
"checks-docs": "src/docs/docs.ts",
|
|
194
192
|
"checks-copy": "src/docs/copy.ts",
|
|
@@ -200,11 +198,11 @@
|
|
|
200
198
|
"checks-frontend-syntax": "src/quality/frontend-syntax.ts",
|
|
201
199
|
"checks-no-plain-js": "src/quality/no-plain-js.ts",
|
|
202
200
|
"checks-browser": "src/quality/browser/browser.ts",
|
|
203
|
-
"checks-imports": "src/dependencies/imports.ts",
|
|
204
201
|
"checks-effect-scope": "src/quality/effect-scope.ts"
|
|
205
202
|
},
|
|
206
203
|
"scripts": {
|
|
207
204
|
"prepare": "bun src/dependencies/vendor.ts --library effect --package effect --repository https://github.com/Effect-TS/effect.git --tag 'effect@{version}' --path packages/effect/package.json",
|
|
205
|
+
"desk": "bun run test:fast && bun src/core/lint.ts --desk",
|
|
208
206
|
"build": "bun build src/quality/effect-channel/index.ts --outdir dist/effect-channel --target node --format esm && bun build src/complexity/readability/index.ts --outdir dist/readability --target node --format esm && bun build src/quality/data-shape/index.ts --outdir dist/data-shape --target node --format esm && bun build src/testing/mutation-guard-plugin.ts src/testing/mutation-refusal.ts src/testing/unit-test-order.ts --outdir dist/mutation --target node --format esm --packages external && bun build src/quality/presets/oxlint.ts src/quality/presets/knip.ts src/quality/presets/dependency-cruiser.ts src/quality/presets/stylelint.ts --outdir dist/presets --target node --format esm --packages external && tsc -p tsconfig.presets.json && bun scripts/configs-write.ts && bun src/quality/effect-scope.ts && bun scripts/doc-templates-write.ts && bun src/delivery/changelog-write.ts && bun scripts/doc-blocks-write.ts",
|
|
209
207
|
"lint": "oxlint && bun src/core/lint.ts",
|
|
210
208
|
"typecheck": "tsc --noEmit && effect-tsgo diagnostics --project tsconfig.json --format text --strict",
|