From 8a6bedb0cf2bd5aa7e5a1f858288873264334c4d Mon Sep 17 00:00:00 2001 From: Ricky Stewart Date: Tue, 5 Jul 2022 17:57:12 -0500 Subject: [PATCH] bazel: in `check.sh`, restrict `grep` to `pkg` You can optionally configure `git grep` to recurse into submodules, in which case this check returns false positives. Here we restrict the search to the `pkg` directory which is all we care about. Release note: None --- build/bazelutil/check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/bazelutil/check.sh b/build/bazelutil/check.sh index d881c6e76424..f446fb13f4d8 100755 --- a/build/bazelutil/check.sh +++ b/build/bazelutil/check.sh @@ -79,7 +79,7 @@ fi # We exclude stringer and add-leaktest.sh -- the former is already all # Bazelfied, and the latter can be safely ignored since we have a lint to check # the same thing: https://github.com/cockroachdb/cockroach/issues/64440 -git grep '//go:generate' -- './*.go' | grep -v stringer | grep -v 'add-leaktest\.sh' | while read LINE; do +git grep '//go:generate' 'pkg/**/*.go' | grep -v stringer | grep -v 'add-leaktest\.sh' | while read LINE; do if [[ "$EXISTING_GO_GENERATE_COMMENTS" == *"$LINE"* ]]; then # Grandfathered. continue