scripts: checkpatch: Add end line check

End line should be blank line.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iec664ef610f07b80bd45c7f40405c43dd7f1ded3
This commit is contained in:
Joseph Chen
2023-04-12 01:20:46 +00:00
parent 61993dce60
commit 2c1affb8f7

View File

@@ -42,6 +42,7 @@ function check_doc()
COMMIT=`sed -n "/^+| 20[0-9][0-9]-/p" ${DIFF_DOC_ALL} | tr -d " " | awk -F "|" '{ print $4 }'`
SEVERITY=`sed -n "/^+| 20[0-9][0-9]-/p" ${DIFF_DOC_ALL} | tr -d " " | awk -F "|" '{ print $5 }'`
HORIZONTAL_LINE=`sed -n "/^+------$/p" ${DIFF_DOC_ALL}`
END_LINE=`tail -n 1 ${DIFF_DOC_ALL}`
# echo "### ${COMMIT}, ${SEVERITY}, ${TITLE}, ${FILE}"
# check blank line after Heading 1
@@ -167,6 +168,12 @@ function check_doc()
exit 1
fi
# check horizontal line
if [ "${END_LINE}" == "+------" ]; then
echo "ERROR: ${DOC}: No blank line after '------'"
exit 1
fi
# check 'Fixed' content
if grep -q "^+### Fixed" ${DIFF_DOC_ALL} ; then
awk -v RS='### Fixed' 'END{printf "%s", $0}' ${DIFF_DOC_ALL} > ${DIFF_DOC_FIXED}