Skip to content

Commit e99d777

Browse files
Merge pull request #423 from thk123/bug/lint-lines-only-fix
Fix for lint failing when no linting errors
2 parents 4554f9d + 4120cdd commit e99d777

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/run_lint.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ then
1212
exit 1
1313
fi
1414

15+
if ! [[ -e scripts/cpplint.py ]]
16+
then
17+
echo "Lint script could not be found in the scripts directory"
18+
echo "Ensure cpplint.py is inside the scripts directory then run again"
19+
exit 1
20+
fi
21+
1522
git_start=$1
1623
git_end=$2
1724

@@ -74,7 +81,7 @@ for file in $diff_files; do
7481
# Run the linting script and filter by the filter we've build
7582
# of all the modified lines
7683
# The errors from the linter go to STDERR so must be redirected to STDOUT
77-
result=`python scripts/cpplint.py $file 2>&1 | grep -E "$lint_grep_filter"`
84+
result=`python scripts/cpplint.py $file 2>&1 | { grep -E "$lint_grep_filter" || true; }`
7885

7986
# Providing some errors were relevant we print them out
8087
if [ "$result" ]

0 commit comments

Comments
 (0)