From 407510a02e6a81fdcfa71a240539aeb03702e13f Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Fri, 28 Oct 2022 02:56:04 +0000 Subject: [PATCH] scripts: checkpatch: Add blank line check for Heading 1 Signed-off-by: Joseph Chen Change-Id: I240ce2f1ddcd32ed2053632fe451eba647a2c2c4 --- scripts/checkpatch.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/checkpatch.sh b/scripts/checkpatch.sh index 1594869b..52867c86 100755 --- a/scripts/checkpatch.sh +++ b/scripts/checkpatch.sh @@ -42,6 +42,13 @@ function check_doc() HORIZONTAL_LINE=`sed -n "/^+------$/p" ${DIFF_DOC_ALL}` # echo "### ${COMMIT}, ${SEVERITY}, ${TITLE}, ${FILE}" + # check blank line after Heading 1 + HEADING_1=`sed -n '1p' ${DOC}` + if sed -n '2p' ${DOC} | grep -q [a-z,A-Z] ; then + echo "ERROR: ${DOC}: Should reserve blank line after '${HEADING_1}'" + exit 1 + fi + # check space if sed -n "/##/p" ${DOC} | grep -v '## [a-z,A-Z]' ; then echo "ERROR: ${DOC}: Should only 1 space between '#' and word"