Skip to content

Commit

Permalink
Merge pull request #128 from mapbox/robustify-clang-tidy-script
Browse files Browse the repository at this point in the history
Improve the clang-tidy script
  • Loading branch information
springmeyer authored May 1, 2018
2 parents 770f594 + fe692a0 commit 2883650
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/clang-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ if [[ ! -f build/compile_commands.json ]]; then
mkdir -p build
# Run make, pipe the output to the generate_compile_commands.py
# and drop them in a place that clang-tidy will automatically find them
make | scripts/generate_compile_commands.py > build/compile_commands.json
RESULT=0
make | tee /tmp/make-node-cpp-skel-build-output.txt || RESULT=$?
if [[ ${RESULT} != 0 ]]; then
echo "Build failed, could not generate compile commands for clang-tidy, aborting!"
exit ${RESULT}
else
cat /tmp/make-node-cpp-skel-build-output.txt | scripts/generate_compile_commands.py > build/compile_commands.json
fi

fi

# change into the build directory so that clang-tidy can find the files
Expand Down

0 comments on commit 2883650

Please sign in to comment.