diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 2baf9f7f67e7..1003fc111626 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -2133,6 +2133,7 @@ issues: # Exclude known linters from partially hard-vendored code, # which is impossible to exclude via `nolint` comments. + # `/` will be replaced by current OS file path separator to properly work on Windows. - path: internal/hmac/ text: "weak cryptographic primitive" linters: diff --git a/pkg/result/processors/exclude_rules.go b/pkg/result/processors/exclude_rules.go index d4d6569f4ce3..e9f474b98c54 100644 --- a/pkg/result/processors/exclude_rules.go +++ b/pkg/result/processors/exclude_rules.go @@ -44,7 +44,8 @@ func createRules(rules []ExcludeRule, prefix string) []excludeRule { parsedRule.source = regexp.MustCompile(prefix + rule.Source) } if rule.Path != "" { - parsedRule.path = regexp.MustCompile(rule.Path) + path := normalizePathInRegex(rule.Path) + parsedRule.path = regexp.MustCompile(path) } parsedRules = append(parsedRules, parsedRule) }