refactor: unwrap FileIgnore namespace + self-reexport (#22937)

This commit is contained in:
Kit Langton
2026-04-17 00:02:08 +00:00
committed by GitHub
parent 974fa1b8b1
commit 06d247c709
+9 -9
View File
@@ -1,7 +1,6 @@
import { Glob } from "@opencode-ai/shared/util/glob"
export namespace FileIgnore {
const FOLDERS = new Set([
const FOLDERS = new Set([
"node_modules",
"bower_components",
".pnpm-store",
@@ -30,9 +29,9 @@ export namespace FileIgnore {
"mypy_cache",
".history",
".gradle",
])
])
const FILES = [
const FILES = [
"**/*.swp",
"**/*.swo",
@@ -51,17 +50,17 @@ export namespace FileIgnore {
// Coverage/test outputs
"**/coverage/**",
"**/.nyc_output/**",
]
]
export const PATTERNS = [...FILES, ...FOLDERS]
export const PATTERNS = [...FILES, ...FOLDERS]
export function match(
export function match(
filepath: string,
opts?: {
extra?: string[]
whitelist?: string[]
},
) {
) {
for (const pattern of opts?.whitelist || []) {
if (Glob.match(pattern, filepath)) return false
}
@@ -77,5 +76,6 @@ export namespace FileIgnore {
}
return false
}
}
export * as FileIgnore from "./ignore"