From 6c6cd5ef50b1386557c6b4481f760eb8d4ca30cf Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Thu, 16 Feb 2023 06:58:06 +0000 Subject: [PATCH] scripts: checkpatch: Add title typo and doc count check Signed-off-by: Joseph Chen Change-Id: Ic939b29436c8436c182e9b1f78dc2fc31116bca1 --- scripts/checkpatch.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/checkpatch.sh b/scripts/checkpatch.sh index 32e853a7..88302925 100755 --- a/scripts/checkpatch.sh +++ b/scripts/checkpatch.sh @@ -63,6 +63,17 @@ function check_doc() exit 1 fi + # check title + if grep -Eq '### NEW|### new' ${DIFF_DOC_ALL} ; then + echo "ERROR: ${DOC}: Please use '### New'" + exit 1 + fi + + if grep -Eq '### FIXED|### fixed' ${DIFF_DOC_ALL} ; then + echo "ERROR: ${DOC}: Please use '### Fixed'" + exit 1 + fi + # check TAB before index of 'New' body if grep -q $'\t[0-9]' ${DOC} ; then echo "ERROR: ${DOC}: Don't add TAB before index:" @@ -229,6 +240,12 @@ function check_docs() exit 1 fi + NUM=`git log ${ARG_COMMIT} -1 --name-only | sed -n "/\.md/p" | wc -l` + if [ ${NUM} -gt 2 ]; then + echo "ERROR: More than 2 release note are updated" + exit 1 + fi + if ! which dos2unix > /dev/null 2>&1 ; then echo "ERROR: No 'dos2unix'. Fix by: sudo apt-get install dos2unix" exit 1