Skip to content

Commit

Permalink
add exclude-dir so that GNU grep matches BSD grep for go-math-rand-check
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarak Ben Youssef committed Jun 23, 2023
1 parent 0112864 commit e3447dc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,10 @@ go-math-rand-check:
# If this check fails, try updating your code by using:
# - "crypto/rand" or "flow-go/utils/rand" for non-deterministic randomness
# - "flow-go/crypto/random" for deterministic randomness
grep --include=\*.go --exclude={*test*,*helper*,*example*,*fixture*,*benchmark*,*profiler*} -rnw '"math/rand"'; \
if [ $$? -ne 1 ]; \
then \
echo "[Error] Go production code should not use math/rand package"; \
exit 1; \
grep --include=\*.go --exclude=*{test,helper,example,fixture,benchmark,profiler}* \
--exclude-dir=*{test,helper,example,fixture,benchmark,profiler}* -rnw '"math/rand"'; \
if [ $$? -ne 1 ]; then \
echo "[Error] Go production code should not use math/rand package"; exit 1; \
fi

.PHONY: code-sanity-check
Expand Down

0 comments on commit e3447dc

Please sign in to comment.