@@ -89,6 +89,19 @@ export -f check_command
8989check_command sed ;
9090check_command grep ;
9191check_command cut ;
92+ check_command go ;
93+ # WORKAROUND: this is technical debt and will need cleaned up in the future.
94+ if command -v checkmake > /dev/null 2>&1 ; then
95+ check_command checkmake # it worked
96+ else
97+ check_command xargs ;
98+ check_command find ;
99+ printf " %s\n" " ::notice file=${SCRIPT_FILE} ,line=${BASH_LINENO:- 0} ,title=WORKAROUND::checkmake not found in expected location, trying workaround." ;
100+ find . -type f -iname " checkmake" 2> /dev/null ;
101+ find " /usr/local/bin" -type f -iname " checkmake" 2> /dev/null ;
102+ wait ;
103+ fi
104+
92105check_command checkmake ;
93106
94107# USAGE:
@@ -121,19 +134,21 @@ process_checkmake_output() {
121134 local emsg=" $2 "
122135
123136 if ! output=$( checkmake " ${file} " 2>&1 ) ; then
124- printf " %s\n" " ::error::checkmake failed: ${output} " >&2
125- return 1
126- fi
137+ printf " %s\n" " ::error::checkmake failed!"
127138
128- printf " %s\n" " ${output} " | \
129- sed -e ' s/ /:/g' | \
130- tr -s ' :' | \
131- cut -d: -f 3-5 | \
132- grep -F " ${file} " | \
133- sed -E -e ' s/^[[:space:]]+//g' | \
134- while IFS= read -r line; do
135- printf " %s\n" " ::warning file=${file} ,title=LINT::${line} ${emsg} " >&2
136- done
139+ printf " %s\n" " ${output} " | \
140+ sed -e ' s/ /:/g' | \
141+ tr -s ' :' | \
142+ cut -d: -f 3-5 | \
143+ grep -F " ${file} " | \
144+ sed -E -e ' s/^[[:space:]]+//g' | \
145+ while IFS= read -r line; do
146+ printf " %s\n" " ::warning file=${file} ,title=LINT::${line} : ${emsg} " >&2
147+ done
148+ return 1
149+ else
150+ printf " %s\n" " ::notice file=${file} ,title=LINT::OK - No lint errors." >&2
151+ fi ;
137152}
138153
139154process_checkmake_output " ${FILE} " " ${EMSG} "
0 commit comments