-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
Skip no longer accepts partial paths #103
Comments
@endophage any thoughts on this? |
I believe this specific case will now require another @marstr by way of explanation, the Golang implementation of filepath globbing only matches @gcmurphy permitted me to modify the pathing to use simple globbing, but it does now require a full match. We could update this to assume if the first character isn't |
Your suggested fix of adding a wildcard to the beginning of the pattern is indeed what we did to fix this in our repository. For our repository, it happens to be irrelevant whether /*/ matches a single or multiple segments, but a single segment matches my expectations. Mostly, I wanted to make sure that folks here were aware that this had broken the paths in our continuous integration script by changing the effective requirement from |
@marstr the biggest thing the change fixed is that the existing pattern, I'll leave the decision up to @gcmurphy but I'm happy to do the change to prefix |
So what cases would it make sense? Would something like this work? func prependWildcard(pattern string) string {
char := string([]rune(pattern)[0])
indicators := `*./\`
if ! strings.ContainsAny(char, indicators) {
return "*" + pattern
}
return pattern
} If the logic gets too gnarly here it might be easier to focus on improving the documentation. |
Yeah, I thought about this over the weekend and docs might be simpler. Thinking back to my Python days, I was always a fan of "Explicit is better than implicit." |
Formerly,
-skip=baz/*/foo.go
would skip any file that ended with that pattern. More specifically, an absolute path of the form/home/travis/baz/bar/foo.go
would be skipped. However, after switching from path/filepath to GitHub.com/ryanuber/go-glob to resolve globs, the same file will be scanned. This change was made in commit 1a481fa.The text was updated successfully, but these errors were encountered: