summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>2019-04-09 11:13:01 (GMT)
committer이성재/On-Device Lab(SR)/Principal Engineer/삼성전자 <sj925.lee@samsung.com>2019-04-09 11:13:01 (GMT)
commit1a7e407b441e85936f91da1d997113e8be697b5a (patch)
treecb4baf39da6df24b9fe6a31ed8a92832fc7fe49f
parent903951a9fcee73251185df2e734c1a63dda1d1d0 (diff)
downloadnnfw-1a7e407b441e85936f91da1d997113e8be697b5a.zip
nnfw-1a7e407b441e85936f91da1d997113e8be697b5a.tar.gz
nnfw-1a7e407b441e85936f91da1d997113e8be697b5a.tar.bz2
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 <hseok82.oh@samsung.com>
-rw-r--r--[-rwxr-xr-x]scripts/command/copyright-check (renamed from scripts/command/copyright-checker.sh)9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/command/copyright-checker.sh b/scripts/command/copyright-check
index 9f2201f..9401e69 100755..100644
--- 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