refactor(processor): inject cfg into file-mutating methods

This commit is contained in:
2026-07-02 09:20:06 -05:00
parent 27681bc56a
commit 9e9b292a6f
3 changed files with 29 additions and 25 deletions
+4 -4
View File
@@ -62,7 +62,7 @@ func (i *Ignore) loadFromFileWithSource(path string, source string) error {
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := strings.TrimSpace(scanner.Text())
if line == "" || strings.HasPrefix(line, "#") {
continue
}
@@ -100,7 +100,7 @@ func (i *Ignore) addPatternWithSource(patternStr string, source string) {
func (i *Ignore) IsIgnored(filePath string) bool {
relPath := filepath.Clean(filePath)
if strings.HasPrefix(relPath, "./") {
relPath = relPath[2:]
}
@@ -152,9 +152,9 @@ func (i *Ignore) globMatch(pattern, path string) bool {
}
func (i *Ignore) wildcardMatch(pattern, path string) bool {
parts := strings.Split(pattern, "*")
if len(parts) == 1 {
return pattern == path
}