Skip to content

Commit 06f8d2b

Browse files
authored
Add detection of missing keywords to gitler (#1085)
1 parent c9c4618 commit 06f8d2b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.ci/gitler.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ echo "No subjects are of invalid size<br>" > too_long_subjects.txt
88
echo "No subjects with leading lower case characters<br>" > leading_lowercases.txt
99
echo "No subjects with trailing periods<br>" > trailing_periods.txt
1010
echo "No body lines are too wide<br>" > too_long_body_lines.txt
11+
echo "No keywords are missing in keywords.txt<br>" > missing_keywords.txt
1112

1213
too_long_subjects=`awk 'length > 72' subjects.txt`
1314
if [ -n "$too_long_subjects" ]; then
@@ -39,8 +40,17 @@ if [ -n "$too_long_body_lines" ]; then
3940
result=1
4041
fi
4142

43+
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)
44+
if [ -n "$missing_keywords" ]; then
45+
echo "<b>Keywords that are missing from keywords.txt:</b>" > missing_keywords.txt
46+
echo "$missing_keywords" >> missing_keywords.txt
47+
sed -i -e 's/$/<br>/' missing_keywords.txt
48+
result=1
49+
fi
50+
51+
4252
printf "%s" "<html>" > gitler.html
43-
awk 'FNR==1{print "<br>"}1' too_long_subjects.txt leading_lowercases.txt trailing_periods.txt too_long_body_lines.txt >> gitler.html
53+
awk 'FNR==1{print "<br>"}1' too_long_subjects.txt leading_lowercases.txt trailing_periods.txt too_long_body_lines.txt missing_keywords.txt >> gitler.html
4454
echo "<br>" >> gitler.html
4555
if [ $result -ne 0 ]; then
4656
echo "You should follow <a href="http://chris.beams.io/posts/git-commit">this guide</a> when writing your commit messages.<br>" >> gitler.html

0 commit comments

Comments
 (0)