Skip to content
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

vet: disallow importing "unsafe" #2024

Merged
merged 2 commits into from
Apr 26, 2018
Merged

vet: disallow importing "unsafe" #2024

merged 2 commits into from
Apr 26, 2018

Conversation

menghanl
Copy link
Contributor

@menghanl menghanl commented Apr 25, 2018

vet.sh Outdated
@@ -49,6 +49,7 @@ if git status --porcelain | read; then
fi

git ls-files "*.go" | xargs grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" 2>&1 | tee /dev/stderr | (! read)
git ls-files "*.go" | xargs grep -l "\"unsafe\"" 2>&1 | grep -v 'primitives_test.go' | tee /dev/stderr | (! read)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: maybe "_test.go"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

The exit status is 1 if no match was found.
vet.sh Outdated
@@ -49,7 +49,7 @@ if git status --porcelain | read; then
fi

git ls-files "*.go" | xargs grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" 2>&1 | tee /dev/stderr | (! read)
git ls-files "*.go" | xargs grep -l "\"unsafe\"" 2>&1 | grep -v '_test.go' | tee /dev/stderr | (! read)
git ls-files "*.go" | xargs grep -l "\"unsafe\"" 2>&1 | (! grep -v '_test.go') | tee /dev/stderr | (! read)
Copy link
Member

@dfawley dfawley Apr 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the exit status is being checked, I think you can remove the | tee /dev/stderr | (! read).

EDIT: Same with above?

@menghanl menghanl merged commit 66090d9 into grpc:master Apr 26, 2018
@menghanl menghanl deleted the safer branch April 26, 2018 21:24
@lock lock bot locked as resolved and limited conversation to collaborators Oct 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants