Fix up vndr tooling#42634
Merged
Merged
Conversation
- Fix the error message in hack/validate/vendor to specify that hack/vendor.sh should be run instead of vndr. - Fix hack/vendor.sh to also match on Windows paths for the whitelist. This allows the script to be run on Windows via Git Bash. Signed-off-by: Kevin Parsons <[email protected]>
Contributor
Author
|
@thaJeztah FYI |
thaJeztah
approved these changes
Jul 13, 2021
thaJeztah
left a comment
Member
There was a problem hiding this comment.
LGTM
Thanks! (I was trying to get some not-yet-contributors on my team to open a PR for changing the message) 😂
|
|
||
| if [ $# -eq 0 ] || [ "$1" != "archive/tar" ]; then | ||
| vndr -whitelist=^archive/tar "$@" | ||
| vndr -whitelist='^archive[/\\]tar' "$@" |
Member
There was a problem hiding this comment.
Interesting; it's not matching on package name but on directory? (I assume this was failing on Windows?)
Contributor
Author
There was a problem hiding this comment.
Yeah, it looks like it's using the whitelist in two places:
filepath.Walkfed into checking the whitelist: https://github.com/LK4D4/vndr/blob/master/clean.go#L84-L98ioutil.ReadDirfed into checking the whitelist: https://github.com/LK4D4/vndr/blob/master/clean.go#L142-L154
So sadly not a package path :(
Member
|
@tianon ptal |
AkihiroSuda
approved these changes
Jul 14, 2021
tianon
approved these changes
Jul 14, 2021
tianon
left a comment
Member
There was a problem hiding this comment.
LGTM
This allows the script to be run on Windows via Git Bash.
This warms my soul ❤️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hack/vendor.sh should be run instead of vndr.
This allows the script to be run on Windows via Git Bash.
Signed-off-by: Kevin Parsons [email protected]