pr-checkmate 1.23.6 → 1.23.7

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/LICENSE CHANGED
@@ -36,6 +36,20 @@ Any use not expressly permitted in writing by the Owner is strictly
36
36
  prohibited and constitutes a violation of applicable copyright and
37
37
  intellectual property laws.
38
38
 
39
+ ================================================================================
40
+ PUBLIC MIRROR EXCEPTION
41
+ ================================================================================
42
+
43
+ The restrictions above do not prevent the Owner itself from publishing
44
+ selected non-source materials — this LICENSE, the README, the CONTRIBUTING
45
+ and CODE_OF_CONDUCT files, the documentation/ tree, and the configuration
46
+ template and its JSON schema — to a public repository the Owner controls, for
47
+ the sole purpose of giving consumers of the published npm package a reachable
48
+ repository URL and readable documentation. This exception applies only to
49
+ publication carried out by or on behalf of the Owner; it grants no rights to
50
+ any other party to fork, mirror, re-host, or redistribute the Software, and it
51
+ does not extend to the source code itself.
52
+
39
53
  ================================================================================
40
54
  NO WARRANTY
41
55
  ================================================================================
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # ♟️ PR CheckMate
2
2
 
3
- ![Build](https://img.shields.io/github/actions/workflow/status/Mybono/sdk_automation/publish.yml?branch=main&label=CI&color=blue)
3
+ [![npm](https://img.shields.io/npm/v/pr-checkmate?label=npm&color=CB3837&logo=npm&logoColor=white)](https://www.npmjs.com/package/pr-checkmate)
4
+ [![Downloads](https://img.shields.io/npm/dm/pr-checkmate?color=blue)](https://www.npmjs.com/package/pr-checkmate)
4
5
  ![License](https://img.shields.io/badge/license-Proprietary-lightgrey)
5
6
  ![ESLint](https://img.shields.io/badge/ESLint-10-4B32C3?logo=eslint&logoColor=white)
6
7
  ![Prettier](https://img.shields.io/badge/Prettier-3-F7B93E?logo=prettier&logoColor=white)
@@ -9,7 +10,7 @@
9
10
  ![jscpd](https://img.shields.io/badge/jscpd-5-blue)
10
11
  [![API Docs](https://img.shields.io/badge/API_docs-TypeDoc-9600FF?logo=readthedocs&logoColor=white)](https://pr-checkmate-docs.pages.dev)
11
12
 
12
- > PR CheckMate is a universal PR quality checker: one `npm install`, 50 checks across
13
+ > PR CheckMate is a universal PR quality checker: one `npm install`, 51 checks across
13
14
  > 11 languages, running in CI on every pull request. The bundled languages need no
14
15
  > per-language toolchain setup.
15
16
 
@@ -72,6 +73,31 @@ Run all checks:
72
73
  npx pr-checkmate all
73
74
  ```
74
75
 
76
+ ### Running in CI without installing
77
+
78
+ Plenty of repos never add pr-checkmate to `package.json` and call it on the fly in CI
79
+ instead (`npx pr-checkmate`). That works, but there is no `node_modules` to generate a
80
+ config from, so the run silently falls back to the defaults with no file to tune.
81
+ `npx pr-checkmate init` is no help either, since the package is not kept around.
82
+
83
+ Pull the published template instead:
84
+
85
+ ```bash
86
+ curl -fsSL -O https://raw.githubusercontent.com/Mybono/pr_checkmate_public/main/pr-checkmate.json
87
+ ```
88
+
89
+ Commit the file to the repository root and edit it there. Every check appears in it with
90
+ its real default value and a short comment, so switching a check on or off, or changing
91
+ one of its thresholds, is a one-line edit. The JSON schema is published alongside it for
92
+ editor autocompletion, and the template already references it:
93
+
94
+ ```text
95
+ https://raw.githubusercontent.com/Mybono/pr_checkmate_public/main/pr-checkmate.schema.json
96
+ ```
97
+
98
+ Both files are refreshed on every release, so the template never drifts from the
99
+ installed version.
100
+
75
101
  ## GitHub Actions
76
102
 
77
103
  Every workflow follows the same shape: checkout, set up Node, install, run. The
@@ -108,20 +134,24 @@ skipped, not failed.
108
134
 
109
135
  ## Checks
110
136
 
111
- 50 checks, grouped by category and run in parallel within each phase:
137
+ 51 checks, grouped by category and run in parallel within each phase:
112
138
 
113
139
  - Universal git-diff (18) — language-agnostic and bundled: merge-conflict markers,
114
- secret scan, diff security (JS/TS/Python/Go/Kotlin), GitHub Actions and Dockerfile
115
- security, case-collision, custom rules, banned imports, license headers, leftover
116
- debug lines, lockfile drift, large/binary files, TODO/FIXME, missing tests, coverage
117
- presence, DB migration safety, and sensitive-file guard.
140
+ secret scan, diff security (JS/TS/Python/Go/Kotlin), diff smells, GitHub Actions and
141
+ Dockerfile security, case-collision, custom rules, banned imports, license headers,
142
+ leftover debug lines, lockfile drift, large/binary files, TODO/FIXME, missing tests,
143
+ coverage presence, DB migration safety, and sensitive-file guard.
118
144
  - Dependencies (7) — unused/missing, circular, outdated, license compliance, npm audit,
119
145
  a cross-language vuln scan (osv-scanner, opt-in), and a direct-dependency vuln scan
120
146
  (grype, on by default).
121
- - Quality (5) — duplicate code, dead code, multi-language spellcheck, markdown lint, YAML lint.
147
+ - Quality (6) — duplicate code, dead code, multi-language spellcheck, markdown lint, YAML lint, config validation.
122
148
  - PR hygiene (4) — size, title, body, and commit-message convention.
123
149
  - Per-language (16) — lint, format, and type-check for the languages listed above.
124
150
 
151
+ Each check has its own page in the
152
+ [per-check reference](https://github.com/Mybono/pr_checkmate_public/blob/main/documentation/checks/INDEX.md),
153
+ covering when it runs, the config keys it reads, and how to turn it off.
154
+
125
155
  ## Configuration
126
156
 
127
157
  Everything lives in `pr-checkmate.json`. Run `npx pr-checkmate init` to scaffold the
@@ -155,6 +185,9 @@ full file for your detected languages.
155
185
  }
156
186
  ```
157
187
 
188
+ For the complete list of keys each check reads, along with their defaults, see the
189
+ [per-check reference](https://github.com/Mybono/pr_checkmate_public/blob/main/documentation/checks/INDEX.md).
190
+
158
191
  ## PR Summary Comment
159
192
 
160
193
  After `npx pr-checkmate all`, a summary table is posted to the PR and updated in place
package/cspell.json CHANGED
@@ -15,6 +15,7 @@
15
15
  "Accona",
16
16
  "acepto",
17
17
  "Acepto",
18
+ "acmecorp",
18
19
  "ACMR",
19
20
  "ACMRD",
20
21
  "acodec",
@@ -39,6 +40,7 @@
39
40
  "allclose",
40
41
  "Amuta",
41
42
  "análisis",
43
+ "analysers",
42
44
  "Anchore",
43
45
  "androidpublisher",
44
46
  "androidx",
@@ -340,6 +342,7 @@
340
342
  "endoftext",
341
343
  "endtable",
342
344
  "engineio",
345
+ "ENOENT",
343
346
  "eoilist",
344
347
  "Escaneá",
345
348
  "Escaneás",
@@ -684,6 +687,7 @@
684
687
  "mybono",
685
688
  "mydir",
686
689
  "myimage",
690
+ "myinternalservice",
687
691
  "mylib",
688
692
  "myorg",
689
693
  "myprefix",
@@ -812,6 +816,7 @@
812
816
  "preconcurrency",
813
817
  "pretrained",
814
818
  "prettier",
819
+ "println",
815
820
  "Privacidad",
816
821
  "processlist",
817
822
  "progressbar",
@@ -1076,6 +1081,7 @@
1076
1081
  "unsharp",
1077
1082
  "upbit",
1078
1083
  "updateemail",
1084
+ "uppercased",
1079
1085
  "upsell",
1080
1086
  "usecase",
1081
1087
  "usefixtures",
@@ -33,7 +33,11 @@ exports.yamlLintCheck = {
33
33
  return ctx.config.yamlLint?.enabled !== false;
34
34
  },
35
35
  async run(ctx) {
36
- const allTargets = await (0, targets_1.resolveTargetFiles)(ctx, ['*.yml', '*.yaml']);
36
+ // Keep the CI/workflow dirs that are globally ignored: they hold the very
37
+ // YAML (GitHub Actions, GitLab CI, CircleCI) a YAML linter most needs to see.
38
+ const allTargets = await (0, targets_1.resolveTargetFiles)(ctx, ['*.yml', '*.yaml'], {
39
+ keepDirs: ['.github', '.gitlab', '.circleci'],
40
+ });
37
41
  if (allTargets === null)
38
42
  return (0, types_1.skip)('git unavailable');
39
43
  if (allTargets.length === 0)
@@ -11,7 +11,9 @@ import type { CheckContext } from './types';
11
11
  * longer exists) can never hand a missing path to a downstream tool like ESLint
12
12
  * or Prettier, which crash hard on a non-existent pattern.
13
13
  */
14
- export declare function resolveTargetFiles(ctx: CheckContext, globs: string[]): Promise<string[] | null>;
14
+ export declare function resolveTargetFiles(ctx: CheckContext, globs: string[], opts?: {
15
+ keepDirs?: string[];
16
+ }): Promise<string[] | null>;
15
17
  /**
16
18
  * Like {@link resolveTargetFiles} but restricts results to the configured
17
19
  * `sourcePath`(s). Preserves the semantics of the old `sourcePath` full-scan
@@ -16,9 +16,15 @@ const execa_1 = require("../utils/execa");
16
16
  * curated default), matched on any path segment so nesting depth doesn't matter.
17
17
  * Applied to every check's file list so build/tooling/report dirs are never
18
18
  * scanned, even when committed.
19
+ *
20
+ * `keepDirs` un-ignores specific segments for a single check — e.g. YAML lint
21
+ * keeps the CI dirs (`.github`, `.gitlab`, `.circleci`), which are ignored
22
+ * globally but hold the workflow files a YAML linter most needs to see.
19
23
  */
20
- function excludeIgnoredDirs(files) {
24
+ function excludeIgnoredDirs(files, keepDirs = []) {
21
25
  const ignored = new Set((0, config_1.getIgnoredDirs)());
26
+ for (const dir of keepDirs)
27
+ ignored.delete(dir);
22
28
  if (ignored.size === 0)
23
29
  return files;
24
30
  return files.filter(f => !f.split('/').some(segment => ignored.has(segment)));
@@ -35,7 +41,7 @@ function excludeIgnoredDirs(files) {
35
41
  * longer exists) can never hand a missing path to a downstream tool like ESLint
36
42
  * or Prettier, which crash hard on a non-existent pattern.
37
43
  */
38
- async function resolveTargetFiles(ctx, globs) {
44
+ async function resolveTargetFiles(ctx, globs, opts = {}) {
39
45
  try {
40
46
  const args = ctx.baseSha
41
47
  ? [
@@ -57,7 +63,7 @@ async function resolveTargetFiles(ctx, globs) {
57
63
  const files = excludeIgnoredDirs(stdout
58
64
  .split('\n')
59
65
  .map(f => f.trim())
60
- .filter(Boolean)).filter(f => node_fs_1.default.existsSync(node_path_1.default.join(ctx.cwd, f)));
66
+ .filter(Boolean), opts.keepDirs).filter(f => node_fs_1.default.existsSync(node_path_1.default.join(ctx.cwd, f)));
61
67
  utils_1.logger.info(`[targets]: ${ctx.baseSha ? '📂 Delta' : 'Full scan'}: ${files.length} file(s) for ${globs.join(', ')}`);
62
68
  return files;
63
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-checkmate",
3
- "version": "1.23.6",
3
+ "version": "1.23.7",
4
4
  "description": "Automated PR quality checks: linting, formatting, dependency analysis, and spellcheck",
5
5
  "keywords": [
6
6
  "github-actions",
@@ -61,14 +61,14 @@
61
61
  },
62
62
  "repository": {
63
63
  "type": "git",
64
- "url": "git+https://github.com/Mybono/pr_checkmate.git"
64
+ "url": "git+https://github.com/Mybono/pr_checkmate_public.git"
65
65
  },
66
66
  "bugs": {
67
- "url": "https://github.com/Mybono/pr_checkmate/issues"
67
+ "url": "https://github.com/Mybono/pr_checkmate_public/issues"
68
68
  },
69
69
  "homepage": "https://dev.to/deftoexplore/pr-checkmate-stop-debating-style-and-start-coding-ij",
70
70
  "author": "Artur Polishchuk",
71
- "license": "LicenseRef-Proprietary",
71
+ "license": "UNLICENSED",
72
72
  "dependencies": {
73
73
  "@astral-sh/ruff-wasm-nodejs": "^0.15.20",
74
74
  "@commitlint/cli": "^21.2.0",
@@ -105,5 +105,13 @@
105
105
  "devDependencies": {
106
106
  "standard-version": "^9.5.0",
107
107
  "typedoc": "^0.28.20"
108
+ },
109
+ "overrides": {
110
+ "markdownlint-cli2": {
111
+ "js-yaml": "5.2.2"
112
+ },
113
+ "cosmiconfig": {
114
+ "js-yaml": "4.3.0"
115
+ }
108
116
  }
109
117
  }
@@ -15,6 +15,7 @@
15
15
  "Accona",
16
16
  "acepto",
17
17
  "Acepto",
18
+ "acmecorp",
18
19
  "ACMR",
19
20
  "ACMRD",
20
21
  "acodec",
@@ -39,6 +40,7 @@
39
40
  "allclose",
40
41
  "Amuta",
41
42
  "análisis",
43
+ "analysers",
42
44
  "Anchore",
43
45
  "androidpublisher",
44
46
  "androidx",
@@ -340,6 +342,7 @@
340
342
  "endoftext",
341
343
  "endtable",
342
344
  "engineio",
345
+ "ENOENT",
343
346
  "eoilist",
344
347
  "Escaneá",
345
348
  "Escaneás",
@@ -684,6 +687,7 @@
684
687
  "mybono",
685
688
  "mydir",
686
689
  "myimage",
690
+ "myinternalservice",
687
691
  "mylib",
688
692
  "myorg",
689
693
  "myprefix",
@@ -812,6 +816,7 @@
812
816
  "preconcurrency",
813
817
  "pretrained",
814
818
  "prettier",
819
+ "println",
815
820
  "Privacidad",
816
821
  "processlist",
817
822
  "progressbar",
@@ -1076,6 +1081,7 @@
1076
1081
  "unsharp",
1077
1082
  "upbit",
1078
1083
  "updateemail",
1084
+ "uppercased",
1079
1085
  "upsell",
1080
1086
  "usecase",
1081
1087
  "usefixtures",