From c02625f91a26c060d38487d09c4be1c9510b2728 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sat, 9 Feb 2019 09:13:35 -0800 Subject: [PATCH] Ban Default::default() --- ci/nits.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ci/nits.sh b/ci/nits.sh index 49c9aebbe0..12b58f6665 100755 --- a/ci/nits.sh +++ b/ci/nits.sh @@ -7,7 +7,7 @@ set -e cd "$(dirname "$0")/.." source ci/_ -# please don't print from --lib... +# Logging hygiene: Please don't print from --lib, use the `log` crate instead declare prints=( 'print!' 'println!' @@ -15,7 +15,16 @@ declare prints=( 'eprintln!' ) -if _ git grep "${prints[@]/#/-e }" src -then +if _ git grep "${prints[@]/#/-e }" src; then exit 1 fi + + +# Code readability: please be explicit about the type instead of using +# Default::default() +# +# Ref: https://github.com/solana-labs/solana/issues/2630 +if _ git grep 'Default::default()' -- '*.rs'; then + exit 1 +fi +