mirror of
https://github.com/apache/nuttx.git
synced 2025-12-06 09:01:15 +08:00
tools/checkpatch.sh: Improved error display on GitHub
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Some checks failed
Build Documentation / build-html (push) Has been cancelled
The improvement includes symbols that help employees visualise any errors detected during the PR check phase (check.yml). Error -> ❌ U+274C Cross Mark https://en.wikipedia.org/wiki/X_mark Checks pass -> ✔️ U+2714 Heavy Check Mark https://en.wikipedia.org/wiki/Check_mark These characters are emojis that are recognized by the Unicode standards which define what each character represents. Signed-off-by: simbit18 <simbit18@gmail.com>
This commit is contained in:
@@ -297,17 +297,17 @@ check_msg() {
|
||||
|
||||
while IFS= read -r REPLY; do
|
||||
if [[ $REPLY =~ ^Change-Id ]]; then
|
||||
echo "Remove Gerrit Change-ID's before submitting upstream"
|
||||
echo "❌ Remove Gerrit Change-ID's before submitting upstream"
|
||||
fail=1
|
||||
fi
|
||||
|
||||
if [[ $REPLY =~ ^VELAPLATO ]]; then
|
||||
echo "Remove VELAPLATO before submitting upstream"
|
||||
echo "❌ Remove VELAPLATO before submitting upstream"
|
||||
fail=1
|
||||
fi
|
||||
|
||||
if [[ $REPLY =~ ^[Ww][Ii][Pp]: ]]; then
|
||||
echo "Remove WIP before submitting upstream"
|
||||
echo "❌ Remove WIP before submitting upstream"
|
||||
fail=1
|
||||
fi
|
||||
|
||||
@@ -319,22 +319,22 @@ check_msg() {
|
||||
done <<< "$msg"
|
||||
|
||||
if ! [[ $first =~ : ]]; then
|
||||
echo "Commit subject missing colon (e.g. 'subsystem: msg')"
|
||||
echo "❌ Commit subject missing colon (e.g. 'subsystem: msg')"
|
||||
fail=1
|
||||
fi
|
||||
|
||||
if (( ${#first} > $max_line_len )); then
|
||||
echo "Commit subject too long > $max_line_len"
|
||||
echo "❌ Commit subject too long > $max_line_len"
|
||||
fail=1
|
||||
fi
|
||||
|
||||
if ! [ $signedoffby_found == 1 ]; then
|
||||
echo "Missing Signed-off-by"
|
||||
echo "❌ Missing Signed-off-by"
|
||||
fail=1
|
||||
fi
|
||||
|
||||
if (( $num_lines < $min_num_lines && $signedoffby_found == 1 )); then
|
||||
echo "Missing git commit message"
|
||||
echo "❌ Missing git commit message"
|
||||
fail=1
|
||||
fi
|
||||
}
|
||||
@@ -409,12 +409,11 @@ for arg in $@; do
|
||||
$check $arg
|
||||
done
|
||||
|
||||
|
||||
if [ $fail == 1 ]; then
|
||||
echo "Some checks failed. For contributing guidelines, see:"
|
||||
echo " $COMMIT_URL"
|
||||
else
|
||||
echo "All checks pass."
|
||||
echo "✔️ All checks pass."
|
||||
fi
|
||||
|
||||
exit $fail
|
||||
|
||||
Reference in New Issue
Block a user