Skip to content

Commit

Permalink
Normalize exclude-rules paths for Windows (#2387)
Browse files Browse the repository at this point in the history
  • Loading branch information
arjenvanderende authored Aug 24, 2022
1 parent cbe6330 commit 890a826
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion pkg/result/processors/exclude_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 890a826

Please sign in to comment.