From 014e9c37fa0cc539bbc553e563df0cd1fbe9722e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 23 Mar 2020 23:27:25 -0500 Subject: [PATCH] added check on number of R CMD CHECK notes --- .ci/test_r_package.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh index 134d89d155c3..50c274128e84 100755 --- a/.ci/test_r_package.sh +++ b/.ci/test_r_package.sh @@ -91,4 +91,15 @@ if grep -q -R "WARNING" "$LOG_FILE_NAME"; then exit -1 fi +ALLOWED_CHECK_NOTES=3 +NUM_CHECK_NOTES=$( + cat ${LOG_FILE_NAME} \ + | grep -e '^Status: .* NOTE.*' \ + | sed 's/[^0-9]*//g' +) +if [[ ${NUM_CHECK_NOTES} -gt ${ALLOWED_CHECK_NOTES} ]]; then + echo "Found ${NUM_CHECK_NOTES} NOTEs from R CMD check. Only ${ALLOWED_CHECK_NOTES} are allowed" + exit -1 +fi + exit 0