Skip to content
Permalink
Browse files

Update clang-tidy configuration and scripts

  • Loading branch information
sfan5 committed Mar 11, 2020
1 parent 7908b20 commit 8546d6089a89a4e34219fc10af088394a2eb3b1c
Showing with 267 additions and 218 deletions.
  1. +4 −3 .clang-tidy
  2. +5 −7 util/travis/clangtidy.sh
  3. +258 −208 util/travis/run-clang-tidy.py
@@ -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)
@@ -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 \
@@ -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.
You can’t perform that action at this time.