summaryrefslogtreecommitdiff
path: root/evergreen/run_clang_tidy.sh
blob: 03e312e12ae783bc2b2ba64ce10a6ec36400ef4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
set -o errexit
set -o verbose

cd src
# TODO SERVER-49884 Remove this when we no longer check in generated Bison.
# Here we use the -header-filter option to instruct clang-tidy to scan our header files. The
# regex instructs clang-tidy to scan headers in our source directory with the mongo/* regex, and
# the build directory to analyze generated headers with the build/* regex
BISON_GENERATED_PATTERN=parser_gen\.cpp
jq -r '.[] | .file' compile_commands.json \
  | grep src/mongo \
  | grep -v $BISON_GENERATED_PATTERN \
  | xargs -n 32 -P $(grep -c ^processor /proc/cpuinfo) -t \
    /opt/mongodbtoolchain/v3/bin/clang-tidy \
    -p ./compile_commands.json