Normalize exclude-rules paths for Windows (#2387)
This commit is contained in:
parent
cbe63309a1
commit
890a82659b
@ -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:
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user