pr-checkmate 3.0.4 → 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/package.json +15 -13
- 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
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.pythonFormatCheck = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
9
|
+
const index_js_1 = require("../../../utils/index.js");
|
|
10
|
+
const targets_js_1 = require("../../targets.js");
|
|
11
|
+
const types_js_1 = require("../../types.js");
|
|
12
|
+
const ruff_shared_js_1 = require("./ruff-shared.js");
|
|
13
13
|
/**
|
|
14
14
|
* Formats changed Python files with Ruff's formatter (WASM, no Python/pip needed).
|
|
15
15
|
* Read-only in check mode (`warn` when files differ from formatted output); rewrites
|
|
@@ -24,12 +24,12 @@ exports.pythonFormatCheck = {
|
|
|
24
24
|
ctx.languages.includes('python'));
|
|
25
25
|
},
|
|
26
26
|
async run(ctx) {
|
|
27
|
-
const targets = await (0,
|
|
27
|
+
const targets = await (0, targets_js_1.resolveTargetFiles)(ctx, ruff_shared_js_1.PY_GLOBS);
|
|
28
28
|
if (targets === null)
|
|
29
|
-
return (0,
|
|
29
|
+
return (0, types_js_1.skip)('git unavailable');
|
|
30
30
|
if (targets.length === 0)
|
|
31
|
-
return (0,
|
|
32
|
-
const workspace = (0,
|
|
31
|
+
return (0, types_js_1.pass)('no Python files changed');
|
|
32
|
+
const workspace = (0, ruff_shared_js_1.createRuffWorkspace)();
|
|
33
33
|
let unformatted = 0;
|
|
34
34
|
for (const rel of targets) {
|
|
35
35
|
const abs = node_path_1.default.join(ctx.cwd, rel);
|
|
@@ -46,7 +46,7 @@ exports.pythonFormatCheck = {
|
|
|
46
46
|
}
|
|
47
47
|
catch (err) {
|
|
48
48
|
// A syntax error makes Ruff throw — that's a lint concern, not a format failure.
|
|
49
|
-
|
|
49
|
+
index_js_1.logger.warn(`[Ruff Format]: ⚠️ Could not format ${rel} (syntax error?)\n${err}`);
|
|
50
50
|
continue;
|
|
51
51
|
}
|
|
52
52
|
if (formatted === content)
|
|
@@ -56,12 +56,12 @@ exports.pythonFormatCheck = {
|
|
|
56
56
|
node_fs_1.default.writeFileSync(abs, formatted);
|
|
57
57
|
}
|
|
58
58
|
if (unformatted === 0)
|
|
59
|
-
return (0,
|
|
59
|
+
return (0, types_js_1.pass)();
|
|
60
60
|
if (!ctx.write) {
|
|
61
|
-
|
|
62
|
-
return (0,
|
|
61
|
+
index_js_1.logger.warn(`[Ruff Format]: ⚠️ ${unformatted} Python file(s) need formatting`);
|
|
62
|
+
return (0, types_js_1.warn)(`${unformatted} file(s) need formatting (run with write to fix)`);
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
return (0,
|
|
64
|
+
index_js_1.logger.info(`[Ruff Format]: ✅ Reformatted ${unformatted} Python file(s)`);
|
|
65
|
+
return (0, types_js_1.pass)(`reformatted ${unformatted} file(s)`);
|
|
66
66
|
},
|
|
67
67
|
};
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.pythonLintCheck = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
9
|
+
const index_js_1 = require("../../../utils/index.js");
|
|
10
|
+
const targets_js_1 = require("../../targets.js");
|
|
11
|
+
const types_js_1 = require("../../types.js");
|
|
12
|
+
const ruff_shared_js_1 = require("./ruff-shared.js");
|
|
13
13
|
/**
|
|
14
14
|
* Lints changed Python files with Ruff, bundled as a self-contained WASM module
|
|
15
15
|
* (`@astral-sh/ruff-wasm-nodejs`) so it runs on a bare Node image with no Python
|
|
@@ -26,12 +26,12 @@ exports.pythonLintCheck = {
|
|
|
26
26
|
ctx.languages.includes('python'));
|
|
27
27
|
},
|
|
28
28
|
async run(ctx) {
|
|
29
|
-
const targets = await (0,
|
|
29
|
+
const targets = await (0, targets_js_1.resolveTargetFiles)(ctx, ruff_shared_js_1.PY_GLOBS);
|
|
30
30
|
if (targets === null)
|
|
31
|
-
return (0,
|
|
31
|
+
return (0, types_js_1.skip)('git unavailable');
|
|
32
32
|
if (targets.length === 0)
|
|
33
|
-
return (0,
|
|
34
|
-
const workspace = (0,
|
|
33
|
+
return (0, types_js_1.pass)('no Python files changed');
|
|
34
|
+
const workspace = (0, ruff_shared_js_1.createRuffWorkspace)();
|
|
35
35
|
let totalIssues = 0;
|
|
36
36
|
let filesWithIssues = 0;
|
|
37
37
|
for (const rel of targets) {
|
|
@@ -47,15 +47,15 @@ exports.pythonLintCheck = {
|
|
|
47
47
|
continue;
|
|
48
48
|
filesWithIssues += 1;
|
|
49
49
|
totalIssues += diagnostics.length;
|
|
50
|
-
|
|
50
|
+
index_js_1.logger.warn(`[Ruff Lint]: ⚠️ ${rel}: ${diagnostics.length} issue(s)`);
|
|
51
51
|
diagnostics
|
|
52
52
|
.slice(0, 5)
|
|
53
|
-
.forEach((d) =>
|
|
53
|
+
.forEach((d) => index_js_1.logger.warn(` ${rel}:${d.start_location.row} ${d.code ?? '?'} ${d.message}`));
|
|
54
54
|
if (diagnostics.length > 5)
|
|
55
|
-
|
|
55
|
+
index_js_1.logger.warn(` ... and ${diagnostics.length - 5} more`);
|
|
56
56
|
}
|
|
57
57
|
if (totalIssues === 0)
|
|
58
|
-
return (0,
|
|
59
|
-
return (0,
|
|
58
|
+
return (0, types_js_1.pass)();
|
|
59
|
+
return (0, types_js_1.warn)(`${totalIssues} issue(s) in ${filesWithIssues} file(s)`);
|
|
60
60
|
},
|
|
61
61
|
};
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.pythonTypecheckCheck = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
9
|
+
const index_js_1 = require("../../../utils/index.js");
|
|
10
|
+
const targets_js_1 = require("../../targets.js");
|
|
11
|
+
const types_js_1 = require("../../types.js");
|
|
12
|
+
const findings_js_1 = require("../findings.js");
|
|
13
|
+
const tool_install_js_1 = require("../tool-install.js");
|
|
14
|
+
const external_runner_js_1 = require("./external-runner.js");
|
|
15
|
+
const ruff_shared_js_1 = require("./ruff-shared.js");
|
|
16
16
|
/** How many diagnostics reach the log before the rest are counted instead. */
|
|
17
17
|
const MAX_LOGGED = 10;
|
|
18
18
|
/** The check's display name — the log prefix, and the row in the report. */
|
|
@@ -64,7 +64,7 @@ function hasOwnPyrightConfig(cwd) {
|
|
|
64
64
|
/** Where our copy of pyright lives — bundled, or in a fetched profile. */
|
|
65
65
|
function resolvePyright() {
|
|
66
66
|
try {
|
|
67
|
-
return (0,
|
|
67
|
+
return (0, index_js_1.resolvePackageBin)('pyright', 'index.js');
|
|
68
68
|
}
|
|
69
69
|
catch {
|
|
70
70
|
return null;
|
|
@@ -74,12 +74,12 @@ function resolvePyright() {
|
|
|
74
74
|
function reportMypy(output) {
|
|
75
75
|
const lines = output.split('\n').filter(line => /\berror\b|\bwarning\b/i.test(line));
|
|
76
76
|
if (lines.length === 0)
|
|
77
|
-
return (0,
|
|
77
|
+
return (0, types_js_1.pass)();
|
|
78
78
|
// "Found 3 errors in 1 file (checked 12 source files)" — mypy's own count says
|
|
79
79
|
// more than a tally of lines that merely contained the word.
|
|
80
80
|
const summary = lines.find(line => /found\s+\d+\s+error/i.test(line))?.trim();
|
|
81
|
-
(0,
|
|
82
|
-
return (0,
|
|
81
|
+
(0, findings_js_1.logSample)(NAME, 'type issues (mypy):', lines);
|
|
82
|
+
return (0, types_js_1.warn)(summary ?? `${lines.length} type issue(s)`);
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
85
|
* Type-check with our own pyright, and report only what the client can act on.
|
|
@@ -95,8 +95,8 @@ function reportPyright(ctx, stdout) {
|
|
|
95
95
|
catch {
|
|
96
96
|
// Pyright exits non-zero for a bad invocation too, and calling that a type
|
|
97
97
|
// error would put a finding in the report that is really our own bug.
|
|
98
|
-
|
|
99
|
-
return (0,
|
|
98
|
+
index_js_1.logger.warn(`[${NAME}]: ⚠️ pyright produced no readable report`);
|
|
99
|
+
return (0, types_js_1.skip)('pyright produced no readable report');
|
|
100
100
|
}
|
|
101
101
|
const diagnostics = (report.generalDiagnostics ?? []).filter(diagnostic => diagnostic.severity !== 'information');
|
|
102
102
|
// Nothing downstream of an unresolved import can be trusted, so this is
|
|
@@ -116,24 +116,24 @@ function reportPyright(ctx, stdout) {
|
|
|
116
116
|
];
|
|
117
117
|
const named = modules.slice(0, NAMED_IMPORTS).join(', ');
|
|
118
118
|
const rest = modules.length > NAMED_IMPORTS ? ` and ${modules.length - NAMED_IMPORTS} more` : '';
|
|
119
|
-
|
|
120
|
-
return (0,
|
|
119
|
+
index_js_1.logger.warn(`[${NAME}]: ⚠️ ${unresolved.length} import(s) could not be resolved — not type-checking`);
|
|
120
|
+
return (0, types_js_1.skip)(`project dependencies not installed (${named || `${unresolved.length} import(s)`}${rest}) ` +
|
|
121
121
|
'— run `pip install` before typecheck');
|
|
122
122
|
}
|
|
123
123
|
if (diagnostics.length === 0) {
|
|
124
|
-
|
|
125
|
-
return (0,
|
|
124
|
+
index_js_1.logger.info(`[${NAME}]: ✅ No type errors (pyright)`);
|
|
125
|
+
return (0, types_js_1.pass)();
|
|
126
126
|
}
|
|
127
127
|
const errors = diagnostics.filter(diagnostic => diagnostic.severity === 'error').length;
|
|
128
128
|
const summary = `${errors} error(s), ${diagnostics.length - errors} warning(s)`;
|
|
129
|
-
(0,
|
|
129
|
+
(0, findings_js_1.logSample)(NAME, `type issues (pyright): ${summary}`, diagnostics.slice(0, MAX_LOGGED).map(diagnostic => {
|
|
130
130
|
const rel = node_path_1.default.relative(ctx.cwd, diagnostic.file) || diagnostic.file;
|
|
131
131
|
// Pyright counts lines from zero; every other tool in the report counts
|
|
132
132
|
// from one, and a line number that is off by one is worse than none.
|
|
133
133
|
const line = (diagnostic.range?.start?.line ?? 0) + 1;
|
|
134
134
|
return `${rel}:${line} ${diagnostic.severity}: ${diagnostic.message.split('\n')[0]}`;
|
|
135
135
|
}));
|
|
136
|
-
return (0,
|
|
136
|
+
return (0, types_js_1.warn)(summary);
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Type-checks changed Python files — the Python analogue of `tsc --noEmit`.
|
|
@@ -156,35 +156,35 @@ exports.pythonTypecheckCheck = {
|
|
|
156
156
|
ctx.languages.includes('python'));
|
|
157
157
|
},
|
|
158
158
|
async run(ctx) {
|
|
159
|
-
const targets = await (0,
|
|
159
|
+
const targets = await (0, targets_js_1.resolveTargetFiles)(ctx, ruff_shared_js_1.PY_GLOBS);
|
|
160
160
|
if (targets === null)
|
|
161
|
-
return (0,
|
|
161
|
+
return (0, types_js_1.skip)('git unavailable');
|
|
162
162
|
if (targets.length === 0)
|
|
163
|
-
return (0,
|
|
163
|
+
return (0, types_js_1.pass)('no Python files changed');
|
|
164
164
|
const forced = ctx.config.python?.typeChecker;
|
|
165
165
|
if (forced !== 'pyright') {
|
|
166
|
-
const mypy = await (0,
|
|
166
|
+
const mypy = await (0, external_runner_js_1.runTool)(ctx, 'mypy', targets);
|
|
167
167
|
if (!mypy.missing) {
|
|
168
168
|
if (mypy.exitCode === 0) {
|
|
169
|
-
|
|
170
|
-
return (0,
|
|
169
|
+
index_js_1.logger.info(`[${NAME}]: ✅ No type errors (mypy)`);
|
|
170
|
+
return (0, types_js_1.pass)();
|
|
171
171
|
}
|
|
172
172
|
return reportMypy([mypy.stdout, mypy.stderr].filter(Boolean).join('\n'));
|
|
173
173
|
}
|
|
174
174
|
// Asking for mypy by name and not having it is a configuration error the
|
|
175
175
|
// client meant to make visible; falling back to pyright would hide it.
|
|
176
176
|
if (forced === 'mypy')
|
|
177
|
-
return (0,
|
|
177
|
+
return (0, tool_install_js_1.notInstalled)('mypy', 'mypy');
|
|
178
178
|
}
|
|
179
179
|
const entry = resolvePyright();
|
|
180
180
|
if (!entry)
|
|
181
|
-
return (0,
|
|
182
|
-
const result = await (0,
|
|
181
|
+
return (0, tool_install_js_1.notInstalled)('pyright', 'pyright');
|
|
182
|
+
const result = await (0, external_runner_js_1.runTool)(ctx, process.execPath, [entry, '--outputjson', ...targets]);
|
|
183
183
|
// The binary here is the Node running this process, so `missing` is not a
|
|
184
184
|
// reachable state — it is a case of the type, folded in rather than asserted
|
|
185
185
|
// away.
|
|
186
186
|
if (result.missing)
|
|
187
|
-
return (0,
|
|
187
|
+
return (0, tool_install_js_1.notInstalled)('pyright', 'pyright');
|
|
188
188
|
return reportPyright(ctx, result.stdout);
|
|
189
189
|
},
|
|
190
190
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Check } from '../../types';
|
|
1
|
+
import { Check } from '../../types.js';
|
|
2
2
|
export declare const typecheckCheck: Check;
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.typecheckCheck = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
9
|
+
const execa_js_1 = require("../../../utils/execa.js");
|
|
10
|
+
const index_js_1 = require("../../../utils/index.js");
|
|
11
|
+
const reuse_js_1 = require("../../install/reuse.js");
|
|
12
|
+
const types_js_1 = require("../../types.js");
|
|
13
13
|
/**
|
|
14
14
|
* Prefer the consumer project's own TypeScript so its tsconfig is compiled by the
|
|
15
15
|
* version it was written for; fall back to the compiler bundled with pr-checkmate.
|
|
@@ -19,8 +19,8 @@ function resolveTsc(ctx) {
|
|
|
19
19
|
// `tsconfig.json` in the repository, so the compiler their config was written
|
|
20
20
|
// for is always theirs. `install.reuseLocal: "off"` still overrides, for a
|
|
21
21
|
// client who wants our pinned compiler for reproducibility.
|
|
22
|
-
return (0,
|
|
23
|
-
paths: (0,
|
|
22
|
+
return (0, index_js_1.resolvePackageBin)('typescript', 'bin/tsc', {
|
|
23
|
+
paths: (0, reuse_js_1.clientToolPaths)('typescript', ctx, { clientOwnsConfig: true }),
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
exports.typecheckCheck = {
|
|
@@ -42,26 +42,26 @@ exports.typecheckCheck = {
|
|
|
42
42
|
// "cannot find type definition file" errors that look like code problems but are
|
|
43
43
|
// really a setup gap. Skip with an actionable message instead of failing the PR.
|
|
44
44
|
if (!node_fs_1.default.existsSync(node_path_1.default.join(ctx.cwd, 'node_modules'))) {
|
|
45
|
-
return (0,
|
|
45
|
+
return (0, types_js_1.skip)('project dependencies not installed (no node_modules) — run `npm ci` before typecheck');
|
|
46
46
|
}
|
|
47
47
|
const tscBin = resolveTsc(ctx);
|
|
48
|
-
const result = await (0,
|
|
48
|
+
const result = await (0, execa_js_1.execa)(process.execPath, [tscBin, '--noEmit'], {
|
|
49
49
|
cwd: ctx.cwd,
|
|
50
50
|
reject: false,
|
|
51
51
|
});
|
|
52
52
|
if (result.exitCode === 0)
|
|
53
|
-
return (0,
|
|
53
|
+
return (0, types_js_1.pass)();
|
|
54
54
|
const output = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
55
55
|
const errorCount = (output.match(/error TS\d+/g) ?? []).length;
|
|
56
56
|
if (output)
|
|
57
|
-
|
|
57
|
+
index_js_1.logger.warn(output);
|
|
58
58
|
// A non-zero exit with no diagnostic in it is not a type error — tsc was
|
|
59
59
|
// killed (OOM on a large project), crashed, or never started. Reporting that
|
|
60
60
|
// as `0 type error(s)` blocked PRs with a message naming nothing to fix.
|
|
61
61
|
if (errorCount === 0) {
|
|
62
|
-
|
|
63
|
-
return (0,
|
|
62
|
+
index_js_1.logger.warn(`[TypeScript]: ⚠️ tsc exited ${result.exitCode ?? 'abnormally'} without reporting a type error — treating as a tooling failure, not a type error`);
|
|
63
|
+
return (0, types_js_1.warn)(`tsc failed to run (exit ${result.exitCode ?? 'killed'})`);
|
|
64
64
|
}
|
|
65
|
-
return (0,
|
|
65
|
+
return (0, types_js_1.fail)(`${errorCount} type error(s)`);
|
|
66
66
|
},
|
|
67
67
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Check } from '../../types';
|
|
1
|
+
import { Check } from '../../types.js';
|
|
2
2
|
export declare const commitlintCheck: Check;
|
|
@@ -7,10 +7,10 @@ exports.commitlintCheck = void 0;
|
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_os_1 = __importDefault(require("node:os"));
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
10
|
+
const index_js_1 = require("../../../config/index.js");
|
|
11
|
+
const execa_js_1 = require("../../../utils/execa.js");
|
|
12
|
+
const index_js_2 = require("../../../utils/index.js");
|
|
13
|
+
const types_js_1 = require("../../types.js");
|
|
14
14
|
const LOCAL_CONFIG_FILES = [
|
|
15
15
|
'commitlint.config.cjs',
|
|
16
16
|
'commitlint.config.js',
|
|
@@ -64,10 +64,10 @@ exports.commitlintCheck = {
|
|
|
64
64
|
// none, commitlint prints nothing and exits 0, and we reported `pass` — a
|
|
65
65
|
// verdict on a commit message that does not exist. Ticket 072: a check that
|
|
66
66
|
// examined nothing must not read as a check that found nothing.
|
|
67
|
-
if (!(await (0,
|
|
68
|
-
return (0,
|
|
69
|
-
const commitlintBin = (0,
|
|
70
|
-
const hasLocal = (0,
|
|
67
|
+
if (!(await (0, index_js_2.resolveGitRef)(ctx.cwd, 'HEAD')))
|
|
68
|
+
return (0, types_js_1.skip)('git unavailable');
|
|
69
|
+
const commitlintBin = (0, index_js_2.resolvePackageBin)('@commitlint/cli', 'cli.js');
|
|
70
|
+
const hasLocal = (0, index_js_1.hasLocalConfig)(LOCAL_CONFIG_FILES, ctx.cwd);
|
|
71
71
|
let tempConfigFile = null;
|
|
72
72
|
// With no diff range (a full-repo review, or `--full`) the check still has a
|
|
73
73
|
// meaningful subject: the newest commit message. `HEAD~1` cannot be assumed to
|
|
@@ -79,13 +79,13 @@ exports.commitlintCheck = {
|
|
|
79
79
|
// `--last` lints exactly the newest commit and needs no ancestor.
|
|
80
80
|
const range = ctx.baseSha
|
|
81
81
|
? ['--from', ctx.baseSha, '--to', ctx.headSha ?? 'HEAD']
|
|
82
|
-
: (await (0,
|
|
82
|
+
: (await (0, index_js_2.resolveGitRef)(ctx.cwd, 'HEAD~1'))
|
|
83
83
|
? ['--from', 'HEAD~1', '--to', ctx.headSha ?? 'HEAD']
|
|
84
84
|
: ['--last'];
|
|
85
85
|
const args = [...range, '--verbose'];
|
|
86
86
|
try {
|
|
87
87
|
if (hasLocal) {
|
|
88
|
-
|
|
88
|
+
index_js_2.logger.info('[Commitlint]: Using local config');
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
91
|
const types = ctx.config.commitlint?.types ?? DEFAULT_TYPES;
|
|
@@ -93,12 +93,12 @@ exports.commitlintCheck = {
|
|
|
93
93
|
tempConfigFile = buildTempConfig(types, ignores);
|
|
94
94
|
args.push('--config', tempConfigFile);
|
|
95
95
|
}
|
|
96
|
-
const result = await (0,
|
|
96
|
+
const result = await (0, execa_js_1.execa)(process.execPath, [commitlintBin, ...args], {
|
|
97
97
|
cwd: ctx.cwd,
|
|
98
98
|
reject: false,
|
|
99
99
|
stdio: 'inherit',
|
|
100
100
|
});
|
|
101
|
-
return result.exitCode === 0 ? (0,
|
|
101
|
+
return result.exitCode === 0 ? (0, types_js_1.pass)() : (0, types_js_1.warn)('commit message violations found');
|
|
102
102
|
}
|
|
103
103
|
finally {
|
|
104
104
|
if (tempConfigFile && node_fs_1.default.existsSync(tempConfigFile))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Check } from '../../types';
|
|
1
|
+
import { Check } from '../../types.js';
|
|
2
2
|
export declare const prBodyCheck: Check;
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.prBodyCheck = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const index_js_1 = require("../../../utils/index.js");
|
|
9
|
+
const types_js_1 = require("../../types.js");
|
|
10
10
|
// Matches "Closes #123", "Fixes #45", "Resolves #7" or JIRA-style "PROJ-456".
|
|
11
11
|
const TICKET_PATTERN = /(?:closes?|fixes?|resolves?)\s+#\d+|[A-Z][A-Z0-9]+-\d+/i;
|
|
12
12
|
exports.prBodyCheck = {
|
|
@@ -26,12 +26,12 @@ exports.prBodyCheck = {
|
|
|
26
26
|
event = JSON.parse(node_fs_1.default.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf-8'));
|
|
27
27
|
}
|
|
28
28
|
catch (err) {
|
|
29
|
-
|
|
30
|
-
return (0,
|
|
29
|
+
index_js_1.logger.warn(`[PR Body]: ⚠️ Could not read GitHub event\n${err}`);
|
|
30
|
+
return (0, types_js_1.skip)('event unreadable');
|
|
31
31
|
}
|
|
32
32
|
const pr = event.pull_request;
|
|
33
33
|
if (!pr)
|
|
34
|
-
return (0,
|
|
34
|
+
return (0, types_js_1.skip)('no PR data');
|
|
35
35
|
const trimmed = (pr.body ?? '').trim();
|
|
36
36
|
const issues = [];
|
|
37
37
|
if (trimmed.length < minLength) {
|
|
@@ -41,9 +41,9 @@ exports.prBodyCheck = {
|
|
|
41
41
|
issues.push('no ticket reference (e.g. "Closes #123" or "PROJ-456")');
|
|
42
42
|
}
|
|
43
43
|
if (issues.length > 0) {
|
|
44
|
-
issues.forEach(i =>
|
|
45
|
-
return (0,
|
|
44
|
+
issues.forEach(i => index_js_1.logger.warn(`[PR Body]: ⚠️ ${i}`));
|
|
45
|
+
return (0, types_js_1.warn)(issues.join('; '));
|
|
46
46
|
}
|
|
47
|
-
return (0,
|
|
47
|
+
return (0, types_js_1.pass)();
|
|
48
48
|
},
|
|
49
49
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Check } from '../../types';
|
|
1
|
+
import { Check } from '../../types.js';
|
|
2
2
|
export declare const prSizeCheck: Check;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prSizeCheck = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const execa_js_1 = require("../../../utils/execa.js");
|
|
5
|
+
const index_js_1 = require("../../../utils/index.js");
|
|
6
|
+
const types_js_1 = require("../../types.js");
|
|
7
7
|
const DEFAULT_MAX_FILES = 50;
|
|
8
8
|
const DEFAULT_MAX_LINES = 1000;
|
|
9
9
|
exports.prSizeCheck = {
|
|
@@ -17,7 +17,7 @@ exports.prSizeCheck = {
|
|
|
17
17
|
const maxFiles = ctx.config.prSize?.maxFiles ?? DEFAULT_MAX_FILES;
|
|
18
18
|
const maxLines = ctx.config.prSize?.maxLines ?? DEFAULT_MAX_LINES;
|
|
19
19
|
try {
|
|
20
|
-
const { stdout } = await (0,
|
|
20
|
+
const { stdout } = await (0, execa_js_1.execa)('git', ['diff', '--shortstat', ctx.baseSha, ctx.headSha ?? 'HEAD'], {
|
|
21
21
|
cwd: ctx.cwd,
|
|
22
22
|
});
|
|
23
23
|
// "5 files changed, 123 insertions(+), 45 deletions(-)"
|
|
@@ -25,21 +25,21 @@ exports.prSizeCheck = {
|
|
|
25
25
|
const insertions = parseInt(stdout.match(/(\d+) insertion/)?.[1] ?? '0', 10);
|
|
26
26
|
const deletions = parseInt(stdout.match(/(\d+) deletion/)?.[1] ?? '0', 10);
|
|
27
27
|
const lines = insertions + deletions;
|
|
28
|
-
|
|
28
|
+
index_js_1.logger.info(`[PR Size]: ${fileCount} files changed, ${lines} lines`);
|
|
29
29
|
const issues = [];
|
|
30
30
|
if (fileCount > maxFiles)
|
|
31
31
|
issues.push(`${fileCount} files (recommended < ${maxFiles})`);
|
|
32
32
|
if (lines > maxLines)
|
|
33
33
|
issues.push(`${lines} lines (recommended < ${maxLines})`);
|
|
34
34
|
if (issues.length > 0) {
|
|
35
|
-
issues.forEach(i =>
|
|
36
|
-
return (0,
|
|
35
|
+
issues.forEach(i => index_js_1.logger.warn(`[PR Size]: ⚠️ Large PR: ${i}`));
|
|
36
|
+
return (0, types_js_1.warn)(issues.join(', '));
|
|
37
37
|
}
|
|
38
|
-
return (0,
|
|
38
|
+
return (0, types_js_1.pass)();
|
|
39
39
|
}
|
|
40
40
|
catch (err) {
|
|
41
|
-
|
|
42
|
-
return (0,
|
|
41
|
+
index_js_1.logger.warn(`[PR Size]: ⚠️ Could not measure PR size\n${err}`);
|
|
42
|
+
return (0, types_js_1.skip)('diff unavailable');
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Check } from '../../types';
|
|
1
|
+
import { Check } from '../../types.js';
|
|
2
2
|
export declare const prTitleLintCheck: Check;
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.prTitleLintCheck = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const index_js_1 = require("../../../utils/index.js");
|
|
9
|
+
const types_js_1 = require("../../types.js");
|
|
10
10
|
const CONVENTIONAL_PREFIX = /^(feat|fix|docs|style|refactor|test|chore|perf|ci|build|revert)(\(.+\))?!?: .+/;
|
|
11
11
|
exports.prTitleLintCheck = {
|
|
12
12
|
name: 'PR Title',
|
|
@@ -21,17 +21,17 @@ exports.prTitleLintCheck = {
|
|
|
21
21
|
event = JSON.parse(node_fs_1.default.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf-8'));
|
|
22
22
|
}
|
|
23
23
|
catch (err) {
|
|
24
|
-
|
|
25
|
-
return (0,
|
|
24
|
+
index_js_1.logger.warn(`[PR Title]: ⚠️ Could not read GitHub event\n${err}`);
|
|
25
|
+
return (0, types_js_1.skip)('event unreadable');
|
|
26
26
|
}
|
|
27
27
|
const pr = event.pull_request;
|
|
28
28
|
if (!pr?.title)
|
|
29
|
-
return (0,
|
|
29
|
+
return (0, types_js_1.skip)('no PR title');
|
|
30
30
|
const title = pr.title;
|
|
31
31
|
if (!CONVENTIONAL_PREFIX.test(title)) {
|
|
32
|
-
|
|
33
|
-
return (0,
|
|
32
|
+
index_js_1.logger.warn(`[PR Title]: ⚠️ Not Conventional Commits: "${title}"`);
|
|
33
|
+
return (0, types_js_1.warn)('title does not follow Conventional Commits');
|
|
34
34
|
}
|
|
35
|
-
return (0,
|
|
35
|
+
return (0, types_js_1.pass)();
|
|
36
36
|
},
|
|
37
37
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.caseCollisionCheck = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const index_js_1 = require("../../../utils/index.js");
|
|
5
|
+
const targets_js_1 = require("../../targets.js");
|
|
6
|
+
const types_js_1 = require("../../types.js");
|
|
7
7
|
/**
|
|
8
8
|
* Flags tracked files whose paths differ only by case (e.g. `Foo.ts` vs
|
|
9
9
|
* `foo.ts`). Such pairs coexist on Linux (case-sensitive) but collide on macOS/
|
|
@@ -17,7 +17,7 @@ exports.caseCollisionCheck = {
|
|
|
17
17
|
return ctx.config.caseCollision?.enabled !== false;
|
|
18
18
|
},
|
|
19
19
|
async run(ctx) {
|
|
20
|
-
const files = await (0,
|
|
20
|
+
const files = await (0, targets_js_1.resolveTargets)(ctx, ['*'], {
|
|
21
21
|
wholeTree: true,
|
|
22
22
|
onEmpty: { skip: 'no tracked files' },
|
|
23
23
|
});
|
|
@@ -35,8 +35,8 @@ exports.caseCollisionCheck = {
|
|
|
35
35
|
}
|
|
36
36
|
const collisions = [...byLower.values()].filter(set => set.size > 1);
|
|
37
37
|
if (collisions.length === 0)
|
|
38
|
-
return (0,
|
|
39
|
-
collisions.forEach(set =>
|
|
40
|
-
return (0,
|
|
38
|
+
return (0, types_js_1.pass)();
|
|
39
|
+
collisions.forEach(set => index_js_1.logger.warn(`[Case Collision]: ⚠️ ${[...set].join(' ↔ ')}`));
|
|
40
|
+
return (0, types_js_1.warn)(`${collisions.length} case-collision(s) — paths differing only by case`);
|
|
41
41
|
},
|
|
42
42
|
};
|