From 06f8d2b7e5dc3cc6d9f41c23a6ebf456fd6cd6bb Mon Sep 17 00:00:00 2001 From: Mikael Falkvidd Date: Thu, 22 Mar 2018 08:26:27 +0100 Subject: [PATCH] Add detection of missing keywords to gitler (#1085) --- .ci/gitler.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.ci/gitler.sh b/.ci/gitler.sh index 5d815e6..9c5a78d 100755 --- a/.ci/gitler.sh +++ b/.ci/gitler.sh @@ -8,6 +8,7 @@ echo "No subjects are of invalid size
" > too_long_subjects.txt echo "No subjects with leading lower case characters
" > leading_lowercases.txt echo "No subjects with trailing periods
" > trailing_periods.txt echo "No body lines are too wide
" > too_long_body_lines.txt +echo "No keywords are missing in keywords.txt
" > missing_keywords.txt too_long_subjects=`awk 'length > 72' subjects.txt` if [ -n "$too_long_subjects" ]; then @@ -39,8 +40,17 @@ if [ -n "$too_long_body_lines" ]; then result=1 fi +missing_keywords=$(for keyword in $(grep -A999 '#if DOXYGEN' MyConfig.h | grep -B999 '#endif' | grep '#define' | awk '{ print $2 '} | grep -e '^MY_'); do grep -q $keyword keywords.txt || echo $keyword; done) +if [ -n "$missing_keywords" ]; then + echo "Keywords that are missing from keywords.txt:" > missing_keywords.txt + echo "$missing_keywords" >> missing_keywords.txt + sed -i -e 's/$/
/' missing_keywords.txt + result=1 +fi + + printf "%s" "" > gitler.html -awk 'FNR==1{print "
"}1' too_long_subjects.txt leading_lowercases.txt trailing_periods.txt too_long_body_lines.txt >> gitler.html +awk 'FNR==1{print "
"}1' too_long_subjects.txt leading_lowercases.txt trailing_periods.txt too_long_body_lines.txt missing_keywords.txt >> gitler.html echo "
" >> gitler.html if [ $result -ne 0 ]; then echo "You should follow this guide when writing your commit messages.
" >> gitler.html