From 2d300a6d27f7744c45d2de054774433633b9c19b Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Dec 2022 06:42:45 +0000 Subject: [PATCH] scripts: checkpatch: check space after index of 'New' body Signed-off-by: Joseph Chen Change-Id: I1fad7176e43681ca9fd70a64bd7126ccafc10158 --- scripts/checkpatch.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.sh b/scripts/checkpatch.sh index da4d16ff..baae9b05 100755 --- a/scripts/checkpatch.sh +++ b/scripts/checkpatch.sh @@ -68,6 +68,15 @@ function check_doc() exit 1 fi + # check space after index of 'New' body + SUM1=`grep '^[0-9]\.' ${DOC} | wc -l` + SUM2=`grep '^[0-9]\.[[:blank:]]' ${DOC} | wc -l` + if [ "$SUM1" != "$SUM2" ]; then + echo "ERROR: ${DOC}: Please add space after index (e.g: '1. ' but not '1.'):" + grep '^+[0-9]\.' ${DIFF_DOC_ALL} + exit 1 + fi + # check standalone file if ! echo ${FILE} | grep -Eq '\.bin|\.elf|\.img' ; then echo "ERROR: ${DOC}: '${FILE}' missing the file format suffix" @@ -91,7 +100,7 @@ function check_doc() for LIST in ${COMMIT}; do CMT=`echo ${LIST} | cut -d : -f 2` if ! git log ${ARG_COMMIT} -1 | grep -q ${CMT} ; then - echo "ERROR: ${DOC}: '${CMT}' is not match in ARG_COMMIT message" + echo "ERROR: ${DOC}: '${CMT}' is not match in commit message" exit 1 fi