aocpu: add coding style check. [1/1]
PD#SWPL-36828
Problem:
add coding style check when commit.
Solution:
add detection relus to the .git/hooks/pre-commit file.
Verify:
build pass.
Change-Id: I88776ac691a69437812ff075ae286b6d8f9d3d5d
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
diff --git a/mk b/mk
index 3a46cef..d2ab382 100755
--- a/mk
+++ b/mk
@@ -12,5 +12,18 @@
fi
}
+function coding_style_check() {
+ if [ -d .git/hooks ]
+ then
+ if [ ! -f .git/hooks/pre-commit-old -a -f .git/hooks/pre-commit ]
+ then
+ cp .git/hooks/pre-commit .git/hooks/pre-commit-old
+ fi
+ cp scripts/amlogic/coding_style/pre-commit .git/hooks/
+ chmod +x .git/hooks/pre-commit
+ fi
+}
+
source scripts/amlogic/mk.sh $1
+coding_style_check
move_output_to_top_dir