Skip to content

Commit 6161fec

Browse files
simbit18acassis
authored andcommitted
tools/checkpatch.sh: Improved error display on GitHub
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>
1 parent 858619e commit 6161fec

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

tools/checkpatch.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,17 @@ check_msg() {
297297

298298
while IFS= read -r REPLY; do
299299
if [[ $REPLY =~ ^Change-Id ]]; then
300-
echo "Remove Gerrit Change-ID's before submitting upstream"
300+
echo "Remove Gerrit Change-ID's before submitting upstream"
301301
fail=1
302302
fi
303303

304304
if [[ $REPLY =~ ^VELAPLATO ]]; then
305-
echo "Remove VELAPLATO before submitting upstream"
305+
echo "Remove VELAPLATO before submitting upstream"
306306
fail=1
307307
fi
308308

309309
if [[ $REPLY =~ ^[Ww][Ii][Pp]: ]]; then
310-
echo "Remove WIP before submitting upstream"
310+
echo "Remove WIP before submitting upstream"
311311
fail=1
312312
fi
313313

@@ -319,22 +319,22 @@ check_msg() {
319319
done <<< "$msg"
320320

321321
if ! [[ $first =~ : ]]; then
322-
echo "Commit subject missing colon (e.g. 'subsystem: msg')"
322+
echo "Commit subject missing colon (e.g. 'subsystem: msg')"
323323
fail=1
324324
fi
325325

326326
if (( ${#first} > $max_line_len )); then
327-
echo "Commit subject too long > $max_line_len"
327+
echo "Commit subject too long > $max_line_len"
328328
fail=1
329329
fi
330330

331331
if ! [ $signedoffby_found == 1 ]; then
332-
echo "Missing Signed-off-by"
332+
echo "Missing Signed-off-by"
333333
fail=1
334334
fi
335335

336336
if (( $num_lines < $min_num_lines && $signedoffby_found == 1 )); then
337-
echo "Missing git commit message"
337+
echo "Missing git commit message"
338338
fail=1
339339
fi
340340
}
@@ -409,12 +409,11 @@ for arg in $@; do
409409
$check $arg
410410
done
411411

412-
413412
if [ $fail == 1 ]; then
414413
echo "Some checks failed. For contributing guidelines, see:"
415414
echo " $COMMIT_URL"
416415
else
417-
echo "All checks pass."
416+
echo "✔️ All checks pass."
418417
fi
419418

420419
exit $fail

0 commit comments

Comments
 (0)