summaryrefslogtreecommitdiffstats
path: root/scripts/checkstyle.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkstyle.sh')
-rw-r--r--scripts/checkstyle.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/checkstyle.sh b/scripts/checkstyle.sh
index 786e81cfe..4d3413c67 100644
--- a/scripts/checkstyle.sh
+++ b/scripts/checkstyle.sh
@@ -16,6 +16,7 @@
set -eEo pipefail
sudo apt-get install -y clang-format-12
+sudo pip3 install -U Commitizen
CLANG_FORMAT_VER_REGEX='([0-9]+)\.[0-9]+\.[0-9]+'
CLANG_FORMAT_DIFF="/usr/share/clang/clang-format-diff.py"
@@ -26,6 +27,16 @@ else
DIFF_TARGET="origin/${CHANGE_TARGET}...HEAD"
fi
+###############################################
+# Check commit mesage
+###############################################
+
+cz check --rev-range HEAD~1...HEAD
+
+###############################################
+# Check code style
+###############################################
+
CLANG_FORMAT_VER=${CLANG_FORMAT_VER:-12}
GIT_DIFF_ARGS="-U0 --no-color --relative ${DIFF_TARGET}"
CLANG_FORMAT_DIFF_ARGS="-style file -p1"