pr-checkmate 3.0.4 → 3.2.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 (384) 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/{core → cjs/core}/checks/languages/go-format.js +21 -21
  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/cjs/core/checks/quality/markdown-lint.js +147 -0
  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/profiles.js +1 -1
  118. package/dist/{core → cjs/core}/install/reuse.d.ts +1 -1
  119. package/dist/{core → cjs/core}/install/reuse.js +4 -4
  120. package/dist/{core → cjs/core}/registry.d.ts +1 -1
  121. package/dist/cjs/core/registry.js +112 -0
  122. package/dist/{core → cjs/core}/reporters.d.ts +1 -1
  123. package/dist/{core → cjs/core}/reporters.js +28 -28
  124. package/dist/{core → cjs/core}/run-checks.d.ts +2 -2
  125. package/dist/{core → cjs/core}/run-checks.js +31 -31
  126. package/dist/{core → cjs/core}/targets.d.ts +1 -1
  127. package/dist/{core → cjs/core}/targets.js +20 -20
  128. package/dist/{core → cjs/core}/types.d.ts +3 -3
  129. package/dist/cjs/index.d.ts +12 -0
  130. package/dist/{index.js → cjs/index.js} +18 -18
  131. package/dist/{init.js → cjs/init.js} +68 -56
  132. package/dist/{interfaces → cjs/interfaces}/index.d.ts +3 -3
  133. package/dist/cjs/package.json +1 -0
  134. package/dist/{scripts → cjs/scripts}/copy-configs.js +22 -7
  135. package/dist/{scripts → cjs/scripts}/generate-install-manifests.js +2 -2
  136. package/dist/{scripts → cjs/scripts}/publish-github.js +4 -4
  137. package/dist/{utils → cjs/utils}/detect-language.js +12 -12
  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/esm/core/checks/languages/go-format.js +163 -0
  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 +141 -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/esm/utils/execa.js +10 -0
  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/duplicate/package-lock.json +0 -12
  335. package/install-manifests/js/package-lock.json +17 -41
  336. package/install-manifests/js/package.json +1 -1
  337. package/install-manifests/markdown/package-lock.json +1 -492
  338. package/install-manifests/markdown/package.json +1 -1
  339. package/package.json +17 -15
  340. package/dist/core/checks/languages/lint.d.ts +0 -2
  341. package/dist/core/checks/quality/markdown-lint.js +0 -110
  342. package/dist/core/index.d.ts +0 -4
  343. package/dist/core/registry.js +0 -112
  344. package/dist/index.d.ts +0 -12
  345. package/dist/utils/index.d.ts +0 -15
  346. /package/dist/{cli.d.ts → cjs/cli.d.ts} +0 -0
  347. /package/dist/{config → cjs/config}/constants.d.ts +0 -0
  348. /package/dist/{config → cjs/config}/constants.js +0 -0
  349. /package/dist/{config → cjs/config}/pr-checkmate-workflow-docker.yml +0 -0
  350. /package/dist/{config → cjs/config}/pr-checkmate-workflow.yml +0 -0
  351. /package/dist/{core → cjs/core}/checks/languages/ruff-shared.d.ts +0 -0
  352. /package/dist/{core → cjs/core}/checks/languages/ruff-shared.js +0 -0
  353. /package/dist/{core → cjs/core}/commands.d.ts +0 -0
  354. /package/dist/{core → cjs/core}/commands.js +0 -0
  355. /package/dist/{core → cjs/core}/install/cache.d.ts +0 -0
  356. /package/dist/{core → cjs/core}/install/lock.d.ts +0 -0
  357. /package/dist/{core → cjs/core}/install/merge.d.ts +0 -0
  358. /package/dist/{core → cjs/core}/install/merge.js +0 -0
  359. /package/dist/{core → cjs/core}/types.js +0 -0
  360. /package/dist/{init.d.ts → cjs/init.d.ts} +0 -0
  361. /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
  362. /package/dist/{scripts → cjs/scripts}/copy-configs.d.ts +0 -0
  363. /package/dist/{scripts → cjs/scripts}/generate-install-manifests.d.ts +0 -0
  364. /package/dist/{scripts → cjs/scripts}/publish-github.d.ts +0 -0
  365. /package/dist/{utils → cjs/utils}/ci.d.ts +0 -0
  366. /package/dist/{utils → cjs/utils}/ci.js +0 -0
  367. /package/dist/{utils → cjs/utils}/detect-language.d.ts +0 -0
  368. /package/dist/{utils → cjs/utils}/direct-deps.d.ts +0 -0
  369. /package/dist/{utils → cjs/utils}/direct-deps.js +0 -0
  370. /package/dist/{utils → cjs/utils}/execa.d.ts +0 -0
  371. /package/dist/{utils → cjs/utils}/execa.js +0 -0
  372. /package/dist/{utils → cjs/utils}/git.d.ts +0 -0
  373. /package/dist/{utils → cjs/utils}/glob.d.ts +0 -0
  374. /package/dist/{utils → cjs/utils}/glob.js +0 -0
  375. /package/dist/{utils → cjs/utils}/http.d.ts +0 -0
  376. /package/dist/{utils → cjs/utils}/logger.d.ts +0 -0
  377. /package/dist/{utils → cjs/utils}/logger.js +0 -0
  378. /package/dist/{utils → cjs/utils}/package-version.d.ts +0 -0
  379. /package/dist/{utils → cjs/utils}/pool.d.ts +0 -0
  380. /package/dist/{utils → cjs/utils}/pool.js +0 -0
  381. /package/dist/{utils → cjs/utils}/resolve-bin.d.ts +0 -0
  382. /package/dist/{utils → cjs/utils}/result-collector.d.ts +0 -0
  383. /package/dist/{utils → cjs/utils}/result-collector.js +0 -0
  384. /package/dist/{utils → cjs/utils}/update-notifier.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.phpFormatCheck = exports.csharpFormatCheck = exports.rustFormatCheck = exports.rustLintCheck = exports.goLintCheck = exports.shellcheckCheck = exports.rubyLintCheck = exports.swiftLintCheck = exports.kotlinLintCheck = void 0;
4
- const external_runner_1 = require("./external-runner");
4
+ const external_runner_js_1 = require("./external-runner.js");
5
5
  /**
6
6
  * Every check that runs a linter or formatter we do not ship, as a table.
7
7
  *
@@ -25,7 +25,7 @@ const external_runner_1 = require("./external-runner");
25
25
  * doubles as the Kotlin format signal). Uses the repo's own `.editorconfig`
26
26
  * when present.
27
27
  */
28
- exports.kotlinLintCheck = (0, external_runner_1.defineExternalLint)({
28
+ exports.kotlinLintCheck = (0, external_runner_js_1.defineExternalLint)({
29
29
  name: 'ktlint',
30
30
  bin: 'ktlint',
31
31
  tool: 'ktlint',
@@ -41,7 +41,7 @@ exports.kotlinLintCheck = (0, external_runner_1.defineExternalLint)({
41
41
  * its own `.swiftlint.yml` scope, and a file list would bypass the excludes a
42
42
  * repo wrote there — so the resolved targets only decide whether it runs at all.
43
43
  */
44
- exports.swiftLintCheck = (0, external_runner_1.defineExternalLint)({
44
+ exports.swiftLintCheck = (0, external_runner_js_1.defineExternalLint)({
45
45
  name: 'SwiftLint',
46
46
  bin: 'swiftlint',
47
47
  tool: 'swiftlint',
@@ -63,7 +63,7 @@ exports.swiftLintCheck = (0, external_runner_1.defineExternalLint)({
63
63
  * so it doubles as the Ruby format signal. Uses the repo's own `.rubocop.yml`
64
64
  * when present.
65
65
  */
66
- exports.rubyLintCheck = (0, external_runner_1.defineExternalLint)({
66
+ exports.rubyLintCheck = (0, external_runner_js_1.defineExternalLint)({
67
67
  name: 'RuboCop',
68
68
  bin: 'rubocop',
69
69
  tool: 'rubocop',
@@ -84,7 +84,7 @@ exports.rubyLintCheck = (0, external_runner_1.defineExternalLint)({
84
84
  * No language gate: shell is not something detection reports, and a `deploy.sh`
85
85
  * in a Python repository is exactly the file this check exists for.
86
86
  */
87
- exports.shellcheckCheck = (0, external_runner_1.defineExternalLint)({
87
+ exports.shellcheckCheck = (0, external_runner_js_1.defineExternalLint)({
88
88
  name: 'ShellCheck',
89
89
  bin: 'shellcheck',
90
90
  tool: 'shellcheck',
@@ -108,7 +108,7 @@ exports.shellcheckCheck = (0, external_runner_1.defineExternalLint)({
108
108
  * per package, so it runs over the module rather than a file list; the delta
109
109
  * only decides whether it runs.
110
110
  */
111
- exports.goLintCheck = (0, external_runner_1.defineExternalLint)({
111
+ exports.goLintCheck = (0, external_runner_js_1.defineExternalLint)({
112
112
  name: 'Go Vet',
113
113
  bin: 'go',
114
114
  tool: 'go',
@@ -126,7 +126,7 @@ exports.goLintCheck = (0, external_runner_1.defineExternalLint)({
126
126
  * Lints changed Rust with Clippy. It compiles the crate, so it runs over the
127
127
  * crate rather than a file list; the delta only decides whether it runs.
128
128
  */
129
- exports.rustLintCheck = (0, external_runner_1.defineExternalLint)({
129
+ exports.rustLintCheck = (0, external_runner_js_1.defineExternalLint)({
130
130
  name: 'Clippy',
131
131
  bin: 'cargo',
132
132
  tool: 'clippy',
@@ -148,7 +148,7 @@ exports.rustLintCheck = (0, external_runner_1.defineExternalLint)({
148
148
  * crate's edition from `Cargo.toml`, and rustfmt invoked directly does not —
149
149
  * which silently formats 2015-edition code by 2024 rules.
150
150
  */
151
- exports.rustFormatCheck = (0, external_runner_1.defineExternalFormat)({
151
+ exports.rustFormatCheck = (0, external_runner_js_1.defineExternalFormat)({
152
152
  name: 'Rustfmt',
153
153
  bin: 'cargo',
154
154
  tool: 'rustfmt',
@@ -167,7 +167,7 @@ exports.rustFormatCheck = (0, external_runner_1.defineExternalFormat)({
167
167
  * (and expects a prior `dotnet restore`), so it runs over the whole project; the
168
168
  * delta only decides whether it runs.
169
169
  */
170
- exports.csharpFormatCheck = (0, external_runner_1.defineExternalFormat)({
170
+ exports.csharpFormatCheck = (0, external_runner_js_1.defineExternalFormat)({
171
171
  name: 'C# Format',
172
172
  bin: 'dotnet',
173
173
  tool: 'dotnet',
@@ -186,7 +186,7 @@ exports.csharpFormatCheck = (0, external_runner_1.defineExternalFormat)({
186
186
  * absolute paths, and a CI checkout directory that changes between runs makes a
187
187
  * stale cache report files as clean that were never examined.
188
188
  */
189
- exports.phpFormatCheck = (0, external_runner_1.defineExternalFormat)({
189
+ exports.phpFormatCheck = (0, external_runner_js_1.defineExternalFormat)({
190
190
  name: 'PHP CS Fixer',
191
191
  bin: 'php-cs-fixer',
192
192
  tool: 'php-cs-fixer',
@@ -1,5 +1,5 @@
1
- import { Check, CheckContext, type Language } from '../../types';
2
- import { type ExternalTool } from '../tool-install';
1
+ import { Check, CheckContext, type Language } from '../../types.js';
2
+ import { type ExternalTool } from '../tool-install.js';
3
3
  /**
4
4
  * The one shape every check that shells out to somebody else's linter has.
5
5
  *
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runTool = runTool;
4
4
  exports.defineExternalLint = defineExternalLint;
5
5
  exports.defineExternalFormat = defineExternalFormat;
6
- const utils_1 = require("../../../utils");
7
- const execa_1 = require("../../../utils/execa");
8
- const targets_1 = require("../../targets");
9
- const types_1 = require("../../types");
10
- const findings_1 = require("../findings");
11
- const tool_install_1 = require("../tool-install");
6
+ const execa_js_1 = require("../../../utils/execa.js");
7
+ const index_js_1 = require("../../../utils/index.js");
8
+ const targets_js_1 = require("../../targets.js");
9
+ const types_js_1 = require("../../types.js");
10
+ const findings_js_1 = require("../findings.js");
11
+ const tool_install_js_1 = require("../tool-install.js");
12
12
  /**
13
13
  * Run an external tool, telling an absent binary apart from a failing one.
14
14
  *
@@ -20,7 +20,7 @@ const tool_install_1 = require("../tool-install");
20
20
  * copies to lose it.
21
21
  */
22
22
  async function runTool(ctx, bin, args) {
23
- const result = await (0, execa_1.execa)(bin, args, { cwd: ctx.cwd, reject: false });
23
+ const result = await (0, execa_js_1.execa)(bin, args, { cwd: ctx.cwd, reject: false });
24
24
  if (result.code === 'ENOENT')
25
25
  return { missing: true };
26
26
  return {
@@ -67,7 +67,7 @@ function defineExternal(spec, phase, work) {
67
67
  return isEnabled(ctx, spec.configKey, spec.language);
68
68
  },
69
69
  async run(ctx) {
70
- const targets = await (0, targets_1.resolveTargets)(ctx, spec.globs, {
70
+ const targets = await (0, targets_js_1.resolveTargets)(ctx, spec.globs, {
71
71
  onEmpty: { pass: `no ${spec.subject} changed` },
72
72
  });
73
73
  if (!Array.isArray(targets))
@@ -88,15 +88,15 @@ function defineExternalLint(spec) {
88
88
  return defineExternal(spec, 'informational', async (ctx, targets) => {
89
89
  const run = await runTool(ctx, spec.bin, spec.args(ctx, targets));
90
90
  if (run.missing)
91
- return (0, tool_install_1.notInstalled)(spec.tool, spec.toolLabel);
91
+ return (0, tool_install_js_1.notInstalled)(spec.tool, spec.toolLabel);
92
92
  const output = combinedOutput(run, spec.stderrFirst);
93
93
  // Exit 0 is the tool's verdict. Empty output on a non-zero exit is a tool
94
94
  // that objected without saying to what, and there is nothing to put in a
95
95
  // report either way — so both are a pass rather than a warn reading
96
96
  // "0 issue(s)".
97
97
  if (run.exitCode === 0 || !output) {
98
- utils_1.logger.info(`[${spec.name}]: ✅ No issues found`);
99
- return (0, types_1.pass)();
98
+ index_js_1.logger.info(`[${spec.name}]: ✅ No issues found`);
99
+ return (0, types_js_1.pass)();
100
100
  }
101
101
  const lines = output.split('\n').filter(spec.keep ?? isNotBlank);
102
102
  // The tool objected and none of its output matched what this check knows how
@@ -105,8 +105,8 @@ function defineExternalLint(spec) {
105
105
  const summary = lines.length > 0
106
106
  ? (spec.summary ?? countIssues)(lines, targets)
107
107
  : `${spec.bin} exited ${run.exitCode ?? 'without a code'} with no readable diagnostics`;
108
- (0, findings_1.logSample)(spec.name, `${summary}:`, lines);
109
- return (0, types_1.warn)(summary);
108
+ (0, findings_js_1.logSample)(spec.name, `${summary}:`, lines);
109
+ return (0, types_js_1.warn)(summary);
110
110
  });
111
111
  }
112
112
  /**
@@ -121,12 +121,12 @@ function defineExternalFormat(spec) {
121
121
  return defineExternal(spec, 'format', async (ctx, targets) => {
122
122
  const dry = await runTool(ctx, spec.bin, spec.checkArgs(targets));
123
123
  if (dry.missing)
124
- return (0, tool_install_1.notInstalled)(spec.tool, spec.toolLabel);
124
+ return (0, tool_install_js_1.notInstalled)(spec.tool, spec.toolLabel);
125
125
  if (dry.exitCode === 0)
126
- return (0, types_1.pass)();
126
+ return (0, types_js_1.pass)();
127
127
  if (!ctx.write) {
128
- utils_1.logger.warn(`[${spec.name}]: ⚠️ ${spec.code} needs formatting`);
129
- return (0, types_1.warn)(`${spec.code} needs formatting (run with write to fix)`);
128
+ index_js_1.logger.warn(`[${spec.name}]: ⚠️ ${spec.code} needs formatting`);
129
+ return (0, types_js_1.warn)(`${spec.code} needs formatting (run with write to fix)`);
130
130
  }
131
131
  const fix = await runTool(ctx, spec.bin, spec.writeArgs(targets));
132
132
  // `missing` cannot happen here — the same binary answered a moment ago — but
@@ -134,10 +134,10 @@ function defineExternalFormat(spec) {
134
134
  // correct and shorter than asserting it away.
135
135
  if (fix.missing || fix.exitCode !== 0) {
136
136
  const detail = fix.missing ? '' : `\n${fix.stderr}`;
137
- utils_1.logger.warn(`[${spec.name}]: ⚠️ ${spec.bin} failed to rewrite files${detail}`);
138
- return (0, types_1.warn)(`${spec.bin} failed to rewrite files`);
137
+ index_js_1.logger.warn(`[${spec.name}]: ⚠️ ${spec.bin} failed to rewrite files${detail}`);
138
+ return (0, types_js_1.warn)(`${spec.bin} failed to rewrite files`);
139
139
  }
140
- utils_1.logger.info(`[${spec.name}]: ✅ Reformatted ${spec.code}`);
141
- return (0, types_1.pass)(`reformatted ${spec.code}`);
140
+ index_js_1.logger.info(`[${spec.name}]: ✅ Reformatted ${spec.code}`);
141
+ return (0, types_js_1.pass)(`reformatted ${spec.code}`);
142
142
  });
143
143
  }
@@ -1,4 +1,4 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  /**
3
3
  * Formats changed Go files with gofmt — the runner's own when it has one, and a
4
4
  * bundled WASM build otherwise, so the check has no runner dependency at all.
@@ -7,11 +7,11 @@ exports.goFormatCheck = void 0;
7
7
  const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
9
  const node_url_1 = require("node:url");
10
- const utils_1 = require("../../../utils");
11
- const targets_1 = require("../../targets");
12
- const types_1 = require("../../types");
13
- const tool_install_1 = require("../tool-install");
14
- const external_runner_1 = require("./external-runner");
10
+ const index_js_1 = require("../../../utils/index.js");
11
+ const targets_js_1 = require("../../targets.js");
12
+ const types_js_1 = require("../../types.js");
13
+ const tool_install_js_1 = require("../tool-install.js");
14
+ const external_runner_js_1 = require("./external-runner.js");
15
15
  const GO_GLOBS = ['*.go'];
16
16
  /**
17
17
  * Load the bundled WASM gofmt, or explain why it could not be loaded.
@@ -35,12 +35,12 @@ const GO_GLOBS = ['*.go'];
35
35
  */
36
36
  async function loadBundledGofmt() {
37
37
  try {
38
- const entry = (0, utils_1.resolvePackageBin)('@wasm-fmt/gofmt', 'gofmt_node.js');
38
+ const entry = (0, index_js_1.resolvePackageBin)('@wasm-fmt/gofmt', 'gofmt_node.js');
39
39
  const mod = (await import((0, node_url_1.pathToFileURL)(entry).href));
40
40
  return mod.format;
41
41
  }
42
42
  catch (err) {
43
- utils_1.logger.warn(`[Go Format]: ⚠️ bundled gofmt could not be loaded\n${err}`);
43
+ index_js_1.logger.warn(`[Go Format]: ⚠️ bundled gofmt could not be loaded\n${err}`);
44
44
  return null;
45
45
  }
46
46
  }
@@ -61,14 +61,14 @@ async function loadBundledGofmt() {
61
61
  */
62
62
  function verdictFor(ctx, unformatted) {
63
63
  if (unformatted.length === 0)
64
- return (0, types_1.pass)();
64
+ return (0, types_js_1.pass)();
65
65
  if (!ctx.write) {
66
- utils_1.logger.warn(`[Go Format]: ⚠️ ${unformatted.length} Go file(s) need formatting`);
67
- unformatted.slice(0, 10).forEach(file => utils_1.logger.warn(` ${file}`));
68
- return (0, types_1.warn)(`${unformatted.length} file(s) need formatting (run with write to fix)`);
66
+ index_js_1.logger.warn(`[Go Format]: ⚠️ ${unformatted.length} Go file(s) need formatting`);
67
+ unformatted.slice(0, 10).forEach(file => index_js_1.logger.warn(` ${file}`));
68
+ return (0, types_js_1.warn)(`${unformatted.length} file(s) need formatting (run with write to fix)`);
69
69
  }
70
- utils_1.logger.info(`[Go Format]: ✅ Reformatted ${unformatted.length} Go file(s)`);
71
- return (0, types_1.pass)(`reformatted ${unformatted.length} file(s)`);
70
+ index_js_1.logger.info(`[Go Format]: ✅ Reformatted ${unformatted.length} Go file(s)`);
71
+ return (0, types_js_1.pass)(`reformatted ${unformatted.length} file(s)`);
72
72
  }
73
73
  /**
74
74
  * Format with the runner's own `gofmt`, when it has one.
@@ -83,7 +83,7 @@ function verdictFor(ctx, unformatted) {
83
83
  * @returns The outcome, or `null` when there is no system `gofmt` to ask.
84
84
  */
85
85
  async function formatWithSystemGofmt(ctx, targets) {
86
- const list = await (0, external_runner_1.runTool)(ctx, 'gofmt', ['-l', ...targets]);
86
+ const list = await (0, external_runner_js_1.runTool)(ctx, 'gofmt', ['-l', ...targets]);
87
87
  if (list.missing)
88
88
  return null;
89
89
  const unformatted = list.stdout.split('\n').filter(Boolean);
@@ -91,10 +91,10 @@ async function formatWithSystemGofmt(ctx, targets) {
91
91
  // having been considered at all.
92
92
  if (unformatted.length === 0 || !ctx.write)
93
93
  return verdictFor(ctx, unformatted);
94
- const fix = await (0, external_runner_1.runTool)(ctx, 'gofmt', ['-w', ...unformatted]);
94
+ const fix = await (0, external_runner_js_1.runTool)(ctx, 'gofmt', ['-w', ...unformatted]);
95
95
  if (fix.missing || fix.exitCode !== 0) {
96
- utils_1.logger.warn(`[Go Format]: ⚠️ gofmt -w failed\n${fix.missing ? '' : fix.stderr}`);
97
- return (0, types_1.warn)('gofmt failed to rewrite files');
96
+ index_js_1.logger.warn(`[Go Format]: ⚠️ gofmt -w failed\n${fix.missing ? '' : fix.stderr}`);
97
+ return (0, types_js_1.warn)('gofmt failed to rewrite files');
98
98
  }
99
99
  return verdictFor(ctx, unformatted);
100
100
  }
@@ -125,7 +125,7 @@ function formatWithBundledGofmt(ctx, targets, format) {
125
125
  // gofmt parses before it formats, so a throw here is a syntax error. That
126
126
  // is Go Vet's finding to report, not a formatting verdict — and calling it
127
127
  // one sends people looking for a style problem that does not exist.
128
- utils_1.logger.warn(`[Go Format]: ⚠️ could not parse ${rel} (syntax error?)\n${err}`);
128
+ index_js_1.logger.warn(`[Go Format]: ⚠️ could not parse ${rel} (syntax error?)\n${err}`);
129
129
  continue;
130
130
  }
131
131
  if (formatted === content)
@@ -149,7 +149,7 @@ exports.goFormatCheck = {
149
149
  return ctx.config.go?.enabled !== false && ctx.languages.includes('go');
150
150
  },
151
151
  async run(ctx) {
152
- const targets = await (0, targets_1.resolveTargets)(ctx, GO_GLOBS, {
152
+ const targets = await (0, targets_js_1.resolveTargets)(ctx, GO_GLOBS, {
153
153
  onEmpty: { pass: 'no Go files changed' },
154
154
  });
155
155
  if (!Array.isArray(targets))
@@ -162,8 +162,8 @@ exports.goFormatCheck = {
162
162
  // loaded, which means a partial install of this package. Installing Go is
163
163
  // the fix a client can actually act on.
164
164
  if (!format)
165
- return (0, tool_install_1.notInstalled)('gofmt', 'gofmt');
166
- utils_1.logger.debug('[Go Format]: no system gofmt — using the bundled WASM formatter');
165
+ return (0, tool_install_js_1.notInstalled)('gofmt', 'gofmt');
166
+ index_js_1.logger.debug('[Go Format]: no system gofmt — using the bundled WASM formatter');
167
167
  return formatWithBundledGofmt(ctx, targets, format);
168
168
  },
169
169
  };
@@ -0,0 +1,2 @@
1
+ import { Check } from '../../types.js';
2
+ export declare const lintCheck: Check;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lintCheck = void 0;
4
- const config_1 = require("../../../config");
5
- const utils_1 = require("../../../utils");
6
- const execa_1 = require("../../../utils/execa");
7
- const reuse_1 = require("../../install/reuse");
8
- const targets_1 = require("../../targets");
9
- const types_1 = require("../../types");
4
+ const index_js_1 = require("../../../config/index.js");
5
+ const execa_js_1 = require("../../../utils/execa.js");
6
+ const index_js_2 = require("../../../utils/index.js");
7
+ const reuse_js_1 = require("../../install/reuse.js");
8
+ const targets_js_1 = require("../../targets.js");
9
+ const types_js_1 = require("../../types.js");
10
10
  /**
11
11
  * Resolve the ESLint binary under the client's `install.reuseLocal` policy.
12
12
  *
@@ -18,13 +18,13 @@ const types_1 = require("../../types");
18
18
  * `clientOwnsConfig` exists (ticket 064, lever A).
19
19
  */
20
20
  function resolveESLintBin(ctx, clientOwnsConfig) {
21
- return (0, utils_1.resolvePackageBin)('eslint', 'bin/eslint.js', {
22
- paths: (0, reuse_1.clientToolPaths)('eslint', ctx, { clientOwnsConfig }),
21
+ return (0, index_js_2.resolvePackageBin)('eslint', 'bin/eslint.js', {
22
+ paths: (0, reuse_js_1.clientToolPaths)('eslint', ctx, { clientOwnsConfig }),
23
23
  });
24
24
  }
25
25
  async function getESLintMajorVersion(eslintBin) {
26
26
  try {
27
- const { stdout } = await (0, execa_1.execa)(process.execPath, [eslintBin, '--version']);
27
+ const { stdout } = await (0, execa_js_1.execa)(process.execPath, [eslintBin, '--version']);
28
28
  const match = stdout.match(/v?(\d+)\./);
29
29
  return match ? parseInt(match[1], 10) : 8;
30
30
  }
@@ -39,15 +39,15 @@ exports.lintCheck = {
39
39
  return ctx.languages.includes('typescript') || ctx.languages.includes('javascript');
40
40
  },
41
41
  async run(ctx) {
42
- const targets = await (0, targets_1.resolveScopedTargetFiles)(ctx, ['*.ts', '*.tsx', '*.js', '*.jsx'], (0, config_1.getSourcePaths)(ctx.cwd));
42
+ const targets = await (0, targets_js_1.resolveScopedTargetFiles)(ctx, ['*.ts', '*.tsx', '*.js', '*.jsx'], (0, index_js_1.getSourcePaths)(ctx.cwd));
43
43
  if (targets === null)
44
- return (0, types_1.skip)('git unavailable');
44
+ return (0, types_js_1.skip)('git unavailable');
45
45
  if (targets.length === 0)
46
- return (0, types_1.pass)('no TypeScript/JavaScript files to lint');
46
+ return (0, types_js_1.pass)('no TypeScript/JavaScript files to lint');
47
47
  // Whose config decides whose binary, so this is read BEFORE resolving one.
48
48
  // It used to be the other way round, which is how a client's ESLint 8 ended
49
49
  // up pointed at the flat config we generate.
50
- const hasLocal = (0, config_1.hasLocalConfig)(['eslint.config.mjs', 'eslint.config.js', '.eslintrc.js', '.eslintrc.json', '.eslintrc'], ctx.cwd);
50
+ const hasLocal = (0, index_js_1.hasLocalConfig)(['eslint.config.mjs', 'eslint.config.js', '.eslintrc.js', '.eslintrc.json', '.eslintrc'], ctx.cwd);
51
51
  const eslintBin = resolveESLintBin(ctx, hasLocal);
52
52
  const version = await getESLintMajorVersion(eslintBin);
53
53
  const args = [...targets];
@@ -68,28 +68,28 @@ exports.lintCheck = {
68
68
  if (ctx.write)
69
69
  args.push('--fix');
70
70
  if (hasLocal) {
71
- utils_1.logger.info(`[ESLint]: Using local config (${targets.length} file(s))`);
71
+ index_js_2.logger.info(`[ESLint]: Using local config (${targets.length} file(s))`);
72
72
  }
73
73
  else {
74
74
  const configFile = version >= 9 ? 'eslint.config.mjs' : '.eslintrc.js';
75
- args.push('--config', (0, config_1.getPackageConfigPath)(configFile));
76
- utils_1.logger.info(`[ESLint]: Using pr-checkmate config (ESLint v${version}, ${configFile})`);
75
+ args.push('--config', (0, index_js_1.getPackageConfigPath)(configFile));
76
+ index_js_2.logger.info(`[ESLint]: Using pr-checkmate config (ESLint v${version}, ${configFile})`);
77
77
  }
78
- config_1.IGNORE_PATTERNS.forEach(p => args.push('--ignore-pattern', p));
79
- const result = await (0, execa_1.execa)(process.execPath, [eslintBin, ...args], {
78
+ index_js_1.IGNORE_PATTERNS.forEach(p => args.push('--ignore-pattern', p));
79
+ const result = await (0, execa_js_1.execa)(process.execPath, [eslintBin, ...args], {
80
80
  cwd: ctx.cwd,
81
81
  stdio: 'inherit',
82
82
  reject: false,
83
83
  });
84
84
  if (result.exitCode === 0)
85
- return (0, types_1.pass)();
85
+ return (0, types_js_1.pass)();
86
86
  // ESLint exits 1 for lint errors and 2 for a fatal error — a config it cannot
87
87
  // load, an unresolvable plugin, a parser it cannot construct. Only the
88
88
  // former is the client's code. Treating exit 2 as "lint errors found" turned
89
89
  // a config incompatibility (often between our bundled config and the client's
90
90
  // toolchain) into a red gate on their PR, and named the wrong cause.
91
91
  if (result.exitCode === 1)
92
- return (0, types_1.fail)('lint errors found');
93
- return (0, types_1.warn)(`eslint failed to run (exit ${result.exitCode ?? 'killed'})${hasLocal ? '' : ' — using the pr-checkmate config'}`);
92
+ return (0, types_js_1.fail)('lint errors found');
93
+ return (0, types_js_1.warn)(`eslint failed to run (exit ${result.exitCode ?? 'killed'})${hasLocal ? '' : ' — using the pr-checkmate config'}`);
94
94
  },
95
95
  };
@@ -1,2 +1,2 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  export declare const prettierCheck: Check;
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.prettierCheck = void 0;
7
7
  const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
- const config_1 = require("../../../config");
10
- const utils_1 = require("../../../utils");
11
- const execa_1 = require("../../../utils/execa");
12
- const targets_1 = require("../../targets");
13
- const types_1 = require("../../types");
9
+ const index_js_1 = require("../../../config/index.js");
10
+ const execa_js_1 = require("../../../utils/execa.js");
11
+ const index_js_2 = require("../../../utils/index.js");
12
+ const targets_js_1 = require("../../targets.js");
13
+ const types_js_1 = require("../../types.js");
14
14
  function loadUserPrettierConfig(cwd) {
15
15
  const configPath = node_path_1.default.join(cwd, 'pr-checkmate.json');
16
16
  if (!node_fs_1.default.existsSync(configPath))
@@ -19,12 +19,12 @@ function loadUserPrettierConfig(cwd) {
19
19
  return JSON.parse(node_fs_1.default.readFileSync(configPath, 'utf-8')).prettier?.rules || {};
20
20
  }
21
21
  catch (err) {
22
- utils_1.logger.warn(`[Prettier]: ⚠️ Failed to read prettier config: ${err}`);
22
+ index_js_2.logger.warn(`[Prettier]: ⚠️ Failed to read prettier config: ${err}`);
23
23
  return {};
24
24
  }
25
25
  }
26
26
  function createTempPrettierConfig(cwd) {
27
- const defaultConfig = JSON.parse(node_fs_1.default.readFileSync((0, config_1.getPackageConfigPath)('.prettierrc'), 'utf-8'));
27
+ const defaultConfig = JSON.parse(node_fs_1.default.readFileSync((0, index_js_1.getPackageConfigPath)('.prettierrc'), 'utf-8'));
28
28
  const merged = { ...defaultConfig, ...loadUserPrettierConfig(cwd) };
29
29
  const tempConfigPath = node_path_1.default.join(cwd, '.prettierrc.temp.json');
30
30
  node_fs_1.default.writeFileSync(tempConfigPath, JSON.stringify(merged, null, 2));
@@ -32,7 +32,7 @@ function createTempPrettierConfig(cwd) {
32
32
  }
33
33
  function createTempIgnoreFile(cwd) {
34
34
  const file = node_path_1.default.join(cwd, '.prettierignore.temp');
35
- node_fs_1.default.writeFileSync(file, config_1.IGNORE_PATTERNS.join('\n'), 'utf-8');
35
+ node_fs_1.default.writeFileSync(file, index_js_1.IGNORE_PATTERNS.join('\n'), 'utf-8');
36
36
  return file;
37
37
  }
38
38
  exports.prettierCheck = {
@@ -42,11 +42,11 @@ exports.prettierCheck = {
42
42
  return ctx.languages.includes('typescript') || ctx.languages.includes('javascript');
43
43
  },
44
44
  async run(ctx) {
45
- const targets = await (0, targets_1.resolveScopedTargetFiles)(ctx, ['*.ts', '*.tsx', '*.js', '*.jsx', '*.json', '*.md'], (0, config_1.getSourcePaths)(ctx.cwd));
45
+ const targets = await (0, targets_js_1.resolveScopedTargetFiles)(ctx, ['*.ts', '*.tsx', '*.js', '*.jsx', '*.json', '*.md'], (0, index_js_1.getSourcePaths)(ctx.cwd));
46
46
  if (targets === null)
47
- return (0, types_1.skip)('git unavailable');
47
+ return (0, types_js_1.skip)('git unavailable');
48
48
  if (targets.length === 0)
49
- return (0, types_1.pass)('no files to format');
49
+ return (0, types_js_1.pass)('no files to format');
50
50
  const projectIgnore = node_path_1.default.join(ctx.cwd, '.prettierignore');
51
51
  const gitignore = node_path_1.default.join(ctx.cwd, '.gitignore');
52
52
  let tempIgnore = null;
@@ -57,7 +57,7 @@ exports.prettierCheck = {
57
57
  ignorePath = gitignore;
58
58
  else
59
59
  ignorePath = tempIgnore = createTempIgnoreFile(ctx.cwd);
60
- const hasLocal = (0, config_1.hasLocalConfig)(['.prettierrc', '.prettierrc.json', '.prettierrc.js', 'prettier.config.js'], ctx.cwd);
60
+ const hasLocal = (0, index_js_1.hasLocalConfig)(['.prettierrc', '.prettierrc.json', '.prettierrc.js', 'prettier.config.js'], ctx.cwd);
61
61
  // write=true → format in place; write=false → report-only (`--check`, never mutates files).
62
62
  const mode = ctx.write ? '--write' : '--check';
63
63
  let tempConfig = null;
@@ -69,23 +69,23 @@ exports.prettierCheck = {
69
69
  tempConfig = createTempPrettierConfig(ctx.cwd);
70
70
  args = [mode, ...targets, '--config', tempConfig, '--ignore-path', ignorePath];
71
71
  }
72
- const prettierBin = (0, utils_1.resolvePackageBin)('prettier', 'bin/prettier.cjs');
72
+ const prettierBin = (0, index_js_2.resolvePackageBin)('prettier', 'bin/prettier.cjs');
73
73
  try {
74
- const result = await (0, execa_1.execa)(process.execPath, [prettierBin, ...args], {
74
+ const result = await (0, execa_js_1.execa)(process.execPath, [prettierBin, ...args], {
75
75
  cwd: ctx.cwd,
76
76
  stdio: 'inherit',
77
77
  reject: false,
78
78
  });
79
79
  if (result.exitCode === 0)
80
- return (0, types_1.pass)();
80
+ return (0, types_js_1.pass)();
81
81
  // In --check mode a non-zero exit means "some files are not formatted".
82
- return (0, types_1.warn)(ctx.write ? 'prettier failed' : 'unformatted files (run with write to fix)');
82
+ return (0, types_js_1.warn)(ctx.write ? 'prettier failed' : 'unformatted files (run with write to fix)');
83
83
  }
84
84
  finally {
85
85
  if (tempIgnore)
86
- (0, utils_1.cleanupTempFile)(tempIgnore);
86
+ (0, index_js_2.cleanupTempFile)(tempIgnore);
87
87
  if (tempConfig)
88
- (0, utils_1.cleanupTempFile)(tempConfig);
88
+ (0, index_js_2.cleanupTempFile)(tempConfig);
89
89
  }
90
90
  },
91
91
  };
@@ -1,4 +1,4 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  /**
3
3
  * Formats changed Python files with Ruff's formatter (WASM, no Python/pip needed).
4
4
  * Read-only in check mode (`warn` when files differ from formatted output); rewrites
@@ -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 utils_1 = require("../../../utils");
10
- const targets_1 = require("../../targets");
11
- const types_1 = require("../../types");
12
- const ruff_shared_1 = require("./ruff-shared");
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, targets_1.resolveTargetFiles)(ctx, ruff_shared_1.PY_GLOBS);
27
+ const targets = await (0, targets_js_1.resolveTargetFiles)(ctx, ruff_shared_js_1.PY_GLOBS);
28
28
  if (targets === null)
29
- return (0, types_1.skip)('git unavailable');
29
+ return (0, types_js_1.skip)('git unavailable');
30
30
  if (targets.length === 0)
31
- return (0, types_1.pass)('no Python files changed');
32
- const workspace = (0, ruff_shared_1.createRuffWorkspace)();
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
- utils_1.logger.warn(`[Ruff Format]: ⚠️ Could not format ${rel} (syntax error?)\n${err}`);
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, types_1.pass)();
59
+ return (0, types_js_1.pass)();
60
60
  if (!ctx.write) {
61
- utils_1.logger.warn(`[Ruff Format]: ⚠️ ${unformatted} Python file(s) need formatting`);
62
- return (0, types_1.warn)(`${unformatted} file(s) need formatting (run with write to fix)`);
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
- utils_1.logger.info(`[Ruff Format]: ✅ Reformatted ${unformatted} Python file(s)`);
65
- return (0, types_1.pass)(`reformatted ${unformatted} file(s)`);
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
  };
@@ -1,4 +1,4 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  /**
3
3
  * Lints changed Python files with Ruff, bundled as a self-contained WASM module
4
4
  * (`@astral-sh/ruff-wasm-nodejs`) so it runs on a bare Node image with no Python
@@ -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 utils_1 = require("../../../utils");
10
- const targets_1 = require("../../targets");
11
- const types_1 = require("../../types");
12
- const ruff_shared_1 = require("./ruff-shared");
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, targets_1.resolveTargetFiles)(ctx, ruff_shared_1.PY_GLOBS);
29
+ const targets = await (0, targets_js_1.resolveTargetFiles)(ctx, ruff_shared_js_1.PY_GLOBS);
30
30
  if (targets === null)
31
- return (0, types_1.skip)('git unavailable');
31
+ return (0, types_js_1.skip)('git unavailable');
32
32
  if (targets.length === 0)
33
- return (0, types_1.pass)('no Python files changed');
34
- const workspace = (0, ruff_shared_1.createRuffWorkspace)();
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
- utils_1.logger.warn(`[Ruff Lint]: ⚠️ ${rel}: ${diagnostics.length} issue(s)`);
50
+ index_js_1.logger.warn(`[Ruff Lint]: ⚠️ ${rel}: ${diagnostics.length} issue(s)`);
51
51
  diagnostics
52
52
  .slice(0, 5)
53
- .forEach((d) => utils_1.logger.warn(` ${rel}:${d.start_location.row} ${d.code ?? '?'} ${d.message}`));
53
+ .forEach((d) => index_js_1.logger.warn(` ${rel}:${d.start_location.row} ${d.code ?? '?'} ${d.message}`));
54
54
  if (diagnostics.length > 5)
55
- utils_1.logger.warn(` ... and ${diagnostics.length - 5} more`);
55
+ index_js_1.logger.warn(` ... and ${diagnostics.length - 5} more`);
56
56
  }
57
57
  if (totalIssues === 0)
58
- return (0, types_1.pass)();
59
- return (0, types_1.warn)(`${totalIssues} issue(s) in ${filesWithIssues} file(s)`);
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
  };
@@ -1,4 +1,4 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  /**
3
3
  * Type-checks changed Python files — the Python analogue of `tsc --noEmit`.
4
4
  *