summaryrefslogtreecommitdiff
path: root/evergreen/run_clang_tidy.sh
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2021-07-29 15:28:20 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-08-02 23:52:53 +0000
commit27f328ad14b8fbc006c5c4103becd0f6a3aaaa5c (patch)
treedf483a3165f012efe9c395e4bae67aa8097fe1ab /evergreen/run_clang_tidy.sh
parenteae9041c1c1320a15a6b13f3f1d4770a2b96e085 (diff)
downloadmongo-27f328ad14b8fbc006c5c4103becd0f6a3aaaa5c.tar.gz
SERVER-57446 fix clang-tidy header issues and add header-filter
Diffstat (limited to 'evergreen/run_clang_tidy.sh')
-rwxr-xr-xevergreen/run_clang_tidy.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/evergreen/run_clang_tidy.sh b/evergreen/run_clang_tidy.sh
index abc0edc6190..07f3ec4067c 100755
--- a/evergreen/run_clang_tidy.sh
+++ b/evergreen/run_clang_tidy.sh
@@ -3,6 +3,9 @@ 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 \
@@ -10,5 +13,6 @@ jq -r '.[] | .file' compile_commands.json \
| xargs -n 32 -P $(grep -c ^processor /proc/cpuinfo) -t \
/opt/mongodbtoolchain/v3/bin/clang-tidy \
-p ./compile_commands.json \
+ -header-filter='(mongo/.*|build/.*)' \
--checks="-*,bugprone-unused-raii,bugprone-use-after-move,readability-const-return-type,readability-avoid-const-params-in-decls" \
-warnings-as-errors="*"