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.
Files changed (380) hide show
  1. package/dist/{cli.js → cjs/cli.js} +30 -30
  2. package/dist/{config → cjs/config}/index.d.ts +2 -2
  3. package/dist/{config → cjs/config}/index.js +8 -7
  4. package/dist/{config → cjs/config}/loader.d.ts +1 -1
  5. package/dist/{config → cjs/config}/loader.js +8 -8
  6. package/dist/{core → cjs/core}/checks/dependencies/banned-imports.d.ts +1 -1
  7. package/dist/{core → cjs/core}/checks/dependencies/banned-imports.js +10 -10
  8. package/dist/{core → cjs/core}/checks/dependencies/circular-deps.d.ts +1 -1
  9. package/dist/{core → cjs/core}/checks/dependencies/circular-deps.js +27 -27
  10. package/dist/{core → cjs/core}/checks/dependencies/dependency-check.d.ts +1 -1
  11. package/dist/{core → cjs/core}/checks/dependencies/dependency-check.js +17 -17
  12. package/dist/{core → cjs/core}/checks/dependencies/grype-scan.d.ts +1 -1
  13. package/dist/{core → cjs/core}/checks/dependencies/grype-scan.js +18 -18
  14. package/dist/{core → cjs/core}/checks/dependencies/license-check.d.ts +1 -1
  15. package/dist/{core → cjs/core}/checks/dependencies/license-check.js +12 -12
  16. package/dist/{core → cjs/core}/checks/dependencies/npm-audit.d.ts +1 -1
  17. package/dist/{core → cjs/core}/checks/dependencies/npm-audit.js +14 -14
  18. package/dist/{core → cjs/core}/checks/dependencies/outdated-deps.d.ts +1 -1
  19. package/dist/{core → cjs/core}/checks/dependencies/outdated-deps.js +14 -14
  20. package/dist/{core → cjs/core}/checks/dependencies/vuln-scan.d.ts +1 -1
  21. package/dist/{core → cjs/core}/checks/dependencies/vuln-scan.js +14 -14
  22. package/dist/{core → cjs/core}/checks/findings.d.ts +1 -1
  23. package/dist/{core → cjs/core}/checks/findings.js +16 -16
  24. package/dist/{core → cjs/core}/checks/git/custom-rules.d.ts +1 -1
  25. package/dist/{core → cjs/core}/checks/git/custom-rules.js +19 -19
  26. package/dist/{core → cjs/core}/checks/git/diff-smell.d.ts +2 -2
  27. package/dist/{core → cjs/core}/checks/git/diff-smell.js +13 -13
  28. package/dist/{core → cjs/core}/checks/git/large-files.d.ts +1 -1
  29. package/dist/{core → cjs/core}/checks/git/large-files.js +15 -15
  30. package/dist/{core → cjs/core}/checks/git/leftover-debug.d.ts +1 -1
  31. package/dist/{core → cjs/core}/checks/git/leftover-debug.js +13 -13
  32. package/dist/{core → cjs/core}/checks/git/lockfile-drift.d.ts +1 -1
  33. package/dist/{core → cjs/core}/checks/git/lockfile-drift.js +12 -12
  34. package/dist/{core → cjs/core}/checks/git/merge-conflict.d.ts +1 -1
  35. package/dist/{core → cjs/core}/checks/git/merge-conflict.js +15 -15
  36. package/dist/{core → cjs/core}/checks/git/missing-tests.d.ts +1 -1
  37. package/dist/{core → cjs/core}/checks/git/missing-tests.js +15 -15
  38. package/dist/{core → cjs/core}/checks/git/todo-fixme.d.ts +1 -1
  39. package/dist/{core → cjs/core}/checks/git/todo-fixme.js +11 -11
  40. package/dist/{core → cjs/core}/checks/languages/cpp-format.d.ts +1 -1
  41. package/dist/{core → cjs/core}/checks/languages/cpp-format.js +18 -18
  42. package/dist/{core → cjs/core}/checks/languages/external-checks.d.ts +9 -9
  43. package/dist/{core → cjs/core}/checks/languages/external-checks.js +10 -10
  44. package/dist/{core → cjs/core}/checks/languages/external-runner.d.ts +2 -2
  45. package/dist/{core → cjs/core}/checks/languages/external-runner.js +21 -21
  46. package/dist/{core → cjs/core}/checks/languages/go-format.d.ts +1 -1
  47. package/dist/cjs/core/checks/languages/go-format.js +202 -0
  48. package/dist/cjs/core/checks/languages/lint.d.ts +2 -0
  49. package/dist/{core → cjs/core}/checks/languages/lint.js +21 -21
  50. package/dist/{core → cjs/core}/checks/languages/prettier.d.ts +1 -1
  51. package/dist/{core → cjs/core}/checks/languages/prettier.js +18 -18
  52. package/dist/{core → cjs/core}/checks/languages/python-format.d.ts +1 -1
  53. package/dist/{core → cjs/core}/checks/languages/python-format.js +14 -14
  54. package/dist/{core → cjs/core}/checks/languages/python-lint.d.ts +1 -1
  55. package/dist/{core → cjs/core}/checks/languages/python-lint.js +13 -13
  56. package/dist/{core → cjs/core}/checks/languages/python-typecheck.d.ts +1 -1
  57. package/dist/{core → cjs/core}/checks/languages/python-typecheck.js +29 -29
  58. package/dist/{core → cjs/core}/checks/languages/typecheck.d.ts +1 -1
  59. package/dist/{core → cjs/core}/checks/languages/typecheck.js +13 -13
  60. package/dist/{core → cjs/core}/checks/pr/commitlint.d.ts +1 -1
  61. package/dist/{core → cjs/core}/checks/pr/commitlint.js +12 -12
  62. package/dist/{core → cjs/core}/checks/pr/pr-body.d.ts +1 -1
  63. package/dist/{core → cjs/core}/checks/pr/pr-body.js +8 -8
  64. package/dist/{core → cjs/core}/checks/pr/pr-size-check.d.ts +1 -1
  65. package/dist/{core → cjs/core}/checks/pr/pr-size-check.js +10 -10
  66. package/dist/{core → cjs/core}/checks/pr/pr-title-lint.d.ts +1 -1
  67. package/dist/{core → cjs/core}/checks/pr/pr-title-lint.js +8 -8
  68. package/dist/{core → cjs/core}/checks/quality/case-collision.d.ts +1 -1
  69. package/dist/{core → cjs/core}/checks/quality/case-collision.js +7 -7
  70. package/dist/{core → cjs/core}/checks/quality/config-validation.d.ts +1 -1
  71. package/dist/{core → cjs/core}/checks/quality/config-validation.js +9 -9
  72. package/dist/{core → cjs/core}/checks/quality/coverage.d.ts +1 -1
  73. package/dist/{core → cjs/core}/checks/quality/coverage.js +4 -4
  74. package/dist/{core → cjs/core}/checks/quality/dead-code.d.ts +1 -1
  75. package/dist/{core → cjs/core}/checks/quality/dead-code.js +23 -23
  76. package/dist/{core → cjs/core}/checks/quality/duplicate-check.d.ts +1 -1
  77. package/dist/{core → cjs/core}/checks/quality/duplicate-check.js +22 -22
  78. package/dist/{core → cjs/core}/checks/quality/license-header.d.ts +1 -1
  79. package/dist/{core → cjs/core}/checks/quality/license-header.js +16 -16
  80. package/dist/{core → cjs/core}/checks/quality/markdown-lint.d.ts +1 -1
  81. package/dist/{core → cjs/core}/checks/quality/markdown-lint.js +17 -17
  82. package/dist/{core → cjs/core}/checks/quality/package-size.d.ts +1 -1
  83. package/dist/{core → cjs/core}/checks/quality/package-size.js +12 -12
  84. package/dist/{core → cjs/core}/checks/quality/spellcheck.d.ts +2 -2
  85. package/dist/{core → cjs/core}/checks/quality/spellcheck.js +18 -18
  86. package/dist/{core → cjs/core}/checks/quality/symlinks.d.ts +1 -1
  87. package/dist/{core → cjs/core}/checks/quality/symlinks.js +8 -8
  88. package/dist/{core → cjs/core}/checks/quality/yaml-lint.d.ts +1 -1
  89. package/dist/{core → cjs/core}/checks/quality/yaml-lint.js +12 -12
  90. package/dist/{core → cjs/core}/checks/security/diff-security.d.ts +1 -1
  91. package/dist/{core → cjs/core}/checks/security/diff-security.js +15 -15
  92. package/dist/{core → cjs/core}/checks/security/dockerfile-security.d.ts +1 -1
  93. package/dist/{core → cjs/core}/checks/security/dockerfile-security.js +16 -16
  94. package/dist/{core → cjs/core}/checks/security/migration-safety.d.ts +1 -1
  95. package/dist/{core → cjs/core}/checks/security/migration-safety.js +17 -17
  96. package/dist/{core → cjs/core}/checks/security/security.d.ts +1 -1
  97. package/dist/{core → cjs/core}/checks/security/security.js +21 -21
  98. package/dist/{core → cjs/core}/checks/security/sensitive-file-guard.d.ts +1 -1
  99. package/dist/{core → cjs/core}/checks/security/sensitive-file-guard.js +14 -14
  100. package/dist/{core → cjs/core}/checks/security/workflow-security.d.ts +2 -2
  101. package/dist/{core → cjs/core}/checks/security/workflow-security.js +14 -14
  102. package/dist/{core → cjs/core}/checks/tool-install.d.ts +1 -1
  103. package/dist/{core → cjs/core}/checks/tool-install.js +2 -2
  104. package/dist/{core → cjs/core}/context.d.ts +1 -1
  105. package/dist/{core → cjs/core}/context.js +16 -16
  106. package/dist/cjs/core/index.d.ts +4 -0
  107. package/dist/{core → cjs/core}/index.js +7 -7
  108. package/dist/{core → cjs/core}/install/cache.js +2 -2
  109. package/dist/{core → cjs/core}/install/doctor.d.ts +4 -4
  110. package/dist/{core → cjs/core}/install/doctor.js +34 -34
  111. package/dist/{core → cjs/core}/install/ensure.d.ts +2 -2
  112. package/dist/{core → cjs/core}/install/ensure.js +15 -14
  113. package/dist/{core → cjs/core}/install/lock.js +4 -4
  114. package/dist/{core → cjs/core}/install/prepare.d.ts +4 -4
  115. package/dist/{core → cjs/core}/install/prepare.js +13 -13
  116. package/dist/{core → cjs/core}/install/profiles.d.ts +2 -2
  117. package/dist/{core → cjs/core}/install/reuse.d.ts +1 -1
  118. package/dist/{core → cjs/core}/install/reuse.js +4 -4
  119. package/dist/{core → cjs/core}/registry.d.ts +1 -1
  120. package/dist/cjs/core/registry.js +112 -0
  121. package/dist/{core → cjs/core}/reporters.d.ts +1 -1
  122. package/dist/{core → cjs/core}/reporters.js +28 -28
  123. package/dist/{core → cjs/core}/run-checks.d.ts +2 -2
  124. package/dist/{core → cjs/core}/run-checks.js +31 -31
  125. package/dist/{core → cjs/core}/targets.d.ts +1 -1
  126. package/dist/{core → cjs/core}/targets.js +20 -20
  127. package/dist/{core → cjs/core}/types.d.ts +3 -3
  128. package/dist/cjs/index.d.ts +12 -0
  129. package/dist/{index.js → cjs/index.js} +18 -18
  130. package/dist/{init.js → cjs/init.js} +68 -56
  131. package/dist/{interfaces → cjs/interfaces}/index.d.ts +3 -3
  132. package/dist/cjs/package.json +1 -0
  133. package/dist/{scripts → cjs/scripts}/copy-configs.js +22 -7
  134. package/dist/{scripts → cjs/scripts}/generate-install-manifests.js +2 -2
  135. package/dist/{scripts → cjs/scripts}/publish-github.js +4 -4
  136. package/dist/{utils → cjs/utils}/detect-language.js +12 -12
  137. package/dist/cjs/utils/execa.js +46 -0
  138. package/dist/{utils → cjs/utils}/git.js +2 -2
  139. package/dist/{utils → cjs/utils}/http.js +2 -2
  140. package/dist/cjs/utils/index.d.ts +15 -0
  141. package/dist/{utils → cjs/utils}/index.js +13 -13
  142. package/dist/{utils → cjs/utils}/own-deps.d.ts +2 -0
  143. package/dist/{utils → cjs/utils}/own-deps.js +1 -0
  144. package/dist/{utils → cjs/utils}/package-version.js +2 -1
  145. package/dist/{utils → cjs/utils}/resolve-bin.js +2 -1
  146. package/dist/{utils → cjs/utils}/update-notifier.js +4 -4
  147. package/dist/esm/cli.d.ts +2 -0
  148. package/dist/esm/cli.js +137 -0
  149. package/dist/esm/config/constants.d.ts +153 -0
  150. package/dist/esm/config/constants.js +360 -0
  151. package/dist/esm/config/index.d.ts +40 -0
  152. package/dist/esm/config/index.js +60 -0
  153. package/dist/esm/config/loader.d.ts +6 -0
  154. package/dist/esm/config/loader.js +191 -0
  155. package/dist/esm/config/pr-checkmate-workflow-docker.yml +79 -0
  156. package/dist/esm/config/pr-checkmate-workflow.yml +92 -0
  157. package/dist/esm/core/checks/dependencies/banned-imports.d.ts +2 -0
  158. package/dist/esm/core/checks/dependencies/banned-imports.js +70 -0
  159. package/dist/esm/core/checks/dependencies/circular-deps.d.ts +2 -0
  160. package/dist/esm/core/checks/dependencies/circular-deps.js +155 -0
  161. package/dist/esm/core/checks/dependencies/dependency-check.d.ts +43 -0
  162. package/dist/esm/core/checks/dependencies/dependency-check.js +174 -0
  163. package/dist/esm/core/checks/dependencies/grype-scan.d.ts +22 -0
  164. package/dist/esm/core/checks/dependencies/grype-scan.js +112 -0
  165. package/dist/esm/core/checks/dependencies/license-check.d.ts +2 -0
  166. package/dist/esm/core/checks/dependencies/license-check.js +61 -0
  167. package/dist/esm/core/checks/dependencies/npm-audit.d.ts +6 -0
  168. package/dist/esm/core/checks/dependencies/npm-audit.js +80 -0
  169. package/dist/esm/core/checks/dependencies/outdated-deps.d.ts +2 -0
  170. package/dist/esm/core/checks/dependencies/outdated-deps.js +66 -0
  171. package/dist/esm/core/checks/dependencies/vuln-scan.d.ts +2 -0
  172. package/dist/esm/core/checks/dependencies/vuln-scan.js +54 -0
  173. package/dist/esm/core/checks/findings.d.ts +299 -0
  174. package/dist/esm/core/checks/findings.js +701 -0
  175. package/dist/esm/core/checks/git/custom-rules.d.ts +2 -0
  176. package/dist/esm/core/checks/git/custom-rules.js +106 -0
  177. package/dist/esm/core/checks/git/diff-smell.d.ts +19 -0
  178. package/dist/esm/core/checks/git/diff-smell.js +69 -0
  179. package/dist/esm/core/checks/git/large-files.d.ts +2 -0
  180. package/dist/esm/core/checks/git/large-files.js +112 -0
  181. package/dist/esm/core/checks/git/leftover-debug.d.ts +2 -0
  182. package/dist/esm/core/checks/git/leftover-debug.js +89 -0
  183. package/dist/esm/core/checks/git/lockfile-drift.d.ts +2 -0
  184. package/dist/esm/core/checks/git/lockfile-drift.js +114 -0
  185. package/dist/esm/core/checks/git/merge-conflict.d.ts +2 -0
  186. package/dist/esm/core/checks/git/merge-conflict.js +117 -0
  187. package/dist/esm/core/checks/git/missing-tests.d.ts +2 -0
  188. package/dist/esm/core/checks/git/missing-tests.js +105 -0
  189. package/dist/esm/core/checks/git/todo-fixme.d.ts +7 -0
  190. package/dist/esm/core/checks/git/todo-fixme.js +80 -0
  191. package/dist/esm/core/checks/languages/cpp-format.d.ts +7 -0
  192. package/dist/esm/core/checks/languages/cpp-format.js +91 -0
  193. package/dist/esm/core/checks/languages/external-checks.d.ts +77 -0
  194. package/dist/esm/core/checks/languages/external-checks.js +197 -0
  195. package/dist/esm/core/checks/languages/external-runner.d.ts +119 -0
  196. package/dist/esm/core/checks/languages/external-runner.js +138 -0
  197. package/dist/esm/core/checks/languages/go-format.d.ts +8 -0
  198. package/dist/{core → esm/core}/checks/languages/go-format.js +29 -35
  199. package/dist/esm/core/checks/languages/lint.d.ts +2 -0
  200. package/dist/esm/core/checks/languages/lint.js +92 -0
  201. package/dist/esm/core/checks/languages/prettier.d.ts +2 -0
  202. package/dist/esm/core/checks/languages/prettier.js +85 -0
  203. package/dist/esm/core/checks/languages/python-format.d.ts +7 -0
  204. package/dist/esm/core/checks/languages/python-format.js +61 -0
  205. package/dist/esm/core/checks/languages/python-lint.d.ts +9 -0
  206. package/dist/esm/core/checks/languages/python-lint.js +55 -0
  207. package/dist/esm/core/checks/languages/python-typecheck.d.ts +14 -0
  208. package/dist/esm/core/checks/languages/python-typecheck.js +184 -0
  209. package/dist/esm/core/checks/languages/ruff-shared.d.ts +10 -0
  210. package/dist/esm/core/checks/languages/ruff-shared.js +35 -0
  211. package/dist/esm/core/checks/languages/typecheck.d.ts +2 -0
  212. package/dist/esm/core/checks/languages/typecheck.js +61 -0
  213. package/dist/esm/core/checks/pr/commitlint.d.ts +2 -0
  214. package/dist/esm/core/checks/pr/commitlint.js +102 -0
  215. package/dist/esm/core/checks/pr/pr-body.d.ts +2 -0
  216. package/dist/esm/core/checks/pr/pr-body.js +43 -0
  217. package/dist/esm/core/checks/pr/pr-size-check.d.ts +2 -0
  218. package/dist/esm/core/checks/pr/pr-size-check.js +42 -0
  219. package/dist/esm/core/checks/pr/pr-title-lint.d.ts +2 -0
  220. package/dist/esm/core/checks/pr/pr-title-lint.js +31 -0
  221. package/dist/esm/core/checks/quality/case-collision.d.ts +8 -0
  222. package/dist/esm/core/checks/quality/case-collision.js +39 -0
  223. package/dist/esm/core/checks/quality/config-validation.d.ts +11 -0
  224. package/dist/esm/core/checks/quality/config-validation.js +188 -0
  225. package/dist/esm/core/checks/quality/coverage.d.ts +2 -0
  226. package/dist/esm/core/checks/quality/coverage.js +62 -0
  227. package/dist/esm/core/checks/quality/dead-code.d.ts +2 -0
  228. package/dist/esm/core/checks/quality/dead-code.js +124 -0
  229. package/dist/esm/core/checks/quality/duplicate-check.d.ts +2 -0
  230. package/dist/esm/core/checks/quality/duplicate-check.js +141 -0
  231. package/dist/esm/core/checks/quality/license-header.d.ts +7 -0
  232. package/dist/esm/core/checks/quality/license-header.js +81 -0
  233. package/dist/esm/core/checks/quality/markdown-lint.d.ts +2 -0
  234. package/dist/esm/core/checks/quality/markdown-lint.js +104 -0
  235. package/dist/esm/core/checks/quality/package-size.d.ts +36 -0
  236. package/dist/esm/core/checks/quality/package-size.js +196 -0
  237. package/dist/esm/core/checks/quality/spellcheck.d.ts +77 -0
  238. package/dist/esm/core/checks/quality/spellcheck.js +296 -0
  239. package/dist/esm/core/checks/quality/symlinks.d.ts +16 -0
  240. package/dist/esm/core/checks/quality/symlinks.js +57 -0
  241. package/dist/esm/core/checks/quality/yaml-lint.d.ts +20 -0
  242. package/dist/esm/core/checks/quality/yaml-lint.js +116 -0
  243. package/dist/esm/core/checks/security/diff-security.d.ts +2 -0
  244. package/dist/esm/core/checks/security/diff-security.js +354 -0
  245. package/dist/esm/core/checks/security/dockerfile-security.d.ts +2 -0
  246. package/dist/esm/core/checks/security/dockerfile-security.js +98 -0
  247. package/dist/esm/core/checks/security/migration-safety.d.ts +2 -0
  248. package/dist/esm/core/checks/security/migration-safety.js +137 -0
  249. package/dist/esm/core/checks/security/security.d.ts +63 -0
  250. package/dist/esm/core/checks/security/security.js +201 -0
  251. package/dist/esm/core/checks/security/sensitive-file-guard.d.ts +2 -0
  252. package/dist/esm/core/checks/security/sensitive-file-guard.js +160 -0
  253. package/dist/esm/core/checks/security/workflow-security.d.ts +12 -0
  254. package/dist/esm/core/checks/security/workflow-security.js +100 -0
  255. package/dist/esm/core/checks/tool-install.d.ts +102 -0
  256. package/dist/esm/core/checks/tool-install.js +66 -0
  257. package/dist/esm/core/commands.d.ts +27 -0
  258. package/dist/esm/core/commands.js +89 -0
  259. package/dist/esm/core/context.d.ts +62 -0
  260. package/dist/esm/core/context.js +241 -0
  261. package/dist/esm/core/index.d.ts +4 -0
  262. package/dist/esm/core/index.js +4 -0
  263. package/dist/esm/core/install/cache.d.ts +58 -0
  264. package/dist/esm/core/install/cache.js +142 -0
  265. package/dist/esm/core/install/doctor.d.ts +35 -0
  266. package/dist/esm/core/install/doctor.js +164 -0
  267. package/dist/esm/core/install/ensure.d.ts +77 -0
  268. package/dist/esm/core/install/ensure.js +269 -0
  269. package/dist/esm/core/install/lock.d.ts +34 -0
  270. package/dist/esm/core/install/lock.js +92 -0
  271. package/dist/esm/core/install/merge.d.ts +47 -0
  272. package/dist/esm/core/install/merge.js +85 -0
  273. package/dist/esm/core/install/prepare.d.ts +76 -0
  274. package/dist/esm/core/install/prepare.js +142 -0
  275. package/dist/esm/core/install/profiles.d.ts +78 -0
  276. package/dist/esm/core/install/profiles.js +192 -0
  277. package/dist/esm/core/install/reuse.d.ts +41 -0
  278. package/dist/esm/core/install/reuse.js +100 -0
  279. package/dist/esm/core/registry.d.ts +6 -0
  280. package/dist/esm/core/registry.js +109 -0
  281. package/dist/esm/core/reporters.d.ts +18 -0
  282. package/dist/esm/core/reporters.js +266 -0
  283. package/dist/esm/core/run-checks.d.ts +33 -0
  284. package/dist/esm/core/run-checks.js +293 -0
  285. package/dist/esm/core/targets.d.ts +140 -0
  286. package/dist/esm/core/targets.js +213 -0
  287. package/dist/esm/core/types.d.ts +195 -0
  288. package/dist/esm/core/types.js +38 -0
  289. package/dist/esm/index.d.ts +12 -0
  290. package/dist/esm/index.js +15 -0
  291. package/dist/esm/init.d.ts +38 -0
  292. package/dist/esm/init.js +421 -0
  293. package/dist/esm/interfaces/index.d.ts +432 -0
  294. package/dist/esm/interfaces/index.js +2 -0
  295. package/dist/esm/package.json +1 -0
  296. package/dist/esm/scripts/copy-configs.d.ts +1 -0
  297. package/dist/esm/scripts/copy-configs.js +64 -0
  298. package/dist/esm/scripts/generate-install-manifests.d.ts +39 -0
  299. package/dist/esm/scripts/generate-install-manifests.js +115 -0
  300. package/dist/esm/scripts/publish-github.d.ts +1 -0
  301. package/dist/esm/scripts/publish-github.js +45 -0
  302. package/dist/esm/utils/ci.d.ts +11 -0
  303. package/dist/esm/utils/ci.js +40 -0
  304. package/dist/esm/utils/detect-language.d.ts +48 -0
  305. package/dist/esm/utils/detect-language.js +234 -0
  306. package/dist/esm/utils/direct-deps.d.ts +21 -0
  307. package/dist/esm/utils/direct-deps.js +220 -0
  308. package/dist/esm/utils/execa.d.ts +22 -0
  309. package/dist/{utils → esm/utils}/execa.js +1 -4
  310. package/dist/esm/utils/git.d.ts +14 -0
  311. package/dist/esm/utils/git.js +21 -0
  312. package/dist/esm/utils/glob.d.ts +24 -0
  313. package/dist/esm/utils/glob.js +40 -0
  314. package/dist/esm/utils/http.d.ts +59 -0
  315. package/dist/esm/utils/http.js +115 -0
  316. package/dist/esm/utils/index.d.ts +15 -0
  317. package/dist/esm/utils/index.js +26 -0
  318. package/dist/esm/utils/logger.d.ts +65 -0
  319. package/dist/esm/utils/logger.js +157 -0
  320. package/dist/esm/utils/own-deps.d.ts +16 -0
  321. package/dist/esm/utils/own-deps.js +107 -0
  322. package/dist/esm/utils/package-version.d.ts +4 -0
  323. package/dist/esm/utils/package-version.js +38 -0
  324. package/dist/esm/utils/pool.d.ts +49 -0
  325. package/dist/esm/utils/pool.js +113 -0
  326. package/dist/esm/utils/resolve-bin.d.ts +67 -0
  327. package/dist/esm/utils/resolve-bin.js +156 -0
  328. package/dist/esm/utils/result-collector.d.ts +33 -0
  329. package/dist/esm/utils/result-collector.js +44 -0
  330. package/dist/esm/utils/update-notifier.d.ts +19 -0
  331. package/dist/esm/utils/update-notifier.js +108 -0
  332. package/install-manifests/core/package-lock.json +4 -4
  333. package/install-manifests/core/package.json +1 -1
  334. package/install-manifests/cpp/package-lock.json +4 -4
  335. package/install-manifests/cpp/package.json +1 -1
  336. package/package.json +16 -14
  337. package/dist/core/checks/languages/lint.d.ts +0 -2
  338. package/dist/core/index.d.ts +0 -4
  339. package/dist/core/registry.js +0 -112
  340. package/dist/index.d.ts +0 -12
  341. package/dist/utils/index.d.ts +0 -15
  342. /package/dist/{cli.d.ts → cjs/cli.d.ts} +0 -0
  343. /package/dist/{config → cjs/config}/constants.d.ts +0 -0
  344. /package/dist/{config → cjs/config}/constants.js +0 -0
  345. /package/dist/{config → cjs/config}/pr-checkmate-workflow-docker.yml +0 -0
  346. /package/dist/{config → cjs/config}/pr-checkmate-workflow.yml +0 -0
  347. /package/dist/{core → cjs/core}/checks/languages/ruff-shared.d.ts +0 -0
  348. /package/dist/{core → cjs/core}/checks/languages/ruff-shared.js +0 -0
  349. /package/dist/{core → cjs/core}/commands.d.ts +0 -0
  350. /package/dist/{core → cjs/core}/commands.js +0 -0
  351. /package/dist/{core → cjs/core}/install/cache.d.ts +0 -0
  352. /package/dist/{core → cjs/core}/install/lock.d.ts +0 -0
  353. /package/dist/{core → cjs/core}/install/merge.d.ts +0 -0
  354. /package/dist/{core → cjs/core}/install/merge.js +0 -0
  355. /package/dist/{core → cjs/core}/install/profiles.js +0 -0
  356. /package/dist/{core → cjs/core}/types.js +0 -0
  357. /package/dist/{init.d.ts → cjs/init.d.ts} +0 -0
  358. /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
  359. /package/dist/{scripts → cjs/scripts}/copy-configs.d.ts +0 -0
  360. /package/dist/{scripts → cjs/scripts}/generate-install-manifests.d.ts +0 -0
  361. /package/dist/{scripts → cjs/scripts}/publish-github.d.ts +0 -0
  362. /package/dist/{utils → cjs/utils}/ci.d.ts +0 -0
  363. /package/dist/{utils → cjs/utils}/ci.js +0 -0
  364. /package/dist/{utils → cjs/utils}/detect-language.d.ts +0 -0
  365. /package/dist/{utils → cjs/utils}/direct-deps.d.ts +0 -0
  366. /package/dist/{utils → cjs/utils}/direct-deps.js +0 -0
  367. /package/dist/{utils → cjs/utils}/execa.d.ts +0 -0
  368. /package/dist/{utils → cjs/utils}/git.d.ts +0 -0
  369. /package/dist/{utils → cjs/utils}/glob.d.ts +0 -0
  370. /package/dist/{utils → cjs/utils}/glob.js +0 -0
  371. /package/dist/{utils → cjs/utils}/http.d.ts +0 -0
  372. /package/dist/{utils → cjs/utils}/logger.d.ts +0 -0
  373. /package/dist/{utils → cjs/utils}/logger.js +0 -0
  374. /package/dist/{utils → cjs/utils}/package-version.d.ts +0 -0
  375. /package/dist/{utils → cjs/utils}/pool.d.ts +0 -0
  376. /package/dist/{utils → cjs/utils}/pool.js +0 -0
  377. /package/dist/{utils → cjs/utils}/resolve-bin.d.ts +0 -0
  378. /package/dist/{utils → cjs/utils}/result-collector.d.ts +0 -0
  379. /package/dist/{utils → cjs/utils}/result-collector.js +0 -0
  380. /package/dist/{utils → cjs/utils}/update-notifier.d.ts +0 -0
@@ -0,0 +1,299 @@
1
+ import { CheckContext, CheckOutcome } from '../types.js';
2
+ /**
3
+ * Client-configurable severity for a check's findings, read from that check's
4
+ * config block (e.g. `mergeConflict.severity`). `error` fails the run, `warn`
5
+ * only advises. Every check declares a natural default; the client overrides it
6
+ * per repo in pr-checkmate.json — promoting an advisory check to a gate, or
7
+ * downgrading a blocking one, with no code change.
8
+ *
9
+ * Deliberately not exported, here and for {@link SeverityEmitter}: no module
10
+ * names either type, and `tsc` inlines both into `findings.d.ts` anyway, so an
11
+ * `export` would only be API surface the Dead Code check then reports as unused.
12
+ */
13
+ type Severity = 'error' | 'warn';
14
+ interface SeverityEmitter {
15
+ /** Log at the resolved level (`logger.error` for error, `logger.warn` for warn). */
16
+ log: (msg: string) => void;
17
+ /** Prefix icon matching the level. */
18
+ icon: string;
19
+ /** Build the outcome at the resolved level (`fail` for error, `warn` for warn). */
20
+ emit: (details: string) => CheckOutcome;
21
+ }
22
+ /**
23
+ * Resolve a check's effective severity (`configured` from config, else its
24
+ * `fallback`) into a matched logger, icon, and outcome constructor — so a check
25
+ * logs and returns consistently at whatever level the client chose.
26
+ */
27
+ export declare function severityEmitter(configured: Severity | undefined, fallback: Severity): SeverityEmitter;
28
+ /** Findings grouped by label → matching sample strings. */
29
+ export type FindingBucket = Record<string, string[]>;
30
+ /** One scan's findings, split by the level each pattern assigned them. */
31
+ export interface SeverityBuckets {
32
+ errors: FindingBucket;
33
+ warnings: FindingBucket;
34
+ }
35
+ /**
36
+ * Fold one scan's findings into a check's running totals.
37
+ *
38
+ * Checks accumulate across several scans — one per language, or one per file on
39
+ * the full-scan path — so every accumulating check needs this, and each had the
40
+ * same pair of nested loops written out inline.
41
+ */
42
+ export declare function mergeSeverityBuckets(into: SeverityBuckets, from: SeverityBuckets): void;
43
+ /** A fresh pair of empty buckets for a check to accumulate into. */
44
+ export declare function emptyBuckets(): SeverityBuckets;
45
+ /**
46
+ * Run `git diff` over the given file globs, returning the raw unified diff
47
+ * (zero context, added/copied/modified/renamed files) for added-line scanning.
48
+ */
49
+ export declare function diffAddedLines(ctx: CheckContext, globs: string[]): Promise<string>;
50
+ /**
51
+ * Present tracked files as if every line had just been added, so a check written
52
+ * for a diff can review the whole repository unchanged.
53
+ *
54
+ * The patterns are anchored on the diff's `+` marker (`/^\+(?!\+)…/`), which is
55
+ * why `--full` used to skip most of the security surface: no diff, no lines
56
+ * starting with `+`, no findings. Rather than rewrite forty patterns — and lose
57
+ * the guarantee that both modes agree — the file contents are wrapped in the
58
+ * shape the pipeline already understands. Comment stripping, string blanking,
59
+ * `view: 'code'`, grouping and every client knob then work identically.
60
+ *
61
+ * Files are read one at a time and handed to `onFile` rather than concatenated:
62
+ * a monorepo would otherwise be assembled into a single multi-megabyte string
63
+ * before the first pattern ran.
64
+ */
65
+ export declare function scanTrackedFiles(ctx: CheckContext, files: string[], onFile: (asDiff: string) => void): Promise<void>;
66
+ /**
67
+ * Hand a check the lines it should review, from the diff when there is one and
68
+ * from the tracked files otherwise.
69
+ *
70
+ * The single entry point every content check uses, so the choice between the two
71
+ * modes is made once rather than re-implemented per check — and so a check cannot
72
+ * accidentally support only one of them, which is how `--full` ended up with no
73
+ * security coverage at all (ticket 067).
74
+ *
75
+ * `onChunk` is called once per diff in delta mode and once per file in full mode,
76
+ * which keeps a whole monorepo from being concatenated before matching starts.
77
+ *
78
+ * Returns whether the review actually happened. `false` means git could not
79
+ * produce a file list, and the caller has to say so rather than report a pass:
80
+ * a check that reviewed nothing looks exactly like a check that found nothing,
81
+ * and that is the whole of ticket 072. `fullScanBehaviour: "skip"` is the one
82
+ * case where `true` is returned having reviewed nothing on purpose — the client
83
+ * asked for that, so it is not a hole in coverage.
84
+ */
85
+ export declare function reviewLines(ctx: CheckContext, globs: string[], onChunk: (stdout: string) => void): Promise<boolean>;
86
+ /**
87
+ * Which comment markers apply to a file, since they are not universal:
88
+ * - `c-like` — `//` only. `#` is NOT a comment in C-family syntax, where it
89
+ * opens a JS private field (`this.#handler`) or a C preprocessor directive.
90
+ * - `hash` — `#` only. `//` in Python or YAML is division or part of a URL.
91
+ * - `both` — unknown extension: strip either, which over-strips rather than
92
+ * under-reports. The conservative default, and the pre-060 behaviour.
93
+ */
94
+ export type CommentSyntax = 'c-like' | 'hash' | 'both';
95
+ /** Comment syntax for a repo-relative path; `both` when the extension is unknown. */
96
+ export declare function commentSyntaxFor(file: string): CommentSyntax;
97
+ /**
98
+ * Strip a trailing line comment from a line, tracking quote state so a marker
99
+ * inside a string literal (a `#` in `"#fff"`, a `//` in a quoted URL) survives.
100
+ *
101
+ * Heuristic, not a tokenizer. `syntax` selects the applicable markers — passing
102
+ * the wrong one is how a valid `this.#handler = eval(payload)` used to be read
103
+ * as a comment and dropped entirely (ticket 059).
104
+ *
105
+ * Block comments are handled by the caller, which alone can track `/* *\/` state
106
+ * across lines; see {@link scanDiffPatterns}.
107
+ */
108
+ export declare function stripInlineComment(line: string, syntax?: CommentSyntax): string;
109
+ /**
110
+ * Blank out the contents of string literals, keeping the quotes and the original
111
+ * length so the rest of the line still reads as code.
112
+ *
113
+ * This is what lets a pattern ask "is a real call being made here" without a
114
+ * lookahead that guesses at quoting. The `eval` rule used to carry
115
+ * `(?![^'"`]*['"`])` — intended to skip `eval` written inside a string, but in
116
+ * practice it disabled the rule on any line containing a quote anywhere, so
117
+ * `eval(userInput + "x")` and ``eval(`${payload}`)`` both went unreported
118
+ * (ticket 058).
119
+ *
120
+ * Only for patterns that match *code*. Rules that look for string *contents* —
121
+ * an SQL keyword inside quotes, a hardcoded URL — must keep reading the raw
122
+ * line, which is what {@link DiffPattern.view} selects.
123
+ */
124
+ export declare function stripStringLiterals(line: string): string;
125
+ /** One regex-matched finding: which added lines to flag, under what label and level. */
126
+ export interface DiffPattern {
127
+ pattern: RegExp;
128
+ label: string;
129
+ severity: Severity;
130
+ /**
131
+ * Which view of the line the pattern reads.
132
+ * - `raw` (default) — the line as written, comments already stripped. Required
133
+ * by rules that inspect string *contents*, e.g. an SQL keyword in quotes.
134
+ * - `code` — string literals blanked by {@link stripStringLiterals}, so a rule
135
+ * matching a *call* is not thrown off by unrelated quoting on the same line.
136
+ */
137
+ view?: 'raw' | 'code';
138
+ }
139
+ /**
140
+ * How many added lines a taint survives, for the one check that asks for it.
141
+ *
142
+ * Exported because the default belongs to Diff Security, not to this function:
143
+ * `scanDiffPatterns` is shared by Diff Smells, Workflow Security and Dockerfile
144
+ * Security too, and defaulting the heuristic ON here leaked a finding labelled
145
+ * "SQL injection risk" into a code-smell report — under the wrong check, three
146
+ * times per run, off a config key (`diffSecurity.dataflowWindow`) that has no
147
+ * meaning for any of them. Caught by our own Diff Smells row.
148
+ */
149
+ export declare const DEFAULT_DATAFLOW_WINDOW = 10;
150
+ /**
151
+ * Bucket added diff lines by the {@link DiffPattern}s they match, split by
152
+ * severity. Patterns are expected to anchor on the leading `+` themselves
153
+ * (`/^\+(?!\+)…/`), which is what keeps `+++` file headers and context lines out.
154
+ *
155
+ * Comment handling follows the file each hunk belongs to, read from the `+++`
156
+ * headers as the diff is walked — a single run reviews files of several
157
+ * languages, so a repo-wide setting would be wrong for most of them.
158
+ *
159
+ * `skipIgnored` re-applies the `pr-checkmate-ignore` opt-out for callers that run
160
+ * `git diff` themselves; a diff obtained from {@link diffAddedLines} is already
161
+ * filtered and should leave it off.
162
+ *
163
+ * `comments: 'off'` scans lines verbatim, which is how a client audits code that
164
+ * was commented out rather than deleted.
165
+ */
166
+ export declare function scanDiffPatterns(stdout: string, patterns: readonly DiffPattern[], opts?: {
167
+ skipIgnored?: boolean;
168
+ comments?: 'language' | 'legacy' | 'off';
169
+ /** Globs whose files are skipped entirely (client `<check>.ignorePaths`). */
170
+ ignorePaths?: string[];
171
+ /**
172
+ * Added lines a taint survives for the cross-line SQL heuristic.
173
+ *
174
+ * Off unless the caller asks. Only Diff Security owns this behaviour — it is
175
+ * configured by `diffSecurity.dataflowWindow` and reports a security label —
176
+ * so every other caller of this function gets a plain pattern scan.
177
+ */
178
+ dataflowWindow?: number;
179
+ }): SeverityBuckets;
180
+ /**
181
+ * Log a capped sample of raw output lines under a one-line summary.
182
+ *
183
+ * The cap is the point: a linter with 400 offences must not push the rest of the
184
+ * report out of a CI log's scrollback, and the count that follows the sample is
185
+ * what keeps the truncation from reading as the whole story.
186
+ *
187
+ * Deliberately not the private `logFindings` below, which this nearly collided
188
+ * with. That one takes findings already grouped into labelled buckets and pairs
189
+ * the log with a severity; this one takes lines a tool printed and does nothing
190
+ * but show them, which is what a check wrapping somebody else's output needs and
191
+ * the only thing it can honestly claim about them.
192
+ *
193
+ * Here rather than beside its first caller because three categories want it now —
194
+ * the language runner, the Python type check, and Duplicate Code — and a
195
+ * `quality/` check importing from `languages/` to get a logger was the wrong
196
+ * shape (ticket 079).
197
+ */
198
+ export declare function logSample(name: string, summary: string, lines: string[]): void;
199
+ export declare function bucketTotal(bucket: FindingBucket): number;
200
+ /**
201
+ * Report a bucket at the check's configured level, summarized as
202
+ * `9× console.*(), 1× debugger statement`.
203
+ *
204
+ * The phrasing every keyword-counting check uses: the label already says what
205
+ * was found, so only the count varies. Written out per check, the four-step tail
206
+ * — resolve the level, log at it, join the counts, emit at the same level — was
207
+ * copied verbatim, and `isError: sev.icon === '❌'` is exactly the kind of link
208
+ * between two of those steps that silently rots when only one side is edited.
209
+ */
210
+ export declare function reportCountedFindings(findings: FindingBucket, ctx: CheckContext, opts: {
211
+ /** Log prefix, e.g. 'TODO/FIXME'. */
212
+ prefix: string;
213
+ /** The client's level for this check, e.g. `ctx.config.todoFixme?.severity`. */
214
+ severity?: Severity;
215
+ /** Level to use when the client configured none. Defaults to `warn`. */
216
+ fallback?: Severity;
217
+ /** Samples printed per label. Defaults to the client's `log.sampleLimit`, else 3. */
218
+ sampleLimit?: number;
219
+ /** Shorten a label for the summary only, e.g. drop an explanatory tail. */
220
+ summaryLabel?: (label: string) => string;
221
+ /** Appended to the summary, e.g. ` (no ticket reference)`. */
222
+ suffix?: string;
223
+ }): CheckOutcome;
224
+ interface SeverityReportOptions {
225
+ /** Log prefix, e.g. 'Diff Security'. */
226
+ prefix: string;
227
+ /** Summary phrasing given the error count. */
228
+ errorSummary: (n: number) => string;
229
+ /** Summary phrasing given the warning count. */
230
+ warningSummary: (n: number) => string;
231
+ /** Append ": N occurrence(s)" after each label (default true). */
232
+ showCount?: boolean;
233
+ /** Max samples printed per label; omit to print all. */
234
+ sampleLimit?: number;
235
+ /**
236
+ * Finding labels to suppress (client `<check>.ignore`). A label is dropped
237
+ * when it contains any ignore entry (case-insensitive), so a repo can mute a
238
+ * single built-in finding without disabling the whole check.
239
+ */
240
+ ignore?: string[];
241
+ /**
242
+ * What a non-empty error bucket means for the run (client `<check>.failOn`):
243
+ * - `error` — block it (`fail`). The default: a finding the check itself rates
244
+ * `error` is meant to gate the merge, which is what a PR gate is for.
245
+ * - `warn` — report but never block, whatever the finding's own severity.
246
+ * - `never` — always `pass`; the findings are still logged.
247
+ *
248
+ * Falls back to `defaults.failOn`, then to `error`.
249
+ */
250
+ failOn?: FailOn;
251
+ /**
252
+ * Per-finding level overrides (client `<check>.severityOverrides`), keyed by a
253
+ * case-insensitive substring of the label. Lets a repo demote one noisy rule,
254
+ * promote one it cares about, or drop a single finding — without turning the
255
+ * whole check off. `off` removes the finding entirely, like `ignore`.
256
+ */
257
+ severityOverrides?: Record<string, 'error' | 'warn' | 'off'>;
258
+ /** Repo-wide fallbacks (client `severityDefaults`), used when the check sets nothing. */
259
+ defaults?: {
260
+ failOn?: FailOn;
261
+ };
262
+ }
263
+ /**
264
+ * What a non-empty error bucket does to the run.
265
+ *
266
+ * Not exported, for the same reason as {@link Severity}: only this module names
267
+ * it, and `tsc` inlines it into `findings.d.ts` regardless.
268
+ */
269
+ type FailOn = 'error' | 'warn' | 'never';
270
+ /** The knobs a check reads straight out of its own block in pr-checkmate.json. */
271
+ interface ClientFindingConfig {
272
+ ignore?: string[];
273
+ failOn?: FailOn;
274
+ severityOverrides?: Record<string, 'error' | 'warn' | 'off'>;
275
+ }
276
+ /**
277
+ * The half of {@link SeverityReportOptions} every check fills in identically:
278
+ * the client's own `<check>.ignore` / `failOn` / `severityOverrides`, the shared
279
+ * sample limit, and the repo-wide `severityDefaults` fallback.
280
+ *
281
+ * Only the phrasing (`prefix` and the two summaries) is ever check-specific, so
282
+ * spelling the rest out per check meant five lines of copy-paste that had to be
283
+ * kept in step by hand — and a check that forgot one line silently ignored a
284
+ * knob the client had set.
285
+ */
286
+ export declare function clientFindingOptions(ctx: CheckContext, cfg?: ClientFindingConfig): Pick<SeverityReportOptions, 'sampleLimit' | 'ignore' | 'failOn' | 'severityOverrides' | 'defaults'>;
287
+ /**
288
+ * Report error/warning finding buckets: log both, then produce the outcome.
289
+ *
290
+ * Order is the contract, and each step exists because the one before it is too
291
+ * blunt on its own:
292
+ * 1. `ignore` — drop the finding outright.
293
+ * 2. `severityOverrides` — re-file what survived.
294
+ * 3. `failOn` — decide what a remaining error means for the run.
295
+ * The universal `severity[<check name>]` map is applied later still, by the
296
+ * orchestrator, so a client can always override a check wholesale by name.
297
+ */
298
+ export declare function reportSeverityBuckets(errorsIn: FindingBucket, warningsIn: FindingBucket, opts: SeverityReportOptions): CheckOutcome;
299
+ export {};