pr-checkmate 2.1.2 → 3.0.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/README.md +63 -268
- package/cspell.json +470 -447
- package/dist/cli.js +1 -1
- package/dist/config/constants.d.ts +6 -1
- package/dist/config/constants.js +9 -7
- package/dist/config/index.d.ts +23 -11
- package/dist/config/index.js +27 -33
- package/dist/core/checks/dependencies/banned-imports.js +4 -1
- package/dist/core/checks/dependencies/circular-deps.js +14 -5
- package/dist/core/checks/dependencies/dependency-check.js +1 -1
- package/dist/core/checks/dependencies/grype-scan.js +2 -1
- package/dist/core/checks/dependencies/vuln-scan.js +2 -1
- package/dist/core/checks/findings.d.ts +46 -2
- package/dist/core/checks/findings.js +140 -2
- package/dist/core/checks/git/custom-rules.js +2 -0
- package/dist/core/checks/git/diff-smell.js +6 -1
- package/dist/core/checks/git/leftover-debug.js +8 -2
- package/dist/core/checks/git/lockfile-drift.js +6 -1
- package/dist/core/checks/git/merge-conflict.js +1 -1
- package/dist/core/checks/git/missing-tests.js +1 -1
- package/dist/core/checks/git/todo-fixme.js +10 -2
- package/dist/core/checks/languages/cpp-format.js +19 -42
- package/dist/core/checks/languages/external-checks.d.ts +77 -0
- package/dist/core/checks/languages/external-checks.js +200 -0
- package/dist/core/checks/languages/external-runner.d.ts +119 -0
- package/dist/core/checks/languages/external-runner.js +143 -0
- package/dist/core/checks/languages/go-format.d.ts +4 -4
- package/dist/core/checks/languages/go-format.js +151 -30
- package/dist/core/checks/languages/lint.js +19 -19
- package/dist/core/checks/languages/prettier.js +2 -7
- package/dist/core/checks/languages/python-typecheck.d.ts +10 -5
- package/dist/core/checks/languages/python-typecheck.js +161 -37
- package/dist/core/checks/languages/ruff-shared.d.ts +3 -3
- package/dist/core/checks/languages/ruff-shared.js +27 -4
- package/dist/core/checks/languages/typecheck.js +10 -8
- package/dist/core/checks/pr/commitlint.js +7 -1
- package/dist/core/checks/quality/case-collision.js +6 -4
- package/dist/core/checks/quality/config-validation.d.ts +0 -7
- package/dist/core/checks/quality/config-validation.js +30 -0
- package/dist/core/checks/quality/coverage.js +6 -1
- package/dist/core/checks/quality/dead-code.js +12 -3
- package/dist/core/checks/quality/duplicate-check.js +54 -27
- package/dist/core/checks/quality/license-header.js +7 -4
- package/dist/core/checks/quality/markdown-lint.js +1 -6
- package/dist/core/checks/quality/package-size.d.ts +15 -0
- package/dist/core/checks/quality/package-size.js +130 -0
- package/dist/core/checks/quality/spellcheck.js +34 -5
- package/dist/core/checks/quality/symlinks.js +6 -4
- package/dist/core/checks/security/diff-security.js +26 -18
- package/dist/core/checks/security/dockerfile-security.js +7 -1
- package/dist/core/checks/security/migration-safety.js +32 -4
- package/dist/core/checks/security/security.d.ts +56 -0
- package/dist/core/checks/security/security.js +135 -11
- package/dist/core/checks/security/sensitive-file-guard.js +40 -6
- package/dist/core/checks/security/workflow-security.js +7 -1
- package/dist/core/checks/tool-install.d.ts +102 -0
- package/dist/core/checks/tool-install.js +69 -0
- package/dist/core/commands.js +1 -0
- package/dist/core/context.js +9 -1
- package/dist/core/install/cache.d.ts +20 -1
- package/dist/core/install/cache.js +65 -12
- package/dist/core/install/doctor.js +49 -15
- package/dist/core/install/ensure.d.ts +31 -14
- package/dist/core/install/ensure.js +165 -61
- package/dist/core/install/lock.d.ts +2 -1
- package/dist/core/install/merge.d.ts +47 -0
- package/dist/core/install/merge.js +91 -0
- package/dist/core/install/prepare.d.ts +76 -0
- package/dist/core/install/prepare.js +147 -0
- package/dist/core/install/profiles.d.ts +17 -3
- package/dist/core/install/profiles.js +27 -0
- package/dist/core/install/reuse.d.ts +41 -0
- package/dist/core/install/reuse.js +107 -0
- package/dist/core/registry.js +12 -18
- package/dist/core/run-checks.js +74 -3
- package/dist/core/targets.d.ts +116 -5
- package/dist/core/targets.js +101 -16
- package/dist/core/types.d.ts +8 -2
- package/dist/init.js +21 -1
- package/dist/interfaces/index.d.ts +6 -0
- package/dist/utils/resolve-bin.d.ts +56 -6
- package/dist/utils/resolve-bin.js +136 -26
- package/gitleaks.toml +14 -0
- package/install-manifests/commitlint/package-lock.json +128 -250
- package/install-manifests/commitlint/package.json +2 -2
- package/install-manifests/core/package-lock.json +76 -76
- package/install-manifests/core/package.json +1 -1
- package/install-manifests/duplicate/package-lock.json +45 -45
- package/install-manifests/duplicate/package.json +1 -1
- package/install-manifests/go/package-lock.json +24 -0
- package/install-manifests/go/package.json +8 -0
- package/install-manifests/js/package-lock.json +248 -283
- package/install-manifests/js/package.json +9 -9
- package/install-manifests/python/package-lock.json +4 -4
- package/install-manifests/python/package.json +1 -1
- package/install-manifests/pytypes/package-lock.json +45 -0
- package/install-manifests/pytypes/package.json +8 -0
- package/package.json +21 -19
- package/pr-checkmate.schema.json +41 -13
- package/src/config/cspell.json +470 -447
- package/src/config/pr-checkmate.schema.json +41 -13
- package/dist/core/checks/languages/csharp-format.d.ts +0 -13
- package/dist/core/checks/languages/csharp-format.js +0 -52
- package/dist/core/checks/languages/go-lint.d.ts +0 -8
- package/dist/core/checks/languages/go-lint.js +0 -48
- package/dist/core/checks/languages/kotlin-lint.d.ts +0 -2
- package/dist/core/checks/languages/kotlin-lint.js +0 -42
- package/dist/core/checks/languages/php-format.d.ts +0 -9
- package/dist/core/checks/languages/php-format.js +0 -49
- package/dist/core/checks/languages/ruby-lint.d.ts +0 -8
- package/dist/core/checks/languages/ruby-lint.js +0 -50
- package/dist/core/checks/languages/rust-format.d.ts +0 -9
- package/dist/core/checks/languages/rust-format.js +0 -45
- package/dist/core/checks/languages/rust-lint.d.ts +0 -8
- package/dist/core/checks/languages/rust-lint.js +0 -50
- package/dist/core/checks/languages/shellcheck.d.ts +0 -8
- package/dist/core/checks/languages/shellcheck.js +0 -55
- package/dist/core/checks/languages/swift-lint.d.ts +0 -2
- package/dist/core/checks/languages/swift-lint.js +0 -46
package/README.md
CHANGED
|
@@ -12,320 +12,115 @@
|
|
|
12
12
|
[](https://pr-checkmate-docs.pages.dev)
|
|
13
13
|
[](https://github.com/users/Mybono/packages/container/package/pr-checkmate)
|
|
14
14
|
|
|
15
|
-
>
|
|
16
|
-
>
|
|
17
|
-
>
|
|
18
|
-
>
|
|
19
|
-
> per-language toolchain
|
|
20
|
-
|
|
21
|
-
Every release is published with a CycloneDX SBOM and an independent
|
|
22
|
-
[VirusTotal scan report](https://github.com/Mybono/pr_checkmate_public/releases/latest)
|
|
23
|
-
of the exact npm tarball, attached to that version's
|
|
24
|
-
[GitHub release notes](https://github.com/Mybono/pr_checkmate_public/releases/latest).
|
|
25
|
-
|
|
26
|
-
## Why PR CheckMate
|
|
27
|
-
|
|
28
|
-
Most teams wire up a different tool for each concern, in every repo, per language:
|
|
29
|
-
ESLint or Ruff or SwiftLint for lint, Prettier or `gofmt` or `rustfmt` for format,
|
|
30
|
-
gitleaks for secrets, `npm audit` or grype for dependency risk — each with its own
|
|
31
|
-
install step, its own config file, its own version to keep pinned. PR CheckMate
|
|
32
|
-
replaces that whole stack with one npm package and one `pr-checkmate.json`: lint,
|
|
33
|
-
format, type-check, secret scanning, dependency risk, and SBOM/VirusTotal-verified
|
|
34
|
-
releases, for all 11 supported languages, configured in one place instead of stitched
|
|
35
|
-
together tool by tool, language by language. You add one step to a GitHub Actions
|
|
36
|
-
workflow and everything runs on every PR.
|
|
37
|
-
|
|
38
|
-
- Secret scanning on every diff. gitleaks runs on every PR, bundled, no setup.
|
|
39
|
-
- Verifiable releases. Every version ships a CycloneDX SBOM and an independent
|
|
40
|
-
VirusTotal scan of the exact published tarball, attached to the GitHub release.
|
|
41
|
-
- Dependency risk visibility. License compliance, `npm audit`, and osv-scanner/grype
|
|
42
|
-
vulnerability scans.
|
|
43
|
-
|
|
44
|
-
Also included, bundled the same way:
|
|
45
|
-
|
|
46
|
-
- One package, any stack. Language is auto-detected from the repo.
|
|
47
|
-
- Bundled tooling. ESLint, Prettier, Ruff, clang-format, and gitleaks run inside the
|
|
48
|
-
package (WASM/JS), so clients install nothing for those languages.
|
|
49
|
-
- Delta mode. A PR run checks only the changed files; outside CI the default is every tracked
|
|
50
|
-
file. `--full` forces that anywhere, and a run that cannot resolve its base falls back to it.
|
|
51
|
-
- Parallel phases. Checks run concurrently within each phase: blocking, then
|
|
52
|
-
informational, then format.
|
|
53
|
-
- Reports in the PR. Results post as a single comment that updates in place, and
|
|
54
|
-
formatter fixes are committed back to the branch.
|
|
55
|
-
- Tunable. Any check can be re-scoped, downgraded, or disabled in `pr-checkmate.json`.
|
|
56
|
-
|
|
57
|
-
## Security & Supply Chain
|
|
58
|
-
|
|
59
|
-
- Secret scanning. gitleaks runs on every diff, bundled, no setup.
|
|
60
|
-
- Verifiable releases. Every version ships a CycloneDX SBOM and an independent
|
|
61
|
-
[VirusTotal scan](https://github.com/Mybono/pr_checkmate_public/releases/latest) of
|
|
62
|
-
the exact published npm tarball, attached to that version's GitHub release notes.
|
|
63
|
-
- Dependency risk. License compliance, `npm audit`, a cross-language vulnerability scan
|
|
64
|
-
(osv-scanner, opt-in), and a direct-dependency vulnerability scan (grype, on by
|
|
65
|
-
default).
|
|
66
|
-
- CI/CD hardening. GitHub Actions workflow and Dockerfile security checks run as part
|
|
67
|
-
of the universal git-diff checks below.
|
|
15
|
+
> A security-first PR gate for CI: secret scanning, dependency vulnerability checks, and
|
|
16
|
+
> a CycloneDX SBOM plus an independent
|
|
17
|
+
> [VirusTotal scan](https://github.com/Mybono/pr_checkmate_public/releases/latest) of the
|
|
18
|
+
> exact published tarball on every release — plus 53 code-quality checks across 11
|
|
19
|
+
> languages, bundled. One npm package, one `pr-checkmate.json`, no per-language toolchain
|
|
20
|
+
> setup for the bundled ones.
|
|
68
21
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Bundled languages need nothing on the runner. Runner-dependency languages need their
|
|
72
|
-
tool installed; the check skips gracefully when the tool is absent.
|
|
73
|
-
|
|
74
|
-
| Language | Checks | Toolchain |
|
|
75
|
-
|---|---|---|
|
|
76
|
-
| TypeScript / JavaScript | ESLint, Prettier, `tsc --noEmit` | Bundled |
|
|
77
|
-
| Python | Ruff (lint + format), mypy/pyright (types) | Ruff bundled; types need mypy or pyright on the runner |
|
|
78
|
-
| C++ | clang-format | Bundled |
|
|
79
|
-
| Swift | SwiftLint | `swiftlint` on the runner |
|
|
80
|
-
| Kotlin / Java | ktlint | `ktlint` on the runner |
|
|
81
|
-
| Go | `go vet`, `gofmt` | Go toolchain on the runner |
|
|
82
|
-
| Rust | `cargo clippy`, `cargo fmt` | Rust toolchain on the runner |
|
|
83
|
-
| C# | `dotnet format` | .NET SDK on the runner |
|
|
84
|
-
| Ruby | RuboCop | `rubocop` on the runner |
|
|
85
|
-
| PHP | PHP-CS-Fixer | `php-cs-fixer` on the runner |
|
|
86
|
-
| Shell | ShellCheck | `shellcheck` on the runner |
|
|
87
|
-
|
|
88
|
-
Secret scanning (gitleaks) and the universal git-diff checks are bundled and run for
|
|
89
|
-
every language.
|
|
22
|
+
Language is auto-detected. Checks run in parallel phases, results post as one PR comment
|
|
23
|
+
that updates in place, and formatter fixes are committed back to the branch.
|
|
90
24
|
|
|
91
25
|
## Quickstart
|
|
92
26
|
|
|
93
|
-
Install
|
|
27
|
+
**1. Install.**
|
|
94
28
|
|
|
95
29
|
```bash
|
|
96
30
|
npm install --save-dev pr-checkmate
|
|
97
31
|
```
|
|
98
32
|
|
|
99
|
-
|
|
100
|
-
|
|
33
|
+
**2. Set it up.** `init` detects your languages and writes `pr-checkmate.json` plus
|
|
34
|
+
`.github/workflows/pr-checkmate.yml`. Safe to re-run — it updates the config rather than
|
|
35
|
+
replacing it, and never overwrites a workflow that already exists.
|
|
101
36
|
|
|
102
37
|
```bash
|
|
103
38
|
npx pr-checkmate init
|
|
104
39
|
```
|
|
105
40
|
|
|
106
|
-
Run
|
|
41
|
+
**3. Run.**
|
|
107
42
|
|
|
108
43
|
```bash
|
|
109
44
|
npx pr-checkmate all
|
|
110
45
|
```
|
|
111
46
|
|
|
112
|
-
Scope
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
reviews every tracked file. It used to fall back to `HEAD^` there too, so a local run saw
|
|
116
|
-
only the last commit and would report a clean project with a `debugger` committed the day
|
|
117
|
-
before. `--full` forces the whole-repo review anywhere, including inside a CI build, and it
|
|
118
|
-
composes with any command:
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
npx pr-checkmate all --full
|
|
122
|
-
npx pr-checkmate lint --full
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Only three checks genuinely need a diff and drop out of a full scan — PR Size, Missing
|
|
126
|
-
Tests and Lockfile Drift. Everything else, the whole security family included, scans the
|
|
127
|
-
working tree when there is no diff to read. The
|
|
128
|
-
[per-check reference](https://github.com/Mybono/pr_checkmate_public/blob/main/documentation/checks/INDEX.md)
|
|
129
|
-
spells out the rules under "Review scope".
|
|
130
|
-
|
|
131
|
-
### Running in CI without installing
|
|
132
|
-
|
|
133
|
-
**Use the container.** With no `node_modules` to reuse, a cold `npx` downloads 547 MB and
|
|
134
|
-
takes about five minutes — on every job. The image carries the whole toolchain already:
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
docker run --rm -v "$PWD:/repo" --user "$(id -u):$(id -g)" \
|
|
138
|
-
ghcr.io/mybono/pr-checkmate:latest all
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
161 MB pulled once and cached by the runner, and the checks that need a binary on the
|
|
142
|
-
machine — ShellCheck among them — are inside, so they stop silently skipping. Pin the
|
|
143
|
-
version tag (`:2.0.0`) for a reproducible pipeline; `--user` keeps files that formatters
|
|
144
|
-
rewrite owned by you rather than by root.
|
|
145
|
-
|
|
146
|
-
Verify what you pulled — the image carries SLSA provenance and an SBOM, attached to
|
|
147
|
-
the image itself in the registry:
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
docker buildx imagetools inspect ghcr.io/mybono/pr-checkmate:2 \
|
|
151
|
-
--format '{{ json .Provenance }}'
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
[All tags →](https://github.com/users/Mybono/packages/container/package/pr-checkmate)
|
|
47
|
+
**Scope.** In CI it reviews the pull request diff; locally, every tracked file. `--full`
|
|
48
|
+
forces the whole repository anywhere. Only PR Size, Missing Tests and Lockfile Drift need a
|
|
49
|
+
diff and drop out of a full run.
|
|
155
50
|
|
|
156
|
-
|
|
51
|
+
### CI only — no install
|
|
157
52
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
config from, so the run silently falls back to the defaults with no file to tune.
|
|
161
|
-
`npx pr-checkmate init` is no help either, since the package is not kept around.
|
|
53
|
+
Two files, taken straight from the public repository. Nothing goes into your
|
|
54
|
+
`package.json`.
|
|
162
55
|
|
|
163
|
-
|
|
56
|
+
- **[pr-checkmate-workflow.yml](https://github.com/Mybono/pr_checkmate_public/blob/main/pr-checkmate-workflow.yml)** → put in `.github/workflows/`.
|
|
57
|
+
Runs the container, image tag already pinned.
|
|
58
|
+
- **[pr-checkmate.json](https://github.com/Mybono/pr_checkmate_public/blob/main/pr-checkmate.json)** → put in the repository root. Every check
|
|
59
|
+
with its default value and a comment.
|
|
164
60
|
|
|
165
|
-
|
|
166
|
-
curl -fsSL -O https://raw.githubusercontent.com/Mybono/pr_checkmate_public/main/pr-checkmate.json
|
|
167
|
-
```
|
|
61
|
+
Commit both and it runs on the next pull request. Both are regenerated on every release.
|
|
168
62
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
editor autocompletion, and the template already references it:
|
|
173
|
-
|
|
174
|
-
```text
|
|
175
|
-
https://raw.githubusercontent.com/Mybono/pr_checkmate_public/main/pr-checkmate.schema.json
|
|
176
|
-
```
|
|
63
|
+
[Running in CI →](https://github.com/Mybono/pr_checkmate_public/blob/main/documentation/ci-setup.md) — the generated workflow line by
|
|
64
|
+
line, which three lines are load-bearing, adopting it on a codebase that is not clean
|
|
65
|
+
yet, and the setup step each runner-dependency language needs.
|
|
177
66
|
|
|
178
|
-
|
|
179
|
-
installed version.
|
|
180
|
-
|
|
181
|
-
## GitHub Actions
|
|
182
|
-
|
|
183
|
-
`init` generates this workflow; it is reproduced here so nothing about it is a
|
|
184
|
-
surprise. One job runs the whole registry — which checks run is decided in
|
|
185
|
-
`pr-checkmate.json`, not by copying YAML.
|
|
186
|
-
|
|
187
|
-
```yaml
|
|
188
|
-
name: PR CheckMate
|
|
189
|
-
on:
|
|
190
|
-
pull_request:
|
|
191
|
-
branches: [main]
|
|
192
|
-
|
|
193
|
-
permissions:
|
|
194
|
-
contents: read
|
|
195
|
-
pull-requests: write
|
|
196
|
-
|
|
197
|
-
jobs:
|
|
198
|
-
pr-checkmate:
|
|
199
|
-
runs-on: ubuntu-latest
|
|
200
|
-
steps:
|
|
201
|
-
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
202
|
-
with: { fetch-depth: 0 }
|
|
203
|
-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
204
|
-
with: { node-version: 24, cache: 'npm' }
|
|
205
|
-
- run: npm ci
|
|
206
|
-
- name: Run PR CheckMate
|
|
207
|
-
env:
|
|
208
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
209
|
-
run: npx pr-checkmate all
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
Three lines are load-bearing:
|
|
213
|
-
|
|
214
|
-
- `fetch-depth: 0` — without the full history the PR base is not in the clone, no
|
|
215
|
-
diff range can be built, and every diff-based check skips itself. The run says so
|
|
216
|
-
(`Scan Scope: … set fetch-depth: 0`) rather than reporting a clean pass.
|
|
217
|
-
- `GITHUB_TOKEN` — Actions does not put it in the environment on its own. Without it
|
|
218
|
-
the checks still run, but the summary comment never reaches the PR.
|
|
219
|
-
- no `continue-on-error` — a gate that cannot fail the job is not a gate.
|
|
67
|
+
## Language Support
|
|
220
68
|
|
|
221
|
-
|
|
69
|
+
Bundled languages need nothing on the runner. Runner-dependency languages need their
|
|
70
|
+
tool installed; the check skips gracefully when the tool is absent.
|
|
222
71
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
72
|
+
| Language | Checks | Toolchain |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| TypeScript / JavaScript | ESLint, Prettier, `tsc --noEmit` | Bundled |
|
|
75
|
+
| Python | Ruff (lint + format), mypy/pyright (types) | Bundled — Ruff, and pyright for types; the runner's own mypy is preferred when it has one |
|
|
76
|
+
| C++ | clang-format | Bundled |
|
|
77
|
+
| Swift | SwiftLint | `swiftlint` on the runner |
|
|
78
|
+
| Kotlin / Java | ktlint | `ktlint` on the runner |
|
|
79
|
+
| Go | `go vet`, gofmt | gofmt bundled; `go vet` needs the Go toolchain on the runner |
|
|
80
|
+
| Rust | `cargo clippy`, `cargo fmt` | Rust toolchain on the runner |
|
|
81
|
+
| C# | `dotnet format` | .NET SDK on the runner |
|
|
82
|
+
| Ruby | RuboCop | `rubocop` on the runner |
|
|
83
|
+
| PHP | PHP-CS-Fixer | `php-cs-fixer` on the runner |
|
|
84
|
+
| Shell | ShellCheck | `shellcheck` on the runner |
|
|
226
85
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
// everything advisory to begin with…
|
|
230
|
-
"severityDefaults": { "failOn": "warn" },
|
|
231
|
-
// …except the ones you are ready to enforce
|
|
232
|
-
"severity": {
|
|
233
|
-
"Security Scan": "error",
|
|
234
|
-
"Diff Security": "error",
|
|
235
|
-
"Duplicate Code": "off"
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
```
|
|
86
|
+
Secret scanning (gitleaks) and the universal git-diff checks are bundled and run for
|
|
87
|
+
every language.
|
|
239
88
|
|
|
240
|
-
|
|
241
|
-
offers an advisory workflow if you would rather start there, and it writes a banner
|
|
242
|
-
explaining how to leave that mode. Either way, `init` never overwrites a workflow file
|
|
243
|
-
that already exists.
|
|
89
|
+
## Checks
|
|
244
90
|
|
|
245
|
-
|
|
246
|
-
`actions/setup-go`, Rust with `dtolnay/rust-toolchain`, C# with `actions/setup-dotnet`,
|
|
247
|
-
Ruby with `ruby/setup-ruby` (plus `gem install rubocop`), PHP with
|
|
248
|
-
`shivammathur/setup-php` (tools: `php-cs-fixer`), Kotlin by fetching the `ktlint`
|
|
249
|
-
binary. Swift's `swiftlint` is pre-installed on `macos-latest`, and `shellcheck` is
|
|
250
|
-
pre-installed on `ubuntu-latest` — neither needs a setup step. Anything missing is
|
|
251
|
-
skipped, not failed.
|
|
91
|
+
54 checks, run in parallel within each phase:
|
|
252
92
|
|
|
253
|
-
|
|
93
|
+
| Group | Count | What it covers |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| Universal git-diff | 18 | Secret scan, diff security, GitHub Actions and Dockerfile hardening, migration safety, sensitive files, custom rules, and the rest — language-agnostic and bundled |
|
|
96
|
+
| Per-language | 17 | Lint, format and type-check for the languages above |
|
|
97
|
+
| Dependencies | 7 | Unused/missing, circular, outdated, licence compliance, `npm audit`, and two vulnerability scanners |
|
|
98
|
+
| Quality | 7 | Duplicate code, dead code, spellcheck, markdown, YAML, broken symlinks, config validation |
|
|
99
|
+
| PR hygiene | 4 | Size, title, body, commit-message convention |
|
|
254
100
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
- Universal git-diff (18) — language-agnostic and bundled: merge-conflict markers,
|
|
258
|
-
secret scan, diff security (JS/TS/Python/Go/Kotlin), diff smells, GitHub Actions and
|
|
259
|
-
Dockerfile security, case-collision, custom rules, banned imports, license headers,
|
|
260
|
-
leftover debug lines, lockfile drift, large/binary files, TODO/FIXME, missing tests,
|
|
261
|
-
coverage presence, DB migration safety, and sensitive-file guard.
|
|
262
|
-
- Dependencies (7) — unused/missing, circular, outdated, license compliance, npm audit,
|
|
263
|
-
a cross-language vuln scan (osv-scanner, opt-in), and a direct-dependency vuln scan
|
|
264
|
-
(grype, on by default).
|
|
265
|
-
- Quality (7) — duplicate code, dead code, multi-language spellcheck, markdown lint,
|
|
266
|
-
YAML lint, broken symlinks, config validation.
|
|
267
|
-
- PR hygiene (4) — size, title, body, and commit-message convention.
|
|
268
|
-
- Per-language (17) — lint, format, and type-check for the languages listed above.
|
|
269
|
-
|
|
270
|
-
Each check has its own page in the
|
|
271
|
-
[per-check reference](https://github.com/Mybono/pr_checkmate_public/blob/main/documentation/checks/INDEX.md),
|
|
272
|
-
covering when it runs, the config keys it reads, and how to turn it off.
|
|
101
|
+
[Check reference →](https://github.com/Mybono/pr_checkmate_public/blob/main/documentation/checks/INDEX.md) — every check has its own
|
|
102
|
+
page: when it runs, every config key it reads, the defaults, how to turn it off.
|
|
273
103
|
|
|
274
104
|
## Configuration
|
|
275
105
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
The generated file is short on purpose: it holds your decisions plus a few empty
|
|
280
|
-
blocks for the settings people tune most. Everything else stays implicit — the
|
|
281
|
-
config is merged over the built-in defaults at load time, so new defaults reach
|
|
282
|
-
you on upgrade without editing anything, and `init` is a first-run step rather
|
|
283
|
-
than something to repeat after every release.
|
|
284
|
-
|
|
285
|
-
**[The full configuration, annotated, with every option at its default →](https://github.com/Mybono/pr_checkmate_public/blob/main/pr-checkmate.json)**
|
|
286
|
-
Copy the block you need into your file. The `$schema` line in the generated
|
|
287
|
-
config also gives your editor autocomplete and a description for every key.
|
|
288
|
-
|
|
289
|
-
Three settings REPLACE their default rather than extending it, so copy the
|
|
290
|
-
default before editing: `ignoreDirs`, `duplicate.ignore`, `deadCode.ignoreFiles`.
|
|
291
|
-
|
|
292
|
-
- Severity map. The one universal control. Key any check by its display name (as it
|
|
293
|
-
appears in the report) and set `"error"` to fail the run, `"warn"` for advisory, or
|
|
294
|
-
`"off"` to disable it. This works for every check, old or new.
|
|
295
|
-
- Per-check options. For example `prSize.maxFiles`/`maxLines`, `largeFiles.maxSizeKb`
|
|
296
|
-
and `allow`, `prBody.minLength`, `duplicate.minLines`, `missingTests.ignore`, or
|
|
297
|
-
`<check>.ignore` to mute a single finding. Any check also takes `enabled: false`.
|
|
298
|
-
- `customRules`. Your own regex rules run against the diff; a rule with
|
|
299
|
-
`severity: "error"` blocks the run. Fields: `name`, `pattern`, `message?`,
|
|
300
|
-
`severity?`, `include?`, `exclude?`.
|
|
301
|
-
- `bannedImports` forbids specific dependencies or imports. `licenseHeader` requires a
|
|
302
|
-
header on newly added source files (opt-in).
|
|
303
|
-
- Inline suppression. Append `// pr-checkmate-ignore` to any line to skip it.
|
|
106
|
+
One file, deep-merged over the defaults, so it holds only your deviations. The `severity`
|
|
107
|
+
map keys any check by the name it shows in the report:
|
|
304
108
|
|
|
305
109
|
```jsonc
|
|
306
110
|
{
|
|
307
|
-
// Promote, downgrade, or disable ANY check by its display name.
|
|
308
111
|
"severity": {
|
|
309
112
|
"PR Size": "error", // oversized PRs now fail the run
|
|
310
|
-
"Spellcheck": "off"
|
|
113
|
+
"Spellcheck": "off"
|
|
311
114
|
},
|
|
312
|
-
"prSize": { "maxFiles": 40, "maxLines": 800 }
|
|
313
|
-
"customRules": [
|
|
314
|
-
{ "name": "no-fixme", "pattern": "FIXME", "severity": "error" }
|
|
315
|
-
]
|
|
115
|
+
"prSize": { "maxFiles": 40, "maxLines": 800 }
|
|
316
116
|
// Skip a single line by appending `// pr-checkmate-ignore` to it.
|
|
317
117
|
}
|
|
318
118
|
```
|
|
319
119
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
## PR Summary Comment
|
|
120
|
+
`ignoreDirs`, `duplicate.ignore` and `deadCode.ignoreFiles` REPLACE their defaults rather
|
|
121
|
+
than extending them.
|
|
324
122
|
|
|
325
|
-
|
|
326
|
-
on later pushes, so there are no duplicate comments. Format fixes (Prettier, Ruff,
|
|
327
|
-
clang-format, and the rest) are committed straight back to the branch. Posting needs
|
|
328
|
-
the `pull-requests: write` permission, which the generated workflow already includes.
|
|
123
|
+
[Config guide →](https://github.com/Mybono/pr_checkmate_public/blob/main/documentation/config-guide.md) · [Annotated full config →](https://github.com/Mybono/pr_checkmate_public/blob/main/pr-checkmate.json)
|
|
329
124
|
|
|
330
125
|
## Programmatic API
|
|
331
126
|
|