Skip to content

Commit

Permalink
Update clang-tidy configuration and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Mar 11, 2020
1 parent 7908b20 commit 8546d60
Show file tree
Hide file tree
Showing 3 changed files with 267 additions and 218 deletions.
7 changes: 4 additions & 3 deletions .clang-tidy
@@ -1,4 +1,5 @@
Checks: '-*,modernize-use-emplace,modernize-use-default-member-init,modernize-use-equals-delete,modernize-use-equals-default,modernize-return-braced-init-list,modernize-loop-convert,modernize-avoid-bind,misc-throw-by-value-catch-by-reference,misc-string-compare,misc-inefficient-algorithm,misc-inaccurate-erase,misc-incorrect-roundings,misc-unconventional-assign-operator,bugprone-suspicious-memset-usage,performance-*'
Checks: '-*,modernize-use-emplace,modernize-avoid-bind,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,performance-*'
WarningsAsErrors: '-*,modernize-use-emplace,performance-type-promotion-in-math-fn,performance-faster-string-find,performance-implicit-cast-in-loop'
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: True
- key: performance-unnecessary-value-param.AllowedTypes
value: v[23]f;v[23][su](16|32)
12 changes: 5 additions & 7 deletions util/travis/clangtidy.sh
Expand Up @@ -7,8 +7,6 @@ if [ -z "${CLANG_TIDY}" ]; then
CLANG_TIDY=clang-tidy
fi

files_to_analyze="$(find src/ -name '*.cpp' -or -name '*.h')"

mkdir -p cmakebuild && cd cmakebuild
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
Expand All @@ -20,11 +18,11 @@ make GenerateVersion
cd ..

echo "Performing clang-tidy checks..."
./util/travis/run-clang-tidy.py -clang-tidy-binary=${CLANG_TIDY} -p cmakebuild \
-checks='-*,modernize-use-emplace,modernize-avoid-bind,performance-*' \
-warningsaserrors='-*,modernize-use-emplace,performance-type-promotion-in-math-fn,performance-faster-string-find,performance-implicit-cast-in-loop' \
-no-command-on-stdout -quiet \
files 'src/.*'
./util/travis/run-clang-tidy.py \
-clang-tidy-binary=${CLANG_TIDY} -p cmakebuild \
-quiet -config="$(cat .clang-tidy)" \
'src/.*'

RET=$?
echo "Clang tidy returned $RET"
exit $RET

0 comments on commit 8546d60

Please sign in to comment.