summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Maennich <maennich@google.com>2019-08-16 12:28:58 +0100
committerMatthias Maennich <maennich@google.com>2019-08-16 12:28:58 +0100
commit0bfeb096c75e1538415030e952ae7670b6a97c07 (patch)
tree252ad4336a025dcbaa36b23974df2a4519ddd21d
parentee7ef66e216041fa6d7e2f22ba8e8871a60d4f13 (diff)
checkpatch: skip analysis for merge commits on kernel/common
These are upstream merges that likely hit issues in checkpatch.pl or merges from other common kernel repositories where _this_ check has been run as part of the developement process. Change-Id: Ib489d57b74ffc128eec5f6bde253f139768e9445 Signed-off-by: Matthias Maennich <maennich@google.com>
-rwxr-xr-xstatic_analysis/checkpatch_presubmit.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/static_analysis/checkpatch_presubmit.sh b/static_analysis/checkpatch_presubmit.sh
index d057601..2f88085 100755
--- a/static_analysis/checkpatch_presubmit.sh
+++ b/static_analysis/checkpatch_presubmit.sh
@@ -86,5 +86,16 @@ if [[ -z ${GIT_SHA1} ]]; then
exit 0
fi
+# Skip checkpatch for merge commits on common kernels
+# These are upstream merges that likely hit issues in checkpatch.pl or merges
+# from other common kernel repositories where _this_ check has been run as part
+# of the developement process.
+if [ "${KERNEL_DIR}" == "common" ]; then
+ if [ $(git -C ${KERNEL_DIR} show --no-patch --format="%p" ${GIT_SHA1} | wc -w) -gt 1 ] ; then
+ echo "Merge commit detected for a ${KERNEL_DIR} kernel. Skipping this check."
+ exit 0
+ fi
+fi
+
${STATIC_ANALYSIS_SRC_DIR}/checkpatch.sh --git_sha1 ${GIT_SHA1} ${FORWARDED_ARGS[*]}