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
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import type { PRCheckMateConfig, ReporterConfig } from '../interfaces/index.js';
|
|
2
|
+
import type { Language, LanguageUsage } from '../utils/detect-language.js';
|
|
3
|
+
import type { CheckResult, CheckStatus } from '../utils/result-collector.js';
|
|
4
|
+
export type { CheckResult, CheckStatus, Language, LanguageUsage };
|
|
5
|
+
/**
|
|
6
|
+
* Execution phases, run strictly in order. Within a phase checks run in parallel.
|
|
7
|
+
* `format` runs last because formatters (prettier) may write files.
|
|
8
|
+
*/
|
|
9
|
+
export type Phase = 'blocking' | 'informational' | 'format';
|
|
10
|
+
export declare const PHASES: readonly Phase[];
|
|
11
|
+
/**
|
|
12
|
+
* What this run is looking at, and whether that is what was asked for.
|
|
13
|
+
*
|
|
14
|
+
* `degraded` is the field that earns this its own type: a full scan requested by
|
|
15
|
+
* a human and a full scan we fell back to because the PR base was missing are
|
|
16
|
+
* indistinguishable in the results — both just omit every delta-only check — but
|
|
17
|
+
* only one of them is a problem worth telling anyone about.
|
|
18
|
+
*/
|
|
19
|
+
export interface RunScope {
|
|
20
|
+
kind: 'delta' | 'full' | 'staged';
|
|
21
|
+
/** Short explanation for the log line, e.g. `PR base unavailable`. */
|
|
22
|
+
reason?: string;
|
|
23
|
+
/** True when a diff range was wanted but could not be built. */
|
|
24
|
+
degraded: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Everything a check needs to run. Assembled once by `buildContext` and shared
|
|
28
|
+
* across all checks — no check reads `process.cwd()` or `process.env` directly.
|
|
29
|
+
*/
|
|
30
|
+
export interface CheckContext {
|
|
31
|
+
/** Repository root the checks operate on. */
|
|
32
|
+
cwd: string;
|
|
33
|
+
/** Languages detected (or supplied) for this repo — drives `applies` gating. */
|
|
34
|
+
languages: Language[];
|
|
35
|
+
/**
|
|
36
|
+
* The same detection with its evidence — file counts per language. Read by the
|
|
37
|
+
* install layer, which must not confuse "this language is here" with "this
|
|
38
|
+
* language is worth a toolchain download". Absent on hand-built contexts.
|
|
39
|
+
*/
|
|
40
|
+
usage?: LanguageUsage[];
|
|
41
|
+
/** Merged pr-checkmate.json + defaults. */
|
|
42
|
+
config: PRCheckMateConfig;
|
|
43
|
+
/** When false, checks that would modify files (prettier, --fix) run read-only or skip the write. */
|
|
44
|
+
write: boolean;
|
|
45
|
+
/** Diff range for delta-aware checks; undefined → full-repo scan. */
|
|
46
|
+
baseSha?: string;
|
|
47
|
+
headSha?: string;
|
|
48
|
+
/** What this run is looking at, and why. Optional so hand-built contexts stay terse. */
|
|
49
|
+
scope?: RunScope;
|
|
50
|
+
/**
|
|
51
|
+
* Display names of the checks in this run, for the one check that reasons about
|
|
52
|
+
* the others (Config Validation, verifying `severity` keys).
|
|
53
|
+
*
|
|
54
|
+
* Passed down rather than imported: a check importing the registry would close
|
|
55
|
+
* the loop registry → check → registry, and it also lets custom checks supplied
|
|
56
|
+
* through `RunOptions.checks` be validated like built-in ones.
|
|
57
|
+
*/
|
|
58
|
+
checkNames?: string[];
|
|
59
|
+
/**
|
|
60
|
+
* Per-run memoization cache for identical git invocations (many checks diff
|
|
61
|
+
* the same range). Created once per `runChecks`; safe because git state is
|
|
62
|
+
* stable within a run. Keyed by the git args.
|
|
63
|
+
*/
|
|
64
|
+
cache?: Map<string, string>;
|
|
65
|
+
}
|
|
66
|
+
/** Outcome of a single check — the name is attached by the orchestrator. */
|
|
67
|
+
export interface CheckOutcome {
|
|
68
|
+
status: CheckStatus;
|
|
69
|
+
details?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A single quality gate. `applies` decides relevance (language/marker gating);
|
|
73
|
+
* `run` performs the check and returns an outcome. `run` must NOT throw for
|
|
74
|
+
* violations — return `fail`/`warn` instead. Thrown errors are caught by the
|
|
75
|
+
* orchestrator and recorded as `fail`.
|
|
76
|
+
*/
|
|
77
|
+
export interface Check {
|
|
78
|
+
name: string;
|
|
79
|
+
phase: Phase;
|
|
80
|
+
/**
|
|
81
|
+
* The check reviews a diff and has nothing to say without one. Declared here
|
|
82
|
+
* rather than folded into `applies` so the orchestrator can tell the two kinds
|
|
83
|
+
* of "not applicable" apart:
|
|
84
|
+
*
|
|
85
|
+
* - a check that does not apply (SwiftLint in a Python repo) is noise, and is
|
|
86
|
+
* left out of the report entirely;
|
|
87
|
+
* - a check that *would* have applied but had no diff range is a gap in
|
|
88
|
+
* coverage, and is reported as a skip with the reason.
|
|
89
|
+
*
|
|
90
|
+
* Before this existed, both simply vanished — so a shallow clone removed most
|
|
91
|
+
* of the security surface and still printed a clean, complete-looking report.
|
|
92
|
+
*/
|
|
93
|
+
requiresDiff?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* The check spawns something expensive — a whole-project analyser like knip,
|
|
96
|
+
* jscpd, dpdm, tsc or grype. The orchestrator admits only a couple of these at
|
|
97
|
+
* once, independently of the overall concurrency limit: four regex scans in
|
|
98
|
+
* parallel are free, four project-wide analysers are not.
|
|
99
|
+
*/
|
|
100
|
+
weight?: 'heavy';
|
|
101
|
+
applies(ctx: CheckContext): boolean | Promise<boolean>;
|
|
102
|
+
run(ctx: CheckContext): Promise<CheckOutcome>;
|
|
103
|
+
}
|
|
104
|
+
export type ReporterKind = 'none' | 'stdout' | 'github' | 'gitlab' | 'bitbucket' | 'auto';
|
|
105
|
+
/** Custom reporter: receives the final report to emit however the consumer wants. */
|
|
106
|
+
export type ReporterFn = (report: CheckReport) => void | Promise<void>;
|
|
107
|
+
export type { ReporterConfig };
|
|
108
|
+
export interface RunOptions {
|
|
109
|
+
cwd?: string;
|
|
110
|
+
/** Override language detection (e.g. PRValidator passes its already-detected type). */
|
|
111
|
+
languages?: Language[];
|
|
112
|
+
/** Whitelist of check names — when set, only these run. */
|
|
113
|
+
only?: string[];
|
|
114
|
+
/** Blacklist of check names — always excluded. */
|
|
115
|
+
skip?: string[];
|
|
116
|
+
/**
|
|
117
|
+
* Extra checks to run. Combined with the built-in registry per `extendRegistry`.
|
|
118
|
+
* Lets consumers (e.g. PRValidator) plug their own `Check`s into the same pipeline.
|
|
119
|
+
*/
|
|
120
|
+
checks?: Check[];
|
|
121
|
+
/**
|
|
122
|
+
* How `checks` combines with the built-in registry:
|
|
123
|
+
* - `true` (default when `checks` is set): append; a custom check overrides a
|
|
124
|
+
* built-in one with the same name.
|
|
125
|
+
* - `false`: run ONLY the provided `checks`, ignoring the built-in registry.
|
|
126
|
+
*/
|
|
127
|
+
extendRegistry?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Where the report goes:
|
|
130
|
+
* - `'none'`: nothing (just return the report)
|
|
131
|
+
* - `'stdout'`: print the summary table
|
|
132
|
+
* - `'github'`: print + upsert a PR comment
|
|
133
|
+
* - a function: receives the `CheckReport` (e.g. forward to Slack).
|
|
134
|
+
*/
|
|
135
|
+
reporter?: ReporterKind | ReporterFn;
|
|
136
|
+
/** Allow file-modifying checks to write. Default false. */
|
|
137
|
+
write?: boolean;
|
|
138
|
+
config?: PRCheckMateConfig;
|
|
139
|
+
baseSha?: string;
|
|
140
|
+
headSha?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Pre-commit / local mode: check the staged changes (index vs HEAD) instead of
|
|
143
|
+
* a PR range. Implemented by diffing HEAD against the index tree
|
|
144
|
+
* (`git write-tree`), so every delta-aware check works unchanged.
|
|
145
|
+
*/
|
|
146
|
+
staged?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Review every tracked file instead of a diff (`--full` on the CLI, and the
|
|
149
|
+
* default when no CI environment is detected). Takes precedence over every other
|
|
150
|
+
* range source, including CI variables — see `planDiffRange`. The 16 checks that
|
|
151
|
+
* are about a diff by definition (PR Size, Diff Security, Merge Conflict, …) gate
|
|
152
|
+
* their own `applies` on `baseSha`, so they drop out of the report rather than
|
|
153
|
+
* misreporting.
|
|
154
|
+
*/
|
|
155
|
+
full?: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface CheckReport {
|
|
158
|
+
results: CheckResult[];
|
|
159
|
+
summary: {
|
|
160
|
+
passed: number;
|
|
161
|
+
warned: number;
|
|
162
|
+
failed: number;
|
|
163
|
+
skipped: number;
|
|
164
|
+
};
|
|
165
|
+
/** True when no check failed (warnings/skips do not affect it). */
|
|
166
|
+
ok: boolean;
|
|
167
|
+
}
|
|
168
|
+
/** Outcome constructors — keep check bodies terse. */
|
|
169
|
+
export declare const pass: (details?: string) => CheckOutcome;
|
|
170
|
+
export declare const warn: (details: string) => CheckOutcome;
|
|
171
|
+
export declare const fail: (details: string) => CheckOutcome;
|
|
172
|
+
export declare const skip: (details: string) => CheckOutcome;
|
|
173
|
+
/**
|
|
174
|
+
* Whether this repository is an npm project — the gate for every check that reads
|
|
175
|
+
* the npm dependency tree (NPM Audit, Dependencies, License Check, Outdated Deps).
|
|
176
|
+
*
|
|
177
|
+
* A `package.json` on its own is not the answer, and this is the one predicate
|
|
178
|
+
* where that matters most: installing pr-checkmate as a devDependency *creates*
|
|
179
|
+
* that file. Gate on it alone and a Python service gets four rows auditing the
|
|
180
|
+
* dependency tree of the tool auditing it — `npm audit` over our own transitive
|
|
181
|
+
* packages, licences of our own `node_modules`, "outdated" versions of tooling
|
|
182
|
+
* the team never chose. All four are unactionable by construction: nothing in the
|
|
183
|
+
* repository's own code can change any of them.
|
|
184
|
+
*
|
|
185
|
+
* So both halves must hold — a manifest to read, and JavaScript or TypeScript
|
|
186
|
+
* actually written here. A polyglot repository (a Django backend with a JS
|
|
187
|
+
* frontend) satisfies both and keeps every check; a Python repository whose only
|
|
188
|
+
* `package.json` is the one that installed us satisfies neither.
|
|
189
|
+
*/
|
|
190
|
+
export declare function isNpmProject(ctx: CheckContext): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Identity helper for authoring a `Check` with full type inference and checking.
|
|
193
|
+
* Purely ergonomic — `defineCheck({ ... })` is equivalent to `{ ... } satisfies Check`.
|
|
194
|
+
*/
|
|
195
|
+
export declare const defineCheck: (check: Check) => Check;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
export const PHASES = ['blocking', 'informational', 'format'];
|
|
4
|
+
/** Outcome constructors — keep check bodies terse. */
|
|
5
|
+
export const pass = (details) => ({
|
|
6
|
+
status: 'pass',
|
|
7
|
+
...(details ? { details } : {}),
|
|
8
|
+
});
|
|
9
|
+
export const warn = (details) => ({ status: 'warn', details });
|
|
10
|
+
export const fail = (details) => ({ status: 'fail', details });
|
|
11
|
+
export const skip = (details) => ({ status: 'skip', details });
|
|
12
|
+
/**
|
|
13
|
+
* Whether this repository is an npm project — the gate for every check that reads
|
|
14
|
+
* the npm dependency tree (NPM Audit, Dependencies, License Check, Outdated Deps).
|
|
15
|
+
*
|
|
16
|
+
* A `package.json` on its own is not the answer, and this is the one predicate
|
|
17
|
+
* where that matters most: installing pr-checkmate as a devDependency *creates*
|
|
18
|
+
* that file. Gate on it alone and a Python service gets four rows auditing the
|
|
19
|
+
* dependency tree of the tool auditing it — `npm audit` over our own transitive
|
|
20
|
+
* packages, licences of our own `node_modules`, "outdated" versions of tooling
|
|
21
|
+
* the team never chose. All four are unactionable by construction: nothing in the
|
|
22
|
+
* repository's own code can change any of them.
|
|
23
|
+
*
|
|
24
|
+
* So both halves must hold — a manifest to read, and JavaScript or TypeScript
|
|
25
|
+
* actually written here. A polyglot repository (a Django backend with a JS
|
|
26
|
+
* frontend) satisfies both and keeps every check; a Python repository whose only
|
|
27
|
+
* `package.json` is the one that installed us satisfies neither.
|
|
28
|
+
*/
|
|
29
|
+
export function isNpmProject(ctx) {
|
|
30
|
+
if (!ctx.languages.includes('javascript') && !ctx.languages.includes('typescript'))
|
|
31
|
+
return false;
|
|
32
|
+
return fs.existsSync(path.join(ctx.cwd, 'package.json'));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Identity helper for authoring a `Check` with full type inference and checking.
|
|
36
|
+
* Purely ergonomic — `defineCheck({ ... })` is equivalent to `{ ... } satisfies Check`.
|
|
37
|
+
*/
|
|
38
|
+
export const defineCheck = (check) => check;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PR CheckMate — automated PR quality checks.
|
|
3
|
+
*
|
|
4
|
+
* @module pr-checkmate
|
|
5
|
+
*/
|
|
6
|
+
export { runChecks, buildContext, REGISTRY } from './core/index.js';
|
|
7
|
+
export { pass, warn, fail, skip, defineCheck } from './core/index.js';
|
|
8
|
+
export type { Check, CheckContext, CheckOutcome, CheckReport, CheckResult, CheckStatus, Language, Phase, ReporterFn, ReporterKind, RunOptions, } from './core/index.js';
|
|
9
|
+
export { getSourcePath, getSourcePaths, getIgnoredDirs, getPackageConfigPath, hasLocalConfig, } from './config/index.js';
|
|
10
|
+
export type { PRCheckMateConfig } from './interfaces/index.js';
|
|
11
|
+
export { Logger } from './utils/logger.js';
|
|
12
|
+
export type { LogLevel } from './utils/logger.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PR CheckMate — automated PR quality checks.
|
|
3
|
+
*
|
|
4
|
+
* @module pr-checkmate
|
|
5
|
+
*/
|
|
6
|
+
// Primary programmatic API: run checks and receive a structured report.
|
|
7
|
+
// Never throws for violations, never calls process.exit — the caller decides.
|
|
8
|
+
export { runChecks, buildContext, REGISTRY } from './core/index.js';
|
|
9
|
+
// Authoring helpers for consumers writing their own checks (plugins).
|
|
10
|
+
export { pass, warn, fail, skip, defineCheck } from './core/index.js';
|
|
11
|
+
// Config helpers for consumers embedding pr-checkmate.
|
|
12
|
+
export { getSourcePath, getSourcePaths, getIgnoredDirs, getPackageConfigPath, hasLocalConfig, } from './config/index.js';
|
|
13
|
+
// Standalone logging utility. Consumers instantiate their own Logger so their
|
|
14
|
+
// log level and buffer stay independent from pr-checkmate's internal logger.
|
|
15
|
+
export { Logger } from './utils/logger.js';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** How strictly the generated workflow treats a failed run. */
|
|
2
|
+
type GateMode = 'strict' | 'advisory';
|
|
3
|
+
/**
|
|
4
|
+
* Write the bundled GitHub Actions workflow into the consumer repo.
|
|
5
|
+
*
|
|
6
|
+
* Never overwrites an existing file. `init` is not a one-time command — the
|
|
7
|
+
* update notice asks people to re-run it after every upgrade — so clobbering
|
|
8
|
+
* would quietly discard whatever they had tuned, including the gate setting they
|
|
9
|
+
* were just asked about.
|
|
10
|
+
*/
|
|
11
|
+
export declare function setupWorkflow(root: string, mode: GateMode): void;
|
|
12
|
+
/**
|
|
13
|
+
* Every check that fails the run out of the box, written into the generated
|
|
14
|
+
* config at its real default.
|
|
15
|
+
*
|
|
16
|
+
* Not a copy of a default for its own sake — this one is the gate's teeth, and
|
|
17
|
+
* the client is entitled to see which checks can stop their merge without
|
|
18
|
+
* reading our source or discovering it from a red pipeline. Written as `"error"`
|
|
19
|
+
* so the edit is in place: change the value, or delete the line to inherit
|
|
20
|
+
* whatever we ship next.
|
|
21
|
+
*
|
|
22
|
+
* Two things are deliberately absent. `Custom Rules` and `Banned Imports` can
|
|
23
|
+
* block too, but only for rules the client writes themselves, so listing them
|
|
24
|
+
* would suggest a gate that is inert until they act. And `Dockerfile Security`
|
|
25
|
+
* looks like it belongs here and does not: every one of its patterns is rated
|
|
26
|
+
* `warn`, so it never fails on its own.
|
|
27
|
+
*
|
|
28
|
+
* Keep in step with the checks' own defaults — `blocking-checks.test.ts` pins
|
|
29
|
+
* every name here to the registry, which catches a rename but not a change of
|
|
30
|
+
* heart about what should block.
|
|
31
|
+
*/
|
|
32
|
+
export declare const BLOCKING_BY_DEFAULT: readonly ["Security Scan", "Sensitive Files", "Diff Security", "Workflow Security", "Merge Conflict", "NPM Audit", "License Check", "Dependencies", "TypeScript", "ESLint", "YAML Lint"];
|
|
33
|
+
export declare function buildInitialConfig(sourcePath: string, languages: string[]): Record<string, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Initialize (or refresh) pr-checkmate configuration in the current project.
|
|
36
|
+
*/
|
|
37
|
+
export declare function init(): Promise<void>;
|
|
38
|
+
export {};
|