From e46053b93e4c1ad4aeb48c98ac8687105cb339f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=95=85=E7=92=83?= Date: Wed, 29 Jul 2026 17:54:54 +0800 Subject: [PATCH] fix(tooling): stop interpolating filenames into staged check Passing staged filenames per-file puts repository paths into the argv of the vp check node process. When an endpoint security agent matches process argv by substring, the whole process is SIGKILLed and pre-commit can never finish. Use the function form so the command runs without filenames: one whole-repo check, wider coverage than per-file, and independent of any path. --- vite.config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index cb7b7ac..f486f06 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -36,7 +36,11 @@ export default defineConfig({ hookTimeout: 60_000, }, staged: { - "*.{js,mjs,cjs,ts,mts,cts,jsx,tsx,json,yaml,yml,md}": "vp check --fix", + // 用函数形式返回命令:不把匹配到的文件名插值进 argv,改为跑一次全量检查。 + // 逐文件传参会让 `vp check` 的 node 进程 argv 携带仓库内的文件名, + // 命中终端安全软件按 argv 子串匹配的进程管控规则时整个进程被 SIGKILL, + // 导致 pre-commit 无法完成。全量检查覆盖面更广,也不依赖文件名。 + "*.{js,mjs,cjs,ts,mts,cts,jsx,tsx,json,yaml,yml,md}": () => "vp check --fix", }, lint: { options: { typeAware: true, typeCheck: true },