You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helm/pkg/lint/rules/isignored.go

28 lines
657 B

package rules
import (
"path/filepath"
"strings"
"fmt"
)
type LintResult struct {
Messages []string
}
func IsIgnored(errorMessage string, patterns map[string][]string) bool {
for path, pathPatterns := range patterns {
cleanedPath := filepath.Clean(path)
if strings.Contains(errorMessage, cleanedPath) {
for _, pattern := range pathPatterns {
if strings.Contains(errorMessage, pattern) {
fmt.Printf("Ignoring error related to path: %s with pattern: %s\n", path, pattern)
return true
}
}
}
}
return false
}