Skip to content

Commit 03cc93f

Browse files
osjcnerzhul
authored andcommitted
Fix fake LINT check success (#8092)
The code 'if [ -z ${something} ]; then ... fi' means "if ${something} is an empty string, yell at the command line about 'binary operator expected' and ignore the body of the if statement, if ${something} is not an empty string, the condition is false so ignore the body of the if statement" which clearly isn't what the author wanted. Fix it by adding a few quotes around the offending ${something}.
1 parent a18c310 commit 03cc93f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util/travis/lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function perform_lint() {
2020
whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST")
2121

2222
# If file is not whitelisted, mark a failure
23-
if [ -z ${whitelisted} ]; then
23+
if [ -z "${whitelisted}" ]; then
2424
errorcount=$((errorcount+1))
2525

2626
printf "The file %s is not compliant with the coding style" "$f"

0 commit comments

Comments
 (0)