Skip to content

Commit e46053b

Browse files
committed
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.
1 parent 30fe818 commit e46053b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

vite.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ export default defineConfig({
3636
hookTimeout: 60_000,
3737
},
3838
staged: {
39-
"*.{js,mjs,cjs,ts,mts,cts,jsx,tsx,json,yaml,yml,md}": "vp check --fix",
39+
// 用函数形式返回命令:不把匹配到的文件名插值进 argv,改为跑一次全量检查。
40+
// 逐文件传参会让 `vp check` 的 node 进程 argv 携带仓库内的文件名,
41+
// 命中终端安全软件按 argv 子串匹配的进程管控规则时整个进程被 SIGKILL,
42+
// 导致 pre-commit 无法完成。全量检查覆盖面更广,也不依赖文件名。
43+
"*.{js,mjs,cjs,ts,mts,cts,jsx,tsx,json,yaml,yml,md}": () => "vp check --fix",
4044
},
4145
lint: {
4246
options: { typeAware: true, typeCheck: true },

0 commit comments

Comments
 (0)