fix(lint): name the home predicate for what it matches

main enabled anti-slop/no-shape-in-symbol-names (#20785) after this
branch was written. The predicate answers whether a path IS a home root,
not whether it resembles one.
This commit is contained in:
Neil
2026-09-15 03:02:45 -07:00
parent 29bd3fefc6
commit 097ccecde0
+3 -3
View File
@@ -92,10 +92,10 @@ function resolveGuardHomePath(home: WorktreeRemovalHomeAuthority, pathOps: PathO
}
function isLikelyPosixHomeDirectory(resolvedWorktreePath: string, pathOps: PathOps): boolean {
return pathOps === posix && isPosixHomeShape(resolvedWorktreePath)
return pathOps === posix && isPosixHomeRoot(resolvedWorktreePath)
}
function isPosixHomeShape(linuxPath: string): boolean {
function isPosixHomeRoot(linuxPath: string): boolean {
return (
linuxPath === '/home' ||
linuxPath === '/root' ||
@@ -138,7 +138,7 @@ function isLikelyWslDistroHomeDirectory(resolvedWorktreePath: string, pathOps: P
return false
}
const wsl = parseWslUncPath(resolvedWorktreePath)
return !!wsl && (wsl.linuxPath === '/' || isPosixHomeShape(trimTrailingSlash(wsl.linuxPath)))
return !!wsl && (wsl.linuxPath === '/' || isPosixHomeRoot(trimTrailingSlash(wsl.linuxPath)))
}
function isWslUncRemovalPath(resolvedWorktreePath: string): boolean {