From: 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Tue, 9 Apr 2019 11:13:01 +0000 (+0900) Subject: Fix copyright checker (#4954) X-Git-Tag: accepted/tizen/unified/20190430.113441~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a7e407b441e85936f91da1d997113e8be697b5a;p=platform%2Fcore%2Fml%2Fnnfw.git Fix copyright checker (#4954) Rename copyright check script Change mode: remove execution and allow only source (by nnfw command) Exit with exit code when invalid result Signed-off-by: Hyeongseok Oh --- diff --git a/scripts/command/copyright-checker.sh b/scripts/command/copyright-check old mode 100755 new mode 100644 similarity index 91% rename from scripts/command/copyright-checker.sh rename to scripts/command/copyright-check index 9f2201f..9401e69 --- a/scripts/command/copyright-checker.sh +++ b/scripts/command/copyright-check @@ -1,5 +1,7 @@ #!/bin/bash +INVALID_EXIT=0 + check_copyright_year() { DIRECTORIES_NOT_TO_BE_TESTED=$2 YEAR=`date +"%Y"` @@ -30,8 +32,10 @@ check_copyright_year() { if [[ $COPYRIGHT_YEAR != $YEAR ]]; then [[ -z "$COPYRIGHT_YEAR" ]] && COPYRIGHT_YEAR="None" echo "Copyright year of $f is incorrect: expected $YEAR, found $COPYRIGHT_YEAR" + INVALID_EXIT=1 elif ! grep -q "$CORRECT_COPYRIGHT" $f; then echo "Copyright format of $f is incorrect: expected $CORRECT_COPYRIGHT" + INVALID_EXIT=1 fi done fi @@ -44,3 +48,8 @@ for DIR_NOT_TO_BE_TESTED in $(find -name '.FORMATDENY' -exec dirname {} \;); do done check_copyright_year $DIRECTORIES_NOT_TO_BE_TESTED + +if [[ $INVALID_EXIT -ne 0 ]]; then + echo "[FAILED] Invalid copyright check exit." + exit 1 +fi