refactor(processor): inject cfg into file-mutating methods
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user