72b365b6
refactor(ignore): use slices.Contains and strings.SplitSeq
a73x 2026-04-29 05:53
diff --git a/internal/ignore/ignore.go b/internal/ignore/ignore.go index 31d0bf5..fd560c8 100644 --- a/internal/ignore/ignore.go +++ b/internal/ignore/ignore.go @@ -3,6 +3,7 @@ package ignore import ( "os" "path/filepath" "slices" "strings" "sync" @@ -51,12 +52,9 @@ func (m *Matcher) ShouldIgnore(path string) bool { if err != nil || strings.HasPrefix(rel, "..") { return true } parts := strings.Split(rel, string(filepath.Separator)) for _, p := range parts { for _, ex := range hardExcludeDirs { if p == ex { return true } for p := range strings.SplitSeq(rel, string(filepath.Separator)) { if slices.Contains(hardExcludeDirs, p) { return true } } base := filepath.Base(rel)