pr-checkmate 3.0.3 → 3.1.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/dist/{cli.js → cjs/cli.js} +30 -30
- package/dist/{config → cjs/config}/index.d.ts +2 -2
- package/dist/{config → cjs/config}/index.js +8 -7
- package/dist/{config → cjs/config}/loader.d.ts +1 -1
- package/dist/{config → cjs/config}/loader.js +8 -8
- package/dist/{core → cjs/core}/checks/dependencies/banned-imports.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/banned-imports.js +10 -10
- package/dist/{core → cjs/core}/checks/dependencies/circular-deps.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/circular-deps.js +27 -27
- package/dist/{core → cjs/core}/checks/dependencies/dependency-check.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/dependency-check.js +17 -17
- package/dist/{core → cjs/core}/checks/dependencies/grype-scan.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/grype-scan.js +18 -18
- package/dist/{core → cjs/core}/checks/dependencies/license-check.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/license-check.js +12 -12
- package/dist/{core → cjs/core}/checks/dependencies/npm-audit.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/npm-audit.js +14 -14
- package/dist/{core → cjs/core}/checks/dependencies/outdated-deps.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/outdated-deps.js +14 -14
- package/dist/{core → cjs/core}/checks/dependencies/vuln-scan.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/vuln-scan.js +14 -14
- package/dist/{core → cjs/core}/checks/findings.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/findings.js +16 -16
- package/dist/{core → cjs/core}/checks/git/custom-rules.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/custom-rules.js +19 -19
- package/dist/{core → cjs/core}/checks/git/diff-smell.d.ts +2 -2
- package/dist/{core → cjs/core}/checks/git/diff-smell.js +13 -13
- package/dist/{core → cjs/core}/checks/git/large-files.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/large-files.js +15 -15
- package/dist/{core → cjs/core}/checks/git/leftover-debug.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/leftover-debug.js +13 -13
- package/dist/{core → cjs/core}/checks/git/lockfile-drift.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/lockfile-drift.js +12 -12
- package/dist/{core → cjs/core}/checks/git/merge-conflict.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/merge-conflict.js +15 -15
- package/dist/{core → cjs/core}/checks/git/missing-tests.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/missing-tests.js +15 -15
- package/dist/{core → cjs/core}/checks/git/todo-fixme.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/todo-fixme.js +11 -11
- package/dist/{core → cjs/core}/checks/languages/cpp-format.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/cpp-format.js +18 -18
- package/dist/{core → cjs/core}/checks/languages/external-checks.d.ts +9 -9
- package/dist/{core → cjs/core}/checks/languages/external-checks.js +10 -10
- package/dist/{core → cjs/core}/checks/languages/external-runner.d.ts +2 -2
- package/dist/{core → cjs/core}/checks/languages/external-runner.js +21 -21
- package/dist/{core → cjs/core}/checks/languages/go-format.d.ts +1 -1
- package/dist/cjs/core/checks/languages/go-format.js +202 -0
- package/dist/cjs/core/checks/languages/lint.d.ts +2 -0
- package/dist/{core → cjs/core}/checks/languages/lint.js +21 -21
- package/dist/{core → cjs/core}/checks/languages/prettier.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/prettier.js +18 -18
- package/dist/{core → cjs/core}/checks/languages/python-format.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/python-format.js +14 -14
- package/dist/{core → cjs/core}/checks/languages/python-lint.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/python-lint.js +13 -13
- package/dist/{core → cjs/core}/checks/languages/python-typecheck.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/python-typecheck.js +29 -29
- package/dist/{core → cjs/core}/checks/languages/typecheck.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/typecheck.js +13 -13
- package/dist/{core → cjs/core}/checks/pr/commitlint.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/pr/commitlint.js +12 -12
- package/dist/{core → cjs/core}/checks/pr/pr-body.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/pr/pr-body.js +8 -8
- package/dist/{core → cjs/core}/checks/pr/pr-size-check.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/pr/pr-size-check.js +10 -10
- package/dist/{core → cjs/core}/checks/pr/pr-title-lint.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/pr/pr-title-lint.js +8 -8
- package/dist/{core → cjs/core}/checks/quality/case-collision.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/case-collision.js +7 -7
- package/dist/{core → cjs/core}/checks/quality/config-validation.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/config-validation.js +9 -9
- package/dist/{core → cjs/core}/checks/quality/coverage.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/coverage.js +4 -4
- package/dist/{core → cjs/core}/checks/quality/dead-code.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/dead-code.js +23 -23
- package/dist/{core → cjs/core}/checks/quality/duplicate-check.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/duplicate-check.js +22 -22
- package/dist/{core → cjs/core}/checks/quality/license-header.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/license-header.js +16 -16
- package/dist/{core → cjs/core}/checks/quality/markdown-lint.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/markdown-lint.js +17 -17
- package/dist/{core → cjs/core}/checks/quality/package-size.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/package-size.js +12 -12
- package/dist/{core → cjs/core}/checks/quality/spellcheck.d.ts +2 -2
- package/dist/{core → cjs/core}/checks/quality/spellcheck.js +18 -18
- package/dist/{core → cjs/core}/checks/quality/symlinks.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/symlinks.js +8 -8
- package/dist/{core → cjs/core}/checks/quality/yaml-lint.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/yaml-lint.js +12 -12
- package/dist/{core → cjs/core}/checks/security/diff-security.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/security/diff-security.js +15 -15
- package/dist/{core → cjs/core}/checks/security/dockerfile-security.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/security/dockerfile-security.js +16 -16
- package/dist/{core → cjs/core}/checks/security/migration-safety.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/security/migration-safety.js +17 -17
- package/dist/{core → cjs/core}/checks/security/security.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/security/security.js +21 -21
- package/dist/{core → cjs/core}/checks/security/sensitive-file-guard.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/security/sensitive-file-guard.js +14 -14
- package/dist/{core → cjs/core}/checks/security/workflow-security.d.ts +2 -2
- package/dist/{core → cjs/core}/checks/security/workflow-security.js +14 -14
- package/dist/{core → cjs/core}/checks/tool-install.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/tool-install.js +2 -2
- package/dist/{core → cjs/core}/context.d.ts +1 -1
- package/dist/{core → cjs/core}/context.js +16 -16
- package/dist/cjs/core/index.d.ts +4 -0
- package/dist/{core → cjs/core}/index.js +7 -7
- package/dist/{core → cjs/core}/install/cache.js +2 -2
- package/dist/{core → cjs/core}/install/doctor.d.ts +4 -4
- package/dist/{core → cjs/core}/install/doctor.js +34 -34
- package/dist/{core → cjs/core}/install/ensure.d.ts +2 -2
- package/dist/{core → cjs/core}/install/ensure.js +15 -14
- package/dist/{core → cjs/core}/install/lock.js +4 -4
- package/dist/{core → cjs/core}/install/prepare.d.ts +4 -4
- package/dist/{core → cjs/core}/install/prepare.js +13 -13
- package/dist/{core → cjs/core}/install/profiles.d.ts +2 -2
- package/dist/{core → cjs/core}/install/reuse.d.ts +1 -1
- package/dist/{core → cjs/core}/install/reuse.js +4 -4
- package/dist/{core → cjs/core}/registry.d.ts +1 -1
- package/dist/cjs/core/registry.js +112 -0
- package/dist/{core → cjs/core}/reporters.d.ts +1 -1
- package/dist/{core → cjs/core}/reporters.js +28 -28
- package/dist/{core → cjs/core}/run-checks.d.ts +2 -2
- package/dist/{core → cjs/core}/run-checks.js +31 -31
- package/dist/{core → cjs/core}/targets.d.ts +1 -1
- package/dist/{core → cjs/core}/targets.js +20 -20
- package/dist/{core → cjs/core}/types.d.ts +3 -3
- package/dist/cjs/index.d.ts +12 -0
- package/dist/{index.js → cjs/index.js} +18 -18
- package/dist/{init.js → cjs/init.js} +68 -56
- package/dist/{interfaces → cjs/interfaces}/index.d.ts +3 -3
- package/dist/cjs/package.json +1 -0
- package/dist/{scripts → cjs/scripts}/copy-configs.js +22 -7
- package/dist/{scripts → cjs/scripts}/generate-install-manifests.js +2 -2
- package/dist/{scripts → cjs/scripts}/publish-github.js +4 -4
- package/dist/{utils → cjs/utils}/detect-language.js +12 -12
- package/dist/cjs/utils/execa.js +46 -0
- package/dist/{utils → cjs/utils}/git.js +2 -2
- package/dist/{utils → cjs/utils}/http.js +2 -2
- package/dist/cjs/utils/index.d.ts +15 -0
- package/dist/{utils → cjs/utils}/index.js +13 -13
- package/dist/{utils → cjs/utils}/own-deps.d.ts +2 -0
- package/dist/{utils → cjs/utils}/own-deps.js +1 -0
- package/dist/{utils → cjs/utils}/package-version.js +2 -1
- package/dist/{utils → cjs/utils}/resolve-bin.js +2 -1
- package/dist/{utils → cjs/utils}/update-notifier.js +4 -4
- package/dist/esm/cli.d.ts +2 -0
- package/dist/esm/cli.js +137 -0
- package/dist/esm/config/constants.d.ts +153 -0
- package/dist/esm/config/constants.js +360 -0
- package/dist/esm/config/index.d.ts +40 -0
- package/dist/esm/config/index.js +60 -0
- package/dist/esm/config/loader.d.ts +6 -0
- package/dist/esm/config/loader.js +191 -0
- package/dist/esm/config/pr-checkmate-workflow-docker.yml +79 -0
- package/dist/esm/config/pr-checkmate-workflow.yml +92 -0
- package/dist/esm/core/checks/dependencies/banned-imports.d.ts +2 -0
- package/dist/esm/core/checks/dependencies/banned-imports.js +70 -0
- package/dist/esm/core/checks/dependencies/circular-deps.d.ts +2 -0
- package/dist/esm/core/checks/dependencies/circular-deps.js +155 -0
- package/dist/esm/core/checks/dependencies/dependency-check.d.ts +43 -0
- package/dist/esm/core/checks/dependencies/dependency-check.js +174 -0
- package/dist/esm/core/checks/dependencies/grype-scan.d.ts +22 -0
- package/dist/esm/core/checks/dependencies/grype-scan.js +112 -0
- package/dist/esm/core/checks/dependencies/license-check.d.ts +2 -0
- package/dist/esm/core/checks/dependencies/license-check.js +61 -0
- package/dist/esm/core/checks/dependencies/npm-audit.d.ts +6 -0
- package/dist/esm/core/checks/dependencies/npm-audit.js +80 -0
- package/dist/esm/core/checks/dependencies/outdated-deps.d.ts +2 -0
- package/dist/esm/core/checks/dependencies/outdated-deps.js +66 -0
- package/dist/esm/core/checks/dependencies/vuln-scan.d.ts +2 -0
- package/dist/esm/core/checks/dependencies/vuln-scan.js +54 -0
- package/dist/esm/core/checks/findings.d.ts +299 -0
- package/dist/esm/core/checks/findings.js +701 -0
- package/dist/esm/core/checks/git/custom-rules.d.ts +2 -0
- package/dist/esm/core/checks/git/custom-rules.js +106 -0
- package/dist/esm/core/checks/git/diff-smell.d.ts +19 -0
- package/dist/esm/core/checks/git/diff-smell.js +69 -0
- package/dist/esm/core/checks/git/large-files.d.ts +2 -0
- package/dist/esm/core/checks/git/large-files.js +112 -0
- package/dist/esm/core/checks/git/leftover-debug.d.ts +2 -0
- package/dist/esm/core/checks/git/leftover-debug.js +89 -0
- package/dist/esm/core/checks/git/lockfile-drift.d.ts +2 -0
- package/dist/esm/core/checks/git/lockfile-drift.js +114 -0
- package/dist/esm/core/checks/git/merge-conflict.d.ts +2 -0
- package/dist/esm/core/checks/git/merge-conflict.js +117 -0
- package/dist/esm/core/checks/git/missing-tests.d.ts +2 -0
- package/dist/esm/core/checks/git/missing-tests.js +105 -0
- package/dist/esm/core/checks/git/todo-fixme.d.ts +7 -0
- package/dist/esm/core/checks/git/todo-fixme.js +80 -0
- package/dist/esm/core/checks/languages/cpp-format.d.ts +7 -0
- package/dist/esm/core/checks/languages/cpp-format.js +91 -0
- package/dist/esm/core/checks/languages/external-checks.d.ts +77 -0
- package/dist/esm/core/checks/languages/external-checks.js +197 -0
- package/dist/esm/core/checks/languages/external-runner.d.ts +119 -0
- package/dist/esm/core/checks/languages/external-runner.js +138 -0
- package/dist/esm/core/checks/languages/go-format.d.ts +8 -0
- package/dist/{core → esm/core}/checks/languages/go-format.js +29 -35
- package/dist/esm/core/checks/languages/lint.d.ts +2 -0
- package/dist/esm/core/checks/languages/lint.js +92 -0
- package/dist/esm/core/checks/languages/prettier.d.ts +2 -0
- package/dist/esm/core/checks/languages/prettier.js +85 -0
- package/dist/esm/core/checks/languages/python-format.d.ts +7 -0
- package/dist/esm/core/checks/languages/python-format.js +61 -0
- package/dist/esm/core/checks/languages/python-lint.d.ts +9 -0
- package/dist/esm/core/checks/languages/python-lint.js +55 -0
- package/dist/esm/core/checks/languages/python-typecheck.d.ts +14 -0
- package/dist/esm/core/checks/languages/python-typecheck.js +184 -0
- package/dist/esm/core/checks/languages/ruff-shared.d.ts +10 -0
- package/dist/esm/core/checks/languages/ruff-shared.js +35 -0
- package/dist/esm/core/checks/languages/typecheck.d.ts +2 -0
- package/dist/esm/core/checks/languages/typecheck.js +61 -0
- package/dist/esm/core/checks/pr/commitlint.d.ts +2 -0
- package/dist/esm/core/checks/pr/commitlint.js +102 -0
- package/dist/esm/core/checks/pr/pr-body.d.ts +2 -0
- package/dist/esm/core/checks/pr/pr-body.js +43 -0
- package/dist/esm/core/checks/pr/pr-size-check.d.ts +2 -0
- package/dist/esm/core/checks/pr/pr-size-check.js +42 -0
- package/dist/esm/core/checks/pr/pr-title-lint.d.ts +2 -0
- package/dist/esm/core/checks/pr/pr-title-lint.js +31 -0
- package/dist/esm/core/checks/quality/case-collision.d.ts +8 -0
- package/dist/esm/core/checks/quality/case-collision.js +39 -0
- package/dist/esm/core/checks/quality/config-validation.d.ts +11 -0
- package/dist/esm/core/checks/quality/config-validation.js +188 -0
- package/dist/esm/core/checks/quality/coverage.d.ts +2 -0
- package/dist/esm/core/checks/quality/coverage.js +62 -0
- package/dist/esm/core/checks/quality/dead-code.d.ts +2 -0
- package/dist/esm/core/checks/quality/dead-code.js +124 -0
- package/dist/esm/core/checks/quality/duplicate-check.d.ts +2 -0
- package/dist/esm/core/checks/quality/duplicate-check.js +141 -0
- package/dist/esm/core/checks/quality/license-header.d.ts +7 -0
- package/dist/esm/core/checks/quality/license-header.js +81 -0
- package/dist/esm/core/checks/quality/markdown-lint.d.ts +2 -0
- package/dist/esm/core/checks/quality/markdown-lint.js +104 -0
- package/dist/esm/core/checks/quality/package-size.d.ts +36 -0
- package/dist/esm/core/checks/quality/package-size.js +196 -0
- package/dist/esm/core/checks/quality/spellcheck.d.ts +77 -0
- package/dist/esm/core/checks/quality/spellcheck.js +296 -0
- package/dist/esm/core/checks/quality/symlinks.d.ts +16 -0
- package/dist/esm/core/checks/quality/symlinks.js +57 -0
- package/dist/esm/core/checks/quality/yaml-lint.d.ts +20 -0
- package/dist/esm/core/checks/quality/yaml-lint.js +116 -0
- package/dist/esm/core/checks/security/diff-security.d.ts +2 -0
- package/dist/esm/core/checks/security/diff-security.js +354 -0
- package/dist/esm/core/checks/security/dockerfile-security.d.ts +2 -0
- package/dist/esm/core/checks/security/dockerfile-security.js +98 -0
- package/dist/esm/core/checks/security/migration-safety.d.ts +2 -0
- package/dist/esm/core/checks/security/migration-safety.js +137 -0
- package/dist/esm/core/checks/security/security.d.ts +63 -0
- package/dist/esm/core/checks/security/security.js +201 -0
- package/dist/esm/core/checks/security/sensitive-file-guard.d.ts +2 -0
- package/dist/esm/core/checks/security/sensitive-file-guard.js +160 -0
- package/dist/esm/core/checks/security/workflow-security.d.ts +12 -0
- package/dist/esm/core/checks/security/workflow-security.js +100 -0
- package/dist/esm/core/checks/tool-install.d.ts +102 -0
- package/dist/esm/core/checks/tool-install.js +66 -0
- package/dist/esm/core/commands.d.ts +27 -0
- package/dist/esm/core/commands.js +89 -0
- package/dist/esm/core/context.d.ts +62 -0
- package/dist/esm/core/context.js +241 -0
- package/dist/esm/core/index.d.ts +4 -0
- package/dist/esm/core/index.js +4 -0
- package/dist/esm/core/install/cache.d.ts +58 -0
- package/dist/esm/core/install/cache.js +142 -0
- package/dist/esm/core/install/doctor.d.ts +35 -0
- package/dist/esm/core/install/doctor.js +164 -0
- package/dist/esm/core/install/ensure.d.ts +77 -0
- package/dist/esm/core/install/ensure.js +269 -0
- package/dist/esm/core/install/lock.d.ts +34 -0
- package/dist/esm/core/install/lock.js +92 -0
- package/dist/esm/core/install/merge.d.ts +47 -0
- package/dist/esm/core/install/merge.js +85 -0
- package/dist/esm/core/install/prepare.d.ts +76 -0
- package/dist/esm/core/install/prepare.js +142 -0
- package/dist/esm/core/install/profiles.d.ts +78 -0
- package/dist/esm/core/install/profiles.js +192 -0
- package/dist/esm/core/install/reuse.d.ts +41 -0
- package/dist/esm/core/install/reuse.js +100 -0
- package/dist/esm/core/registry.d.ts +6 -0
- package/dist/esm/core/registry.js +109 -0
- package/dist/esm/core/reporters.d.ts +18 -0
- package/dist/esm/core/reporters.js +266 -0
- package/dist/esm/core/run-checks.d.ts +33 -0
- package/dist/esm/core/run-checks.js +293 -0
- package/dist/esm/core/targets.d.ts +140 -0
- package/dist/esm/core/targets.js +213 -0
- package/dist/esm/core/types.d.ts +195 -0
- package/dist/esm/core/types.js +38 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/init.d.ts +38 -0
- package/dist/esm/init.js +421 -0
- package/dist/esm/interfaces/index.d.ts +432 -0
- package/dist/esm/interfaces/index.js +2 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/scripts/copy-configs.d.ts +1 -0
- package/dist/esm/scripts/copy-configs.js +64 -0
- package/dist/esm/scripts/generate-install-manifests.d.ts +39 -0
- package/dist/esm/scripts/generate-install-manifests.js +115 -0
- package/dist/esm/scripts/publish-github.d.ts +1 -0
- package/dist/esm/scripts/publish-github.js +45 -0
- package/dist/esm/utils/ci.d.ts +11 -0
- package/dist/esm/utils/ci.js +40 -0
- package/dist/esm/utils/detect-language.d.ts +48 -0
- package/dist/esm/utils/detect-language.js +234 -0
- package/dist/esm/utils/direct-deps.d.ts +21 -0
- package/dist/esm/utils/direct-deps.js +220 -0
- package/dist/esm/utils/execa.d.ts +22 -0
- package/dist/{utils → esm/utils}/execa.js +1 -4
- package/dist/esm/utils/git.d.ts +14 -0
- package/dist/esm/utils/git.js +21 -0
- package/dist/esm/utils/glob.d.ts +24 -0
- package/dist/esm/utils/glob.js +40 -0
- package/dist/esm/utils/http.d.ts +59 -0
- package/dist/esm/utils/http.js +115 -0
- package/dist/esm/utils/index.d.ts +15 -0
- package/dist/esm/utils/index.js +26 -0
- package/dist/esm/utils/logger.d.ts +65 -0
- package/dist/esm/utils/logger.js +157 -0
- package/dist/esm/utils/own-deps.d.ts +16 -0
- package/dist/esm/utils/own-deps.js +107 -0
- package/dist/esm/utils/package-version.d.ts +4 -0
- package/dist/esm/utils/package-version.js +38 -0
- package/dist/esm/utils/pool.d.ts +49 -0
- package/dist/esm/utils/pool.js +113 -0
- package/dist/esm/utils/resolve-bin.d.ts +67 -0
- package/dist/esm/utils/resolve-bin.js +156 -0
- package/dist/esm/utils/result-collector.d.ts +33 -0
- package/dist/esm/utils/result-collector.js +44 -0
- package/dist/esm/utils/update-notifier.d.ts +19 -0
- package/dist/esm/utils/update-notifier.js +108 -0
- package/install-manifests/core/package-lock.json +4 -4
- package/install-manifests/core/package.json +1 -1
- package/install-manifests/cpp/package-lock.json +4 -4
- package/install-manifests/cpp/package.json +1 -1
- package/package.json +16 -14
- package/dist/core/checks/languages/lint.d.ts +0 -2
- package/dist/core/index.d.ts +0 -4
- package/dist/core/registry.js +0 -112
- package/dist/index.d.ts +0 -12
- package/dist/utils/index.d.ts +0 -15
- /package/dist/{cli.d.ts → cjs/cli.d.ts} +0 -0
- /package/dist/{config → cjs/config}/constants.d.ts +0 -0
- /package/dist/{config → cjs/config}/constants.js +0 -0
- /package/dist/{config → cjs/config}/pr-checkmate-workflow-docker.yml +0 -0
- /package/dist/{config → cjs/config}/pr-checkmate-workflow.yml +0 -0
- /package/dist/{core → cjs/core}/checks/languages/ruff-shared.d.ts +0 -0
- /package/dist/{core → cjs/core}/checks/languages/ruff-shared.js +0 -0
- /package/dist/{core → cjs/core}/commands.d.ts +0 -0
- /package/dist/{core → cjs/core}/commands.js +0 -0
- /package/dist/{core → cjs/core}/install/cache.d.ts +0 -0
- /package/dist/{core → cjs/core}/install/lock.d.ts +0 -0
- /package/dist/{core → cjs/core}/install/merge.d.ts +0 -0
- /package/dist/{core → cjs/core}/install/merge.js +0 -0
- /package/dist/{core → cjs/core}/install/profiles.js +0 -0
- /package/dist/{core → cjs/core}/types.js +0 -0
- /package/dist/{init.d.ts → cjs/init.d.ts} +0 -0
- /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
- /package/dist/{scripts → cjs/scripts}/copy-configs.d.ts +0 -0
- /package/dist/{scripts → cjs/scripts}/generate-install-manifests.d.ts +0 -0
- /package/dist/{scripts → cjs/scripts}/publish-github.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/ci.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/ci.js +0 -0
- /package/dist/{utils → cjs/utils}/detect-language.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/direct-deps.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/direct-deps.js +0 -0
- /package/dist/{utils → cjs/utils}/execa.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/git.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/glob.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/glob.js +0 -0
- /package/dist/{utils → cjs/utils}/http.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/logger.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/logger.js +0 -0
- /package/dist/{utils → cjs/utils}/package-version.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/pool.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/pool.js +0 -0
- /package/dist/{utils → cjs/utils}/resolve-bin.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/result-collector.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/result-collector.js +0 -0
- /package/dist/{utils → cjs/utils}/update-notifier.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PRCheckMateConfig } from '../../interfaces';
|
|
2
|
-
import type { LanguageUsage } from '../../utils/detect-language';
|
|
3
|
-
import { type EnsureOptions } from './ensure';
|
|
4
|
-
import { type Profile } from './profiles';
|
|
1
|
+
import type { PRCheckMateConfig } from '../../interfaces/index.js';
|
|
2
|
+
import type { LanguageUsage } from '../../utils/detect-language.js';
|
|
3
|
+
import { type EnsureOptions } from './ensure.js';
|
|
4
|
+
import { type Profile } from './profiles.js';
|
|
5
5
|
/**
|
|
6
6
|
* Whether a profile needs fetching at all, or already ships inside the package.
|
|
7
7
|
*
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.profileSatisfiedLocally = profileSatisfiedLocally;
|
|
4
4
|
exports.prepareTooling = prepareTooling;
|
|
5
5
|
exports.noTooling = noTooling;
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
6
|
+
const logger_js_1 = require("../../utils/logger.js");
|
|
7
|
+
const resolve_bin_js_1 = require("../../utils/resolve-bin.js");
|
|
8
|
+
const ensure_js_1 = require("./ensure.js");
|
|
9
|
+
const profiles_js_1 = require("./profiles.js");
|
|
10
10
|
/**
|
|
11
11
|
* Whether a profile needs fetching at all, or already ships inside the package.
|
|
12
12
|
*
|
|
@@ -23,7 +23,7 @@ const profiles_1 = require("./profiles");
|
|
|
23
23
|
* rather than another change to this logic.
|
|
24
24
|
*/
|
|
25
25
|
function profileSatisfiedLocally(profile) {
|
|
26
|
-
return profile.packages.every(pkg => (0,
|
|
26
|
+
return profile.packages.every(pkg => (0, resolve_bin_js_1.packagePresent)(pkg));
|
|
27
27
|
}
|
|
28
28
|
/** Profiles blocked outright by `install.deny`, with a line saying so. */
|
|
29
29
|
function denied(profile, deny) {
|
|
@@ -50,7 +50,7 @@ async function prepareTooling(opts) {
|
|
|
50
50
|
// than once in one process, and a directory registered by a previous run — for
|
|
51
51
|
// a different repository, with a different profile set — must not still be on
|
|
52
52
|
// the search path for this one.
|
|
53
|
-
(0,
|
|
53
|
+
(0, resolve_bin_js_1.clearToolPaths)();
|
|
54
54
|
const install = opts.config.install ?? {};
|
|
55
55
|
const strategy = process.env.PR_CHECKMATE_INSTALL_STRATEGY ?? install.strategy ?? 'adaptive';
|
|
56
56
|
const onMissing = install.onMissingTool ?? 'auto';
|
|
@@ -58,14 +58,14 @@ async function prepareTooling(opts) {
|
|
|
58
58
|
// Which profiles this repository needs: languages by file count, universal
|
|
59
59
|
// profiles by whether their check survived config. `install.profiles` and
|
|
60
60
|
// `excludeProfiles` have already had their say inside `planProfiles`.
|
|
61
|
-
const required = new Set((0,
|
|
61
|
+
const required = new Set((0, profiles_js_1.planProfiles)(opts.usage, opts.config)
|
|
62
62
|
.filter(decision => decision.required)
|
|
63
63
|
.map(decision => decision.profile));
|
|
64
64
|
// A profile nobody in this run would use is not worth a thought, let alone a
|
|
65
65
|
// download. `eager` opts out of that reasoning by definition: it exists so a
|
|
66
66
|
// container build or an air-gapped mirror can hold everything up front.
|
|
67
67
|
const chosen = opts.selected.length > 0 ? new Set(opts.selected) : null;
|
|
68
|
-
const wanted = (opts.profiles ??
|
|
68
|
+
const wanted = (opts.profiles ?? profiles_js_1.PROFILES).filter(profile => {
|
|
69
69
|
if (strategy === 'eager')
|
|
70
70
|
return true;
|
|
71
71
|
if (!required.has(profile.name))
|
|
@@ -108,7 +108,7 @@ async function prepareTooling(opts) {
|
|
|
108
108
|
// creates the directory and warns when the configured path is unwritable, and a
|
|
109
109
|
// container with a read-only home would print that on every single run.
|
|
110
110
|
if (toFetch.length > 0) {
|
|
111
|
-
const result = await (0,
|
|
111
|
+
const result = await (0, ensure_js_1.ensureTooling)(toFetch.map(profile => profile.name), {
|
|
112
112
|
cwd: opts.cwd,
|
|
113
113
|
version: opts.version,
|
|
114
114
|
install,
|
|
@@ -126,15 +126,15 @@ async function prepareTooling(opts) {
|
|
|
126
126
|
// Always logged, never behind --debug. A check that did not run is the
|
|
127
127
|
// failure mode this whole layer exists to make loud.
|
|
128
128
|
const names = [...new Set(unavailable.keys())].join(', ');
|
|
129
|
-
|
|
129
|
+
logger_js_1.logger.warn(`[install]: ⚠️ tooling unavailable — these checks cannot run: ${names}`);
|
|
130
130
|
if (onMissing === 'error') {
|
|
131
|
-
|
|
131
|
+
logger_js_1.logger.error('[install]: ❌ install.onMissingTool is "error" — the affected checks fail');
|
|
132
132
|
}
|
|
133
133
|
else {
|
|
134
|
-
|
|
134
|
+
logger_js_1.logger.info('[install]: Pre-warm the cache with: npx pr-checkmate install --all');
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
(0,
|
|
137
|
+
(0, resolve_bin_js_1.registerToolPaths)(dirs);
|
|
138
138
|
return { unavailable, dirs, fatal: onMissing === 'error' && unavailable.size > 0 };
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PRCheckMateConfig } from '../../interfaces';
|
|
2
|
-
import type { Language, LanguageUsage } from '../../utils/detect-language';
|
|
1
|
+
import type { PRCheckMateConfig } from '../../interfaces/index.js';
|
|
2
|
+
import type { Language, LanguageUsage } from '../../utils/detect-language.js';
|
|
3
3
|
/**
|
|
4
4
|
* A named bundle of tooling, and the checks that stop working without it.
|
|
5
5
|
*
|
|
@@ -7,8 +7,8 @@ exports.reuseDecision = reuseDecision;
|
|
|
7
7
|
exports.clientToolPaths = clientToolPaths;
|
|
8
8
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const logger_js_1 = require("../../utils/logger.js");
|
|
11
|
+
const resolve_bin_js_1 = require("../../utils/resolve-bin.js");
|
|
12
12
|
/**
|
|
13
13
|
* The major version we declare for a tool, from our own manifest.
|
|
14
14
|
*
|
|
@@ -18,7 +18,7 @@ const resolve_bin_1 = require("../../utils/resolve-bin");
|
|
|
18
18
|
*/
|
|
19
19
|
function ownMajor(pkgName) {
|
|
20
20
|
try {
|
|
21
|
-
const manifest = node_path_1.default.join((0,
|
|
21
|
+
const manifest = node_path_1.default.join((0, resolve_bin_js_1.ownPackageRoot)(), 'package.json');
|
|
22
22
|
const deps = JSON.parse(node_fs_1.default.readFileSync(manifest, 'utf-8')).dependencies;
|
|
23
23
|
const range = deps?.[pkgName];
|
|
24
24
|
if (!range)
|
|
@@ -102,6 +102,6 @@ function reuseDecision(pkgName, ctx, opts = {}) {
|
|
|
102
102
|
*/
|
|
103
103
|
function clientToolPaths(pkgName, ctx, opts = {}) {
|
|
104
104
|
const decision = reuseDecision(pkgName, ctx, opts);
|
|
105
|
-
|
|
105
|
+
logger_js_1.logger.debug(`[reuseLocal]: ${decision.reason}`);
|
|
106
106
|
return decision.paths;
|
|
107
107
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REGISTRY = void 0;
|
|
4
|
+
const banned_imports_js_1 = require("./checks/dependencies/banned-imports.js");
|
|
5
|
+
const circular_deps_js_1 = require("./checks/dependencies/circular-deps.js");
|
|
6
|
+
const dependency_check_js_1 = require("./checks/dependencies/dependency-check.js");
|
|
7
|
+
const grype_scan_js_1 = require("./checks/dependencies/grype-scan.js");
|
|
8
|
+
const license_check_js_1 = require("./checks/dependencies/license-check.js");
|
|
9
|
+
const npm_audit_js_1 = require("./checks/dependencies/npm-audit.js");
|
|
10
|
+
const outdated_deps_js_1 = require("./checks/dependencies/outdated-deps.js");
|
|
11
|
+
const vuln_scan_js_1 = require("./checks/dependencies/vuln-scan.js");
|
|
12
|
+
const custom_rules_js_1 = require("./checks/git/custom-rules.js");
|
|
13
|
+
const diff_smell_js_1 = require("./checks/git/diff-smell.js");
|
|
14
|
+
const large_files_js_1 = require("./checks/git/large-files.js");
|
|
15
|
+
const leftover_debug_js_1 = require("./checks/git/leftover-debug.js");
|
|
16
|
+
const lockfile_drift_js_1 = require("./checks/git/lockfile-drift.js");
|
|
17
|
+
const merge_conflict_js_1 = require("./checks/git/merge-conflict.js");
|
|
18
|
+
const missing_tests_js_1 = require("./checks/git/missing-tests.js");
|
|
19
|
+
const todo_fixme_js_1 = require("./checks/git/todo-fixme.js");
|
|
20
|
+
const cpp_format_js_1 = require("./checks/languages/cpp-format.js");
|
|
21
|
+
const external_checks_js_1 = require("./checks/languages/external-checks.js");
|
|
22
|
+
const go_format_js_1 = require("./checks/languages/go-format.js");
|
|
23
|
+
const lint_js_1 = require("./checks/languages/lint.js");
|
|
24
|
+
const prettier_js_1 = require("./checks/languages/prettier.js");
|
|
25
|
+
const python_format_js_1 = require("./checks/languages/python-format.js");
|
|
26
|
+
const python_lint_js_1 = require("./checks/languages/python-lint.js");
|
|
27
|
+
const python_typecheck_js_1 = require("./checks/languages/python-typecheck.js");
|
|
28
|
+
const typecheck_js_1 = require("./checks/languages/typecheck.js");
|
|
29
|
+
const commitlint_js_1 = require("./checks/pr/commitlint.js");
|
|
30
|
+
const pr_body_js_1 = require("./checks/pr/pr-body.js");
|
|
31
|
+
const pr_size_check_js_1 = require("./checks/pr/pr-size-check.js");
|
|
32
|
+
const pr_title_lint_js_1 = require("./checks/pr/pr-title-lint.js");
|
|
33
|
+
const case_collision_js_1 = require("./checks/quality/case-collision.js");
|
|
34
|
+
const config_validation_js_1 = require("./checks/quality/config-validation.js");
|
|
35
|
+
const coverage_js_1 = require("./checks/quality/coverage.js");
|
|
36
|
+
const dead_code_js_1 = require("./checks/quality/dead-code.js");
|
|
37
|
+
const duplicate_check_js_1 = require("./checks/quality/duplicate-check.js");
|
|
38
|
+
const license_header_js_1 = require("./checks/quality/license-header.js");
|
|
39
|
+
const markdown_lint_js_1 = require("./checks/quality/markdown-lint.js");
|
|
40
|
+
const package_size_js_1 = require("./checks/quality/package-size.js");
|
|
41
|
+
const spellcheck_js_1 = require("./checks/quality/spellcheck.js");
|
|
42
|
+
const symlinks_js_1 = require("./checks/quality/symlinks.js");
|
|
43
|
+
const yaml_lint_js_1 = require("./checks/quality/yaml-lint.js");
|
|
44
|
+
const diff_security_js_1 = require("./checks/security/diff-security.js");
|
|
45
|
+
const dockerfile_security_js_1 = require("./checks/security/dockerfile-security.js");
|
|
46
|
+
const migration_safety_js_1 = require("./checks/security/migration-safety.js");
|
|
47
|
+
const security_js_1 = require("./checks/security/security.js");
|
|
48
|
+
const sensitive_file_guard_js_1 = require("./checks/security/sensitive-file-guard.js");
|
|
49
|
+
const workflow_security_js_1 = require("./checks/security/workflow-security.js");
|
|
50
|
+
/**
|
|
51
|
+
* Every check, in declaration order. The orchestrator groups them by `phase`
|
|
52
|
+
* (blocking → informational → format) and runs each phase's checks in parallel.
|
|
53
|
+
*/
|
|
54
|
+
exports.REGISTRY = [
|
|
55
|
+
// blocking
|
|
56
|
+
merge_conflict_js_1.mergeConflictCheck,
|
|
57
|
+
security_js_1.securityCheck,
|
|
58
|
+
typecheck_js_1.typecheckCheck,
|
|
59
|
+
lint_js_1.lintCheck,
|
|
60
|
+
dependency_check_js_1.dependencyCheck,
|
|
61
|
+
npm_audit_js_1.npmAuditCheck,
|
|
62
|
+
circular_deps_js_1.circularDepsCheck,
|
|
63
|
+
license_check_js_1.licenseCheck,
|
|
64
|
+
// informational
|
|
65
|
+
diff_smell_js_1.diffSmellCheck,
|
|
66
|
+
diff_security_js_1.diffSecurityCheck,
|
|
67
|
+
workflow_security_js_1.workflowSecurityCheck,
|
|
68
|
+
dockerfile_security_js_1.dockerfileSecurityCheck,
|
|
69
|
+
case_collision_js_1.caseCollisionCheck,
|
|
70
|
+
vuln_scan_js_1.vulnScanCheck,
|
|
71
|
+
grype_scan_js_1.grypeScanCheck,
|
|
72
|
+
custom_rules_js_1.customRulesCheck,
|
|
73
|
+
banned_imports_js_1.bannedImportsCheck,
|
|
74
|
+
license_header_js_1.licenseHeaderCheck,
|
|
75
|
+
config_validation_js_1.configValidationCheck,
|
|
76
|
+
leftover_debug_js_1.leftoverDebugCheck,
|
|
77
|
+
lockfile_drift_js_1.lockfileDriftCheck,
|
|
78
|
+
large_files_js_1.largeFilesCheck,
|
|
79
|
+
todo_fixme_js_1.todoFixmeCheck,
|
|
80
|
+
missing_tests_js_1.missingTestsCheck,
|
|
81
|
+
coverage_js_1.coverageCheck,
|
|
82
|
+
migration_safety_js_1.migrationSafetyCheck,
|
|
83
|
+
sensitive_file_guard_js_1.sensitiveFileGuardCheck,
|
|
84
|
+
pr_body_js_1.prBodyCheck,
|
|
85
|
+
duplicate_check_js_1.duplicateCheck,
|
|
86
|
+
commitlint_js_1.commitlintCheck,
|
|
87
|
+
pr_size_check_js_1.prSizeCheck,
|
|
88
|
+
pr_title_lint_js_1.prTitleLintCheck,
|
|
89
|
+
outdated_deps_js_1.outdatedDepsCheck,
|
|
90
|
+
markdown_lint_js_1.markdownLintCheck,
|
|
91
|
+
spellcheck_js_1.spellcheckCheck,
|
|
92
|
+
yaml_lint_js_1.yamlLintCheck,
|
|
93
|
+
symlinks_js_1.symlinksCheck,
|
|
94
|
+
package_size_js_1.packageSizeCheck,
|
|
95
|
+
python_lint_js_1.pythonLintCheck,
|
|
96
|
+
python_typecheck_js_1.pythonTypecheckCheck,
|
|
97
|
+
dead_code_js_1.deadCodeCheck,
|
|
98
|
+
external_checks_js_1.swiftLintCheck,
|
|
99
|
+
external_checks_js_1.kotlinLintCheck,
|
|
100
|
+
external_checks_js_1.goLintCheck,
|
|
101
|
+
external_checks_js_1.rustLintCheck,
|
|
102
|
+
external_checks_js_1.rubyLintCheck,
|
|
103
|
+
external_checks_js_1.shellcheckCheck,
|
|
104
|
+
// format
|
|
105
|
+
prettier_js_1.prettierCheck,
|
|
106
|
+
cpp_format_js_1.cppFormatCheck,
|
|
107
|
+
python_format_js_1.pythonFormatCheck,
|
|
108
|
+
go_format_js_1.goFormatCheck,
|
|
109
|
+
external_checks_js_1.rustFormatCheck,
|
|
110
|
+
external_checks_js_1.csharpFormatCheck,
|
|
111
|
+
external_checks_js_1.phpFormatCheck,
|
|
112
|
+
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CheckReport, ReporterConfig, ReporterKind } from './types';
|
|
1
|
+
import type { CheckReport, ReporterConfig, ReporterKind } from './types.js';
|
|
2
2
|
/** Whether the comment reached the PR, so the caller can act on a failure. */
|
|
3
3
|
export interface PostOutcome {
|
|
4
4
|
attempted: boolean;
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.buildMarkdownReport = buildMarkdownReport;
|
|
7
7
|
exports.report = report;
|
|
8
8
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
9
|
+
const http_js_1 = require("../utils/http.js");
|
|
10
|
+
const index_js_1 = require("../utils/index.js");
|
|
11
|
+
const package_version_js_1 = require("../utils/package-version.js");
|
|
12
12
|
const STATUS_ICON = {
|
|
13
13
|
pass: '✅',
|
|
14
14
|
warn: '⚠️',
|
|
@@ -75,7 +75,7 @@ function buildMarkdownReport(report, cfg = {}) {
|
|
|
75
75
|
// Say so rather than letting the table quietly disagree with the counts above.
|
|
76
76
|
...(hidden > 0 ? ['', `_${hidden} row(s) hidden by \`reporter.include\`._`] : []),
|
|
77
77
|
'',
|
|
78
|
-
`_Generated by [PR CheckMate](https://www.npmjs.com/package/pr-checkmate) v${(0,
|
|
78
|
+
`_Generated by [PR CheckMate](https://www.npmjs.com/package/pr-checkmate) v${(0, package_version_js_1.packageVersion)()}_`,
|
|
79
79
|
].join('\n');
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
@@ -88,25 +88,25 @@ function buildMarkdownReport(report, cfg = {}) {
|
|
|
88
88
|
*/
|
|
89
89
|
function printStdout(report, cfg) {
|
|
90
90
|
const { passed, warned, failed, skipped } = report.summary;
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
index_js_1.logger.print('');
|
|
92
|
+
index_js_1.logger.print(SUMMARY_BORDER);
|
|
93
93
|
// The version belongs in the headline, not in a footnote. Which copy of
|
|
94
94
|
// pr-checkmate produced a report is the first thing to establish when the
|
|
95
95
|
// report disagrees with what someone expects, and it is not otherwise
|
|
96
96
|
// recoverable from the log: a stale global install answers `pr-checkmate` on
|
|
97
97
|
// `PATH` ahead of the project's own, and reads the same config while doing it.
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
index_js_1.logger.print(` PR CheckMate Summary · v${(0, package_version_js_1.packageVersion)()}`);
|
|
99
|
+
index_js_1.logger.print(SUMMARY_BORDER);
|
|
100
100
|
for (const r of report.results) {
|
|
101
101
|
const details = r.details ? `: ${r.details}` : '';
|
|
102
|
-
|
|
102
|
+
index_js_1.logger.print(` ${STATUS_ICON[r.status]} ${r.name}${details}`);
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
index_js_1.logger.print(SUMMARY_RULE);
|
|
105
|
+
index_js_1.logger.print(` ✅ ${passed} passed ⚠️ ${warned} warnings ❌ ${failed} failed ⏭️ ${skipped} skipped`);
|
|
106
|
+
index_js_1.logger.print(SUMMARY_BORDER);
|
|
107
107
|
if (cfg.include?.docsLink !== false) {
|
|
108
108
|
// The docs cover every check and config key.
|
|
109
|
-
|
|
109
|
+
index_js_1.logger.print(' DOCUMENTATION: https://pr-checkmate-docs.pages.dev/');
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
/** Network settings shared by every platform call. */
|
|
@@ -121,10 +121,10 @@ function httpOptions(cfg, label) {
|
|
|
121
121
|
/** Log and shape the result of a write. */
|
|
122
122
|
function finish(platform, res, verb) {
|
|
123
123
|
if (res.ok) {
|
|
124
|
-
|
|
124
|
+
index_js_1.logger.info(`[reporter]: ✅ ${verb} PR CheckMate summary on ${platform}`);
|
|
125
125
|
return { attempted: true, ok: true };
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
index_js_1.logger.warn(`[reporter]: ⚠️ Could not ${verb.toLowerCase()} ${platform} comment: ${res.error}`);
|
|
128
128
|
return { attempted: true, ok: false, error: res.error };
|
|
129
129
|
}
|
|
130
130
|
/** Page-number pagination: stop as soon as a page comes back short. */
|
|
@@ -134,7 +134,7 @@ function pageAfter(base, count, page) {
|
|
|
134
134
|
async function upsertGithubComment(body, cfg) {
|
|
135
135
|
const ctx = getPrContext();
|
|
136
136
|
if (!ctx) {
|
|
137
|
-
|
|
137
|
+
index_js_1.logger.info('[reporter]: Skipping GitHub comment (not in PR context or GITHUB_TOKEN missing)');
|
|
138
138
|
return SKIPPED;
|
|
139
139
|
}
|
|
140
140
|
const { token, owner, repo, prNumber } = ctx;
|
|
@@ -149,10 +149,10 @@ async function upsertGithubComment(body, cfg) {
|
|
|
149
149
|
const opts = httpOptions(cfg, 'GitHub');
|
|
150
150
|
const existing = await findExisting(listBase, { headers }, b => (Array.isArray(b) ? b : []), c => typeof c.body === 'string' && c.body.includes(COMMENT_MARKER), opts);
|
|
151
151
|
if (existing.reuse && cfg.mode !== 'append') {
|
|
152
|
-
const res = await (0,
|
|
152
|
+
const res = await (0, http_js_1.request)(`${apiBase}/issues/comments/${existing.reuse.id}`, { method: 'PATCH', headers, body: JSON.stringify({ body }) }, opts);
|
|
153
153
|
return finish('GitHub', res, 'Updated');
|
|
154
154
|
}
|
|
155
|
-
const res = await (0,
|
|
155
|
+
const res = await (0, http_js_1.request)(`${apiBase}/issues/${prNumber}/comments`, { method: 'POST', headers, body: JSON.stringify({ body }) }, opts);
|
|
156
156
|
return finish('GitHub', res, 'Posted');
|
|
157
157
|
}
|
|
158
158
|
/**
|
|
@@ -166,7 +166,7 @@ async function upsertGitlabNote(body, cfg) {
|
|
|
166
166
|
const iid = process.env.CI_MERGE_REQUEST_IID;
|
|
167
167
|
const token = process.env.GITLAB_TOKEN;
|
|
168
168
|
if (!base || !project || !iid || !token) {
|
|
169
|
-
|
|
169
|
+
index_js_1.logger.info('[reporter]: Skipping GitLab note (not an MR pipeline or GITLAB_TOKEN missing)');
|
|
170
170
|
return SKIPPED;
|
|
171
171
|
}
|
|
172
172
|
const notes = `${base}/projects/${project}/merge_requests/${iid}/notes`;
|
|
@@ -174,10 +174,10 @@ async function upsertGitlabNote(body, cfg) {
|
|
|
174
174
|
const opts = httpOptions(cfg, 'GitLab');
|
|
175
175
|
const existing = await findExisting(`${notes}?per_page=${PER_PAGE}`, { headers }, b => (Array.isArray(b) ? b : []), n => typeof n.body === 'string' && n.body.includes(COMMENT_MARKER), opts);
|
|
176
176
|
if (existing.reuse && cfg.mode !== 'append') {
|
|
177
|
-
const res = await (0,
|
|
177
|
+
const res = await (0, http_js_1.request)(`${notes}/${existing.reuse.id}`, { method: 'PUT', headers, body: JSON.stringify({ body }) }, opts);
|
|
178
178
|
return finish('GitLab', res, 'Updated');
|
|
179
179
|
}
|
|
180
|
-
const res = await (0,
|
|
180
|
+
const res = await (0, http_js_1.request)(notes, { method: 'POST', headers, body: JSON.stringify({ body }) }, opts);
|
|
181
181
|
return finish('GitLab', res, 'Posted');
|
|
182
182
|
}
|
|
183
183
|
/**
|
|
@@ -190,7 +190,7 @@ async function upsertBitbucketComment(body, cfg) {
|
|
|
190
190
|
const prId = process.env.BITBUCKET_PR_ID;
|
|
191
191
|
const token = process.env.BITBUCKET_TOKEN;
|
|
192
192
|
if (!fullName || !prId || !token) {
|
|
193
|
-
|
|
193
|
+
index_js_1.logger.info('[reporter]: Skipping Bitbucket comment (not a PR pipeline or BITBUCKET_TOKEN missing)');
|
|
194
194
|
return SKIPPED;
|
|
195
195
|
}
|
|
196
196
|
const commentsUrl = `https://api.bitbucket.org/2.0/repositories/${fullName}/pullrequests/${prId}/comments`;
|
|
@@ -200,10 +200,10 @@ async function upsertBitbucketComment(body, cfg) {
|
|
|
200
200
|
// Bitbucket is cursor-paginated: the next page is a URL in the body.
|
|
201
201
|
b => b?.next ?? null);
|
|
202
202
|
if (existing.reuse && cfg.mode !== 'append') {
|
|
203
|
-
const res = await (0,
|
|
203
|
+
const res = await (0, http_js_1.request)(`${commentsUrl}/${existing.reuse.id}`, { method: 'PUT', headers, body: JSON.stringify({ content: { raw: body } }) }, opts);
|
|
204
204
|
return finish('Bitbucket', res, 'Updated');
|
|
205
205
|
}
|
|
206
|
-
const res = await (0,
|
|
206
|
+
const res = await (0, http_js_1.request)(commentsUrl, { method: 'POST', headers, body: JSON.stringify({ content: { raw: body } }) }, opts);
|
|
207
207
|
return finish('Bitbucket', res, 'Posted');
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
@@ -215,14 +215,14 @@ async function upsertBitbucketComment(body, cfg) {
|
|
|
215
215
|
*/
|
|
216
216
|
async function findExisting(listUrl, init, extract, matches, opts, cursorNext) {
|
|
217
217
|
const base = listUrl;
|
|
218
|
-
const result = await (0,
|
|
218
|
+
const result = await (0, http_js_1.paginate)(listUrl, init, extract, (body, page, count) => (cursorNext ? cursorNext(body) : pageAfter(base, count, page)), opts);
|
|
219
219
|
if (!result.ok) {
|
|
220
220
|
// A failed search is not a failed post: fall through and create a comment.
|
|
221
221
|
// A duplicate is a far smaller problem than no report at all.
|
|
222
|
-
|
|
222
|
+
index_js_1.logger.warn(`[reporter]: ⚠️ Could not read existing comments (${result.error}) — will create`);
|
|
223
223
|
}
|
|
224
224
|
if (result.truncated) {
|
|
225
|
-
|
|
225
|
+
index_js_1.logger.warn('[reporter]: ⚠️ Stopped searching comments at the page limit — a duplicate summary is ' +
|
|
226
226
|
'possible (raise reporter.maxPages)');
|
|
227
227
|
}
|
|
228
228
|
return { reuse: result.items.find(matches) ?? null };
|
|
@@ -263,7 +263,7 @@ async function report(kind, result, cfg = {}) {
|
|
|
263
263
|
return SKIPPED;
|
|
264
264
|
// Nothing to say and nothing wrong: don't notify every PR subscriber.
|
|
265
265
|
if (cfg.skipWhenClean && result.summary.failed === 0 && result.summary.warned === 0) {
|
|
266
|
-
|
|
266
|
+
index_js_1.logger.info('[reporter]: Nothing to report (skipWhenClean)');
|
|
267
267
|
return SKIPPED;
|
|
268
268
|
}
|
|
269
269
|
const platform = kind === 'auto' ? detectPlatform() : kind === 'stdout' ? null : kind;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RunScope } from './types';
|
|
2
|
-
import { CheckContext, CheckReport, CheckStatus, RunOptions } from './types';
|
|
1
|
+
import type { RunScope } from './types.js';
|
|
2
|
+
import { CheckContext, CheckReport, CheckStatus, RunOptions } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Apply the universal `config.severity` override for a check. Only remaps
|
|
5
5
|
* between warn↔fail (pass/skip are never changed); `off` is handled earlier by
|
|
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.applySeverity = applySeverity;
|
|
4
4
|
exports.shouldReportDiffSkip = shouldReportDiffSkip;
|
|
5
5
|
exports.runChecks = runChecks;
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
6
|
+
const index_js_1 = require("../utils/index.js");
|
|
7
|
+
const package_version_js_1 = require("../utils/package-version.js");
|
|
8
|
+
const pool_js_1 = require("../utils/pool.js");
|
|
9
|
+
const resolve_bin_js_1 = require("../utils/resolve-bin.js");
|
|
10
|
+
const result_collector_js_1 = require("../utils/result-collector.js");
|
|
11
|
+
const context_js_1 = require("./context.js");
|
|
12
|
+
const prepare_js_1 = require("./install/prepare.js");
|
|
13
|
+
const registry_js_1 = require("./registry.js");
|
|
14
|
+
const reporters_js_1 = require("./reporters.js");
|
|
15
|
+
const types_js_1 = require("./types.js");
|
|
16
16
|
/**
|
|
17
17
|
* Resolve which checks to run: the built-in registry, custom `opts.checks`, or a mix.
|
|
18
18
|
* - no custom checks → the built-in registry
|
|
@@ -25,9 +25,9 @@ function resolveChecks(opts) {
|
|
|
25
25
|
if (opts.extendRegistry === false)
|
|
26
26
|
return custom;
|
|
27
27
|
if (custom.length === 0)
|
|
28
|
-
return
|
|
28
|
+
return registry_js_1.REGISTRY;
|
|
29
29
|
const byName = new Map();
|
|
30
|
-
for (const c of
|
|
30
|
+
for (const c of registry_js_1.REGISTRY)
|
|
31
31
|
byName.set(c.name, c);
|
|
32
32
|
for (const c of custom)
|
|
33
33
|
byName.set(c.name, c); // custom wins on name clash
|
|
@@ -45,7 +45,7 @@ async function emitReport(reporter, result, cfg) {
|
|
|
45
45
|
await reporter(result);
|
|
46
46
|
return { attempted: false, ok: true };
|
|
47
47
|
}
|
|
48
|
-
return (0,
|
|
48
|
+
return (0, reporters_js_1.report)(reporter ?? 'stdout', result, cfg);
|
|
49
49
|
}
|
|
50
50
|
/** Apply only/skip filters to the resolved check set. */
|
|
51
51
|
function selectChecks(checks, opts) {
|
|
@@ -168,19 +168,19 @@ async function runOne(check, ctx, collector, heavy, tooling) {
|
|
|
168
168
|
// client who made this check advisory does not get a hard failure out of
|
|
169
169
|
// `onMissingTool: "error"`, and one who promoted it does.
|
|
170
170
|
const status = applySeverity(check.name, tooling.fatal ? 'fail' : 'skip', ctx);
|
|
171
|
-
|
|
171
|
+
index_js_1.logger.warn(`[runChecks]: ${status === 'fail' ? '❌' : '⏭️'} ${check.name}: ${missing}`);
|
|
172
172
|
collector.register(check.name, status, `tooling unavailable — ${missing}`);
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
const started = Date.now();
|
|
176
176
|
const timeoutMs = ctx.config.run?.checkTimeoutMs ?? 300000;
|
|
177
|
-
const execute = () => (0,
|
|
178
|
-
|
|
177
|
+
const execute = () => (0, pool_js_1.withTimeout)(check.run(ctx), timeoutMs, () => {
|
|
178
|
+
index_js_1.logger.warn(`[runChecks]: ⏱️ ${check.name} exceeded ${timeoutMs}ms`);
|
|
179
179
|
return { status: 'warn', details: `timed out after ${timeoutMs}ms` };
|
|
180
180
|
});
|
|
181
181
|
const outcome = check.weight === 'heavy' ? await heavy.run(execute) : await execute();
|
|
182
182
|
if (ctx.config.run?.timings) {
|
|
183
|
-
|
|
183
|
+
index_js_1.logger.info(`[runChecks]: ${check.name} took ${Date.now() - started}ms`);
|
|
184
184
|
}
|
|
185
185
|
collector.register(check.name, applySeverity(check.name, outcome.status, ctx), outcome.details);
|
|
186
186
|
}
|
|
@@ -189,7 +189,7 @@ async function runOne(check, ctx, collector, heavy, tooling) {
|
|
|
189
189
|
// phases it only warns — those phases never block, matching the legacy pipeline.
|
|
190
190
|
const base = check.phase === 'blocking' ? 'fail' : 'warn';
|
|
191
191
|
const status = applySeverity(check.name, base, ctx);
|
|
192
|
-
|
|
192
|
+
index_js_1.logger.error(`[runChecks]: ${status === 'fail' ? '❌' : '⚠️'} ${check.name} threw: ${err}`);
|
|
193
193
|
collector.register(check.name, status, errMessage(err));
|
|
194
194
|
}
|
|
195
195
|
}
|
|
@@ -201,12 +201,12 @@ async function runOne(check, ctx, collector, heavy, tooling) {
|
|
|
201
201
|
* within a phase run in parallel.
|
|
202
202
|
*/
|
|
203
203
|
async function runChecks(opts = {}) {
|
|
204
|
-
const ctx = await (0,
|
|
204
|
+
const ctx = await (0, context_js_1.buildContext)(opts);
|
|
205
205
|
// `severity: { "<name>": "off" }` disables any check by name, universally —
|
|
206
206
|
// a superset of the per-check `enabled: false` flags.
|
|
207
207
|
const off = ctx.config.severity ?? {};
|
|
208
208
|
const selected = selectChecks(resolveChecks(opts), opts).filter(c => off[c.name] !== 'off');
|
|
209
|
-
const collector = new
|
|
209
|
+
const collector = new result_collector_js_1.ResultCollector();
|
|
210
210
|
// Config Validation verifies that `severity` keys name real checks. It reads
|
|
211
211
|
// the list from here rather than importing the registry, which would make
|
|
212
212
|
// registry → check → registry a cycle.
|
|
@@ -215,12 +215,12 @@ async function runChecks(opts = {}) {
|
|
|
215
215
|
// learn which ones are not. Doing this per-check would fetch the same profile
|
|
216
216
|
// from several checks at once and leave each of them guessing on failure.
|
|
217
217
|
const tooling = await prepareToolingFor(ctx, selected);
|
|
218
|
-
const limit = (0,
|
|
218
|
+
const limit = (0, pool_js_1.resolveConcurrency)(ctx.config.run?.concurrency);
|
|
219
219
|
const heavyLimit = Math.max(1, ctx.config.run?.heavyConcurrency ?? 1);
|
|
220
|
-
const heavy = new
|
|
221
|
-
for (const phase of
|
|
220
|
+
const heavy = new pool_js_1.Semaphore(heavyLimit);
|
|
221
|
+
for (const phase of types_js_1.PHASES) {
|
|
222
222
|
const inPhase = selected.filter(c => c.phase === phase);
|
|
223
|
-
await (0,
|
|
223
|
+
await (0, pool_js_1.runPool)(inPhase.map(c => () => runOne(c, ctx, collector, heavy, tooling)), limit);
|
|
224
224
|
}
|
|
225
225
|
reportDegradedScope(ctx, collector);
|
|
226
226
|
const build = () => {
|
|
@@ -254,7 +254,7 @@ async function runChecks(opts = {}) {
|
|
|
254
254
|
*/
|
|
255
255
|
async function prepareToolingFor(ctx, selected) {
|
|
256
256
|
try {
|
|
257
|
-
return await (0,
|
|
257
|
+
return await (0, prepare_js_1.prepareTooling)({
|
|
258
258
|
cwd: ctx.cwd,
|
|
259
259
|
config: ctx.config,
|
|
260
260
|
// A hand-built context (the SDK, a test) carries no counts. Treating its
|
|
@@ -262,15 +262,15 @@ async function prepareToolingFor(ctx, selected) {
|
|
|
262
262
|
// that names a language is asserting it, not guessing.
|
|
263
263
|
usage: ctx.usage ?? ctx.languages.map(lang => ({ lang, files: 1, marker: true })),
|
|
264
264
|
selected: selected.map(c => c.name),
|
|
265
|
-
version: (0,
|
|
265
|
+
version: (0, package_version_js_1.packageVersion)(),
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
catch (err) {
|
|
269
|
-
|
|
269
|
+
index_js_1.logger.warn(`[install]: ⚠️ could not prepare tooling: ${errMessage(err)}`);
|
|
270
270
|
// Preparation may have registered roots before it threw. Leaving them behind
|
|
271
271
|
// would point resolution at a half-installed directory for the whole run.
|
|
272
|
-
(0,
|
|
273
|
-
return (0,
|
|
272
|
+
(0, resolve_bin_js_1.clearToolPaths)();
|
|
273
|
+
return (0, prepare_js_1.noTooling)();
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
@@ -287,12 +287,12 @@ async function prepareToolingFor(ctx, selected) {
|
|
|
287
287
|
*/
|
|
288
288
|
function reportDegradedScope(ctx, collector) {
|
|
289
289
|
const mode = ctx.config.run?.onDegradedScope ?? 'warn';
|
|
290
|
-
if (mode === 'off' || !ctx.scope?.degraded || !(0,
|
|
290
|
+
if (mode === 'off' || !ctx.scope?.degraded || !(0, index_js_1.isCiEnvironment)())
|
|
291
291
|
return;
|
|
292
292
|
const dropped = collector
|
|
293
293
|
.getResults()
|
|
294
294
|
.filter(r => r.status === 'skip' && isDiffSkip(r.details)).length;
|
|
295
295
|
const detail = `${ctx.scope.reason}; ${dropped} diff-only check(s) did not run — set fetch-depth: 0`;
|
|
296
|
-
|
|
296
|
+
index_js_1.logger.error(`[runChecks]: ${mode === 'error' ? '❌' : '⚠️'} Degraded scope: ${detail}`);
|
|
297
297
|
collector.register('Scan Scope', mode === 'error' ? 'fail' : 'warn', detail);
|
|
298
298
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CheckContext, type CheckOutcome } from './types';
|
|
1
|
+
import { type CheckContext, type CheckOutcome } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Drop files that live under any excluded directory (client `ignoreDirs` or the
|
|
4
4
|
* curated default), matched on any path segment so nesting depth doesn't matter.
|