osrm-backend/scripts/tidy.sh

23 lines
523 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
2016-10-18 17:05:20 -04:00
set -o errexit
set -o pipefail
set -o nounset
# Runs the Clang Tidy Tool in parallel on the code base.
# Requires a compilation database in the build directory.
# This works on both OSX and Linux, it's a POSIX thingy
NPROC=$(getconf _NPROCESSORS_ONLN)
2016-01-19 08:28:09 -05:00
find src include unit_tests -type f -name '*.hpp' -o -name '*.cpp' -print0 \
2016-01-19 08:28:09 -05:00
| xargs \
-0 \
2016-01-19 08:28:09 -05:00
-I{} \
-n 1 \
./clang+llvm-3.9.0-x86_64-apple-darwin/bin/clang-tidy \
2016-01-19 08:28:09 -05:00
-p build \
-header-filter='.*' \
{}