pr-checkmate 1.23.6 → 1.23.8

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
@@ -11,16 +11,21 @@ This software and its source code, documentation, data, models, and all
11
11
  associated materials (collectively, the "Software") are the confidential and
12
12
  proprietary property of Mybono (the "Owner").
13
13
 
14
- NO LICENSE IS GRANTED. This is NOT open-source software. The Software is
15
- made available for viewing solely to persons explicitly and individually
16
- authorized in writing by the Owner. The mere presence of this source code in
17
- any repository, archive, or medium does NOT constitute permission to use it.
14
+ NO LICENSE TO THE SOURCE CODE IS GRANTED. This is NOT open-source software.
15
+ The source code is made available for viewing solely to persons explicitly
16
+ and individually authorized in writing by the Owner. The mere presence of
17
+ this source code in any repository, archive, or medium does NOT constitute
18
+ permission to use it. A limited license to install and execute the compiled
19
+ package published to the npm registry is granted separately below under
20
+ "EXECUTION LICENSE FOR THE PUBLISHED NPM PACKAGE".
18
21
 
19
22
  ================================================================================
20
23
  RESTRICTIONS
21
24
  ================================================================================
22
25
 
23
- Without the prior express written permission of the Owner, you MAY NOT:
26
+ Except as expressly granted below under "EXECUTION LICENSE FOR THE PUBLISHED
27
+ NPM PACKAGE", and without the prior express written permission of the Owner,
28
+ you MAY NOT:
24
29
 
25
30
  1. Copy, reproduce, or duplicate the Software, in whole or in part.
26
31
  2. Use or execute the Software for any purpose, commercial or otherwise.
@@ -32,9 +37,48 @@ Without the prior express written permission of the Owner, you MAY NOT:
32
37
  7. Remove, obscure, or alter this notice or any copyright, trademark, or
33
38
  other proprietary notices contained in the Software.
34
39
 
35
- Any use not expressly permitted in writing by the Owner is strictly
36
- prohibited and constitutes a violation of applicable copyright and
37
- intellectual property laws.
40
+ Any use not expressly permitted in writing by the Owner or under the
41
+ execution license below is strictly prohibited and constitutes a violation
42
+ of applicable copyright and intellectual property laws.
43
+
44
+ ================================================================================
45
+ EXECUTION LICENSE FOR THE PUBLISHED NPM PACKAGE
46
+ ================================================================================
47
+
48
+ The Owner distributes a compiled build of the Software to the public npm
49
+ registry under the package name "pr-checkmate" (the "Distributed Package")
50
+ for the purpose of being installed and run by third parties. Solely with
51
+ respect to the Distributed Package as published, the Owner grants any person
52
+ who obtains it through the npm registry a worldwide, royalty-free,
53
+ non-exclusive, non-transferable license to:
54
+
55
+ 1. Install the Distributed Package via a package manager (e.g. `npm`,
56
+ `npx`) or use it as a GitHub Actions step.
57
+ 2. Execute the Distributed Package's documented CLI and GitHub Actions
58
+ interfaces, including in automated CI/CD pipelines, against the
59
+ licensee's own code, for the purpose of running its automated checks.
60
+
61
+ This grant does not include, and RESTRICTIONS 1 and 3 through 7 above
62
+ continue to apply in full to, any right to: copy or redistribute the
63
+ Distributed Package outside of standard package-manager installation; modify,
64
+ decompile, or reverse engineer it; or access, copy, or create derivative
65
+ works from any source code not included in the published npm tarball. This
66
+ grant may be revoked by the Owner for future versions at any time; it does
67
+ not affect versions already installed.
68
+
69
+ ================================================================================
70
+ PUBLIC MIRROR EXCEPTION
71
+ ================================================================================
72
+
73
+ The restrictions above do not prevent the Owner itself from publishing
74
+ selected non-source materials — this LICENSE, the README, the CONTRIBUTING
75
+ and CODE_OF_CONDUCT files, the documentation/ tree, and the configuration
76
+ template and its JSON schema — to a public repository the Owner controls, for
77
+ the sole purpose of giving consumers of the published npm package a reachable
78
+ repository URL and readable documentation. This exception applies only to
79
+ publication carried out by or on behalf of the Owner; it grants no rights to
80
+ any other party to fork, mirror, re-host, or redistribute the Software, and it
81
+ does not extend to the source code itself.
38
82
 
39
83
  ================================================================================
40
84
  NO WARRANTY
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.8",
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",