Skip to content

Fix for lint failing when no linting errors #423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion scripts/run_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ then
exit 1
fi

if ! [[ -e scripts/cpplint.py ]]
then
echo "Lint script could not be found in the scripts directory"
echo "Ensure cpplint.py is inside the scripts directory then run again"
exit 1
fi

git_start=$1
git_end=$2

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

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