-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalize exclude-rules paths for Windows #2387
Conversation
Hey, thank you for opening your first Pull Request ! |
I blocked this PR because I think it will create regressions and side effects. |
@ldez Can you elaborate on what you think this will break? As a Windows user, it looks correct to me, but I'd like to see if there's anything specific that you think should be tested. This code is already used for |
When a PR is blocked, put an approved without any comment is weird.
OK, got it.
sounds safe and valid. Also, package main
import (
"regexp"
"strings"
)
func main() {
path := '\\'
separatorToReplace := regexp.QuoteMeta(string(path))
file := "some/.*/file.go"
file = strings.ReplaceAll(file, "/", separatorToReplace)
re := regexp.MustCompile(file)
if !re.MatchString("some\\path\\to\\file.go") {
panic("wrong")
}
} on Windows I see paths in format So, I think there are no risks, but it will be great if some windows-specific tests will be added here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The following PR will fix the CI for Windows #3134
Minor change to normalize the paths in
exclude-rules
. This re-uses the same logic that is already in place forskip-dirs
.Fixes #1398