From d2562fb0cb2c2b21b628b265ef24a6c8cbac9608 Mon Sep 17 00:00:00 2001 From: Maxim Uvarov Date: Tue, 16 May 2017 16:09:27 +0300 Subject: travis: move code style check to separate job Move this check to separate job to better see which exactly task was failed. Signed-off-by: Maxim Uvarov Reviewed-by: Bill Fischofer --- scripts/ci-checkpatches.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/ci-checkpatches.sh (limited to 'scripts') diff --git a/scripts/ci-checkpatches.sh b/scripts/ci-checkpatches.sh new file mode 100755 index 000000000..cb1c4e65d --- /dev/null +++ b/scripts/ci-checkpatches.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +PATCHES=$1 +echo "Run checkpatch for ${PATCHES}" +# Generate patches provided with $1. +# In case of force push and range is broken +# validate only the latest commit if it's not merge commit. +git format-patch ${PATCHES} +if [ $? -ne 0 ]; then + git show --summary HEAD| grep -q '^Merge:'; + if [ $? -ne 0 ]; then + git format-patch HEAD^; + perl ./scripts/checkpatch.pl *.patch; + fi; +else + perl ./scripts/checkpatch.pl *.patch; +fi -- cgit v1.2.3