@@ -9,6 +9,9 @@ echo "No subjects with leading lower case characters<br>" > leading_lowercases.t
9
9
echo " No subjects with trailing periods<br>" > trailing_periods.txt
10
10
echo " No body lines are too wide<br>" > too_long_body_lines.txt
11
11
echo " No keywords are missing in keywords.txt<br>" > missing_keywords.txt
12
+ echo " No keywords in code that don't exist in keywords.txt<br>" > missing_keywords_2.txt
13
+ echo " No keywords in code that don't have Doxygen comments and aren't blacklisted in keywords.txt<br>" > missing_keywords_3.txt
14
+ echo " No lines in keywords.txt using spaces instead of TAB (the Arduino IDE doesn't support space)<br>" > tab_spaces_keywords.txt
12
15
echo " No occurences of the deprecated boolean data type<br>" >> booleans.txt
13
16
14
17
too_long_subjects=` awk ' length > 72' subjects.txt`
@@ -49,6 +52,33 @@ if [ -n "$missing_keywords" ]; then
49
52
result=1
50
53
fi
51
54
55
+ missing_keywords_2=$( SOURCE_FILES=" core/ drivers/ hal/ examples/ examples_linux/ MyConfig.h MySensors.h" ; for keyword in $( grep -whore ' MY_[A-Z][A-Z_0-9]*' $SOURCE_FILES | sort -u ) ; do grep -q $keyword keywords.txt || echo $keyword ; done)
56
+ if [ -n " $missing_keywords_2 " ]; then
57
+ echo " <b>Keywords in code that don't exist in keywords.txt:</b>" > missing_keywords_2.txt
58
+ echo " If keywords aren't in keywords.txt, they will not be highlighted in the Arduino IDE. Highlighting makes the code easier to follow and helps spot spelling mistakes." > missing_keywords_2.txt
59
+ echo " $missing_keywords_2 " >> missing_keywords_2.txt
60
+ sed -i -e ' s/$/<br>/' missing_keywords_2.txt
61
+ result=1
62
+ fi
63
+
64
+ missing_keywords_3=$( SOURCE_FILES=" core/ drivers/ hal/ examples/ examples_linux/ MyConfig.h MySensors.h" ; for keyword in $( grep -whore ' MY_[A-Z][A-Z_0-9]*' $SOURCE_FILES | sort -u ) ; do grep -q $keyword keywords.txt || echo $keyword ; done)
65
+ if [ -n " $missing_keywords_3 " ]; then
66
+ echo " <b>Keywords in code that don't have Doxygen comments and aren't blacklisted in keywords.txt:</b>" > missing_keywords_3.txt
67
+ echo " If keywords don't have Doxygen comments, they will not be available at https://www.mysensors.org/apidocs/index.html Add Doxygen comments to make it easier for users to find and understand how to use the new keywords." > missing_keywords_3.txt
68
+ echo " $missing_keywords_3 " >> missing_keywords_3.txt
69
+ sed -i -e ' s/$/<br>/' missing_keywords_3.txt
70
+ result=1
71
+ fi
72
+
73
+
74
+ tab_spaces_keywords=$( grep -e ' [[:space:]]KEYWORD' -e ' [[:space:]]LITERAL1' keywords.txt | grep -v -e $' \t LITERAL1' -e $' \t KEYWORD' )
75
+ if [ -n " $tab_spaces_keywords " ]; then
76
+ echo " <b>Keywords that use space instead of TAB in keywords.txt:</b>" > tab_spaces_keywords.txt
77
+ echo " $tab_spaces_keywords " >> tab_spaces_keywords.txt
78
+ sed -i -e ' s/$/<br>/' tab_spaces_keywords.txt
79
+ result=1
80
+ fi
81
+
52
82
# Evaluate if there exists booleans in the code tree (not counting this file)
53
83
if git grep -q boolean -- ` git ls-files | grep -v butler.sh` ; then
54
84
echo " <b>You have added at least one occurence of the deprecated boolean data type. Please use bool instead.</b><br>" > booleans.txt
57
87
58
88
printf " %s" " <html>" > butler.html
59
89
echo " Greetings! Here is my evaluation of your pull request:<br>" >> butler.html
60
- awk ' FNR==1{print "<br>"}1' too_long_subjects.txt leading_lowercases.txt trailing_periods.txt too_long_body_lines.txt missing_keywords.txt booleans.txt >> butler.html
90
+ awk ' FNR==1{print "<br>"}1' too_long_subjects.txt leading_lowercases.txt trailing_periods.txt too_long_body_lines.txt missing_keywords.txt missing_keywords_2.txt missing_keywords_3.txt tab_spaces_keywords.txt booleans.txt >> butler.html
61
91
echo " <br>" >> butler.html
62
92
if [ $result -ne 0 ]; then
63
93
echo " <b>I am afraid there are some issues with your commit messages and/or use of keywords.</b><br>" >> butler.html
0 commit comments