refactor: statusbar、companion、herdr 外掛改名加上 jsc- 前綴
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
f10b168c28
commit
58e2b2d26a
@@ -0,0 +1,16 @@
|
||||
// 辨識「驗證類」指令(測試、型別檢查、build),失敗後轉成功才值得角色反應
|
||||
const VERIFY: RegExp[] = [
|
||||
/^(?:bun|npm|pnpm|yarn)\s+(?:run\s+)?(?:test|build|typecheck|lint)\b/,
|
||||
/^(?:bun|npm|pnpm|yarn)\s+test\b/,
|
||||
/^(?:pytest|tsc|vitest|jest|mypy|ruff)\b/,
|
||||
/^cargo\s+(?:test|build|check)\b/,
|
||||
/^go\s+(?:test|build|vet)\b/,
|
||||
]
|
||||
|
||||
// 以 && ; | 拆開複合指令,任何一段是驗證指令就算
|
||||
export function isVerifyCommand(command: string): boolean {
|
||||
return command
|
||||
.split(/&&|\|\||;|\|/)
|
||||
.map(s => s.trim())
|
||||
.some(s => VERIFY.some(re => re.test(s)))
|
||||
}
|
||||
Reference in New Issue
Block a user