Skip to content

Commit

Permalink
Fix fake LINT check success (#8092)
Browse files Browse the repository at this point in the history
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}.
  • Loading branch information
osjc authored and nerzhul committed Jan 12, 2019
1 parent a18c310 commit 03cc93f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/travis/lint.sh
Expand Up @@ -20,7 +20,7 @@ function perform_lint() {
whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST")

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

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

0 comments on commit 03cc93f

Please sign in to comment.