scripts: checkpatch: Add title typo and doc count check

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic939b29436c8436c182e9b1f78dc2fc31116bca1
This commit is contained in:
Joseph Chen
2023-02-16 06:58:06 +00:00
parent deb0355cb8
commit 6c6cd5ef50

View File

@@ -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