diff --git a/ci/nits.sh b/ci/nits.sh new file mode 100755 index 0000000000..49c9aebbe0 --- /dev/null +++ b/ci/nits.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Project nits enforced here +# +set -e + +cd "$(dirname "$0")/.." +source ci/_ + +# please don't print from --lib... +declare prints=( + 'print!' + 'println!' + 'eprint!' + 'eprintln!' +) + +if _ git grep "${prints[@]/#/-e }" src +then + exit 1 +fi diff --git a/ci/test-checks.sh b/ci/test-checks.sh index d0e240ec4f..2f61ac18cb 100755 --- a/ci/test-checks.sh +++ b/ci/test-checks.sh @@ -13,6 +13,7 @@ _ cargo fmt --all -- --check _ cargo clippy --all -- --version _ cargo clippy --all -- --deny=warnings _ ci/audit.sh +_ ci/nits.sh || true # TODO: remove || true once all println!s are expunged _ book/build.sh echo --- ok