2019-01-28 18:32:30 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Project nits enforced here
|
|
|
|
#
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
source ci/_
|
|
|
|
|
2019-02-09 09:13:35 -08:00
|
|
|
# Logging hygiene: Please don't print from --lib, use the `log` crate instead
|
2019-01-28 18:32:30 -08:00
|
|
|
declare prints=(
|
|
|
|
'print!'
|
|
|
|
'println!'
|
|
|
|
'eprint!'
|
|
|
|
'eprintln!'
|
|
|
|
)
|
|
|
|
|
2019-02-09 09:13:35 -08:00
|
|
|
if _ git grep "${prints[@]/#/-e }" src; then
|
2019-01-28 18:32:30 -08:00
|
|
|
exit 1
|
|
|
|
fi
|
2019-02-09 09:13:35 -08:00
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|