feat: ship Wave 5-6 multi-surface hygiene, optimization, and bug fixes
This commit is contained in:
parent
01ef3293cf
commit
66b6b45ba9
399 changed files with 17828 additions and 11330 deletions
|
|
@ -3,7 +3,7 @@
|
|||
// 규칙을 늘릴 때는 이 파일 한 곳만 고치고, 두 스크립트의 --self-test 를 함께 확인한다.
|
||||
|
||||
import { execFileSync } from 'node:child_process'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
|
||||
/** test:hygiene 과 동일한 패턴 (의도적 동일 — 게이트 3개가 같은 파일을 보게 한다). */
|
||||
|
|
@ -22,10 +22,19 @@ export const AMBIENT_ALLOW =
|
|||
/(?:setSystemTime|useFakeTimers|advanceTimersByTime|advanceTimers|withMockedNow|randomSeed|mkdtemp|vi\.spyOn\()/
|
||||
|
||||
export function gitLsFiles(cwd = process.cwd()) {
|
||||
return execFileSync('git', ['ls-files'], { cwd, maxBuffer: 1 << 28, encoding: 'utf8' })
|
||||
.split('\n')
|
||||
.map((line) => line.trim().replaceAll('\\', '/'))
|
||||
.filter(Boolean)
|
||||
const raw = execFileSync(
|
||||
'git',
|
||||
['ls-files', '--cached', '--others', '--exclude-standard'],
|
||||
{ cwd, maxBuffer: 1 << 28, encoding: 'utf8' },
|
||||
)
|
||||
return [
|
||||
...new Set(
|
||||
raw
|
||||
.split('\n')
|
||||
.map((line) => line.trim().replaceAll('\\', '/'))
|
||||
.filter((rel) => Boolean(rel) && existsSync(join(cwd, rel))),
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
export function isTestFile(path) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue