clang-tidy CI check exclusions
There are currently a host of excluded checks in .clang-tidy
and ThirdParty/.clang-tidy
. The latter is likely much harder to fix. However, the former is (mostly) VTK code that we can fix. The only checks enabled for third party code are the bugprone-*
checks, but we can enable others once we have VTK under control (as it will likely involve many changes pushed to the upstream projects).
.clang-tidy
file.
When fixing, please fix a single check per commit while removing the line from the A lot of the checks can be fixed automatically. To do so:
- configure with
-DCMAKE_{C,CXX}_CLANG_TIDY="$(which clang-tidy);--fix"
- remove the fix you would like to fix from
.clang-tidy
- build without parallelization (
make
orninja -j1
) - commit changes
- the CI configuration for
clang-tidy
is almost certainly building more modules than you are locally, so fix what it finds and squash it into the commit fixing that check rather than doing multiple "and one more fix for $check"-style commits. - repeat as you wish and make an MR with multiple fixed checks or an MR per check (up to you)
For those without --fix
support, just rebuild and edit until warning-free.
Typical problem areas:
- generated code (should be fixed, but separately)
- code generated by VTK tools
- code generated by external tools (namely
flex
/bison
)
- third party code
- fix it upstream and update the copy VTK ships; or
- add an exclusion for that project in a directory as close as possible (but still in VTK-land; the robot will tell you if you get "too close", but the general rule is "it should be beside the
update.sh
file for the import")
List of excluded checks:
-
bugprone-argument-comment -
bugprone-branch-clone -
bugprone-fold-init-type -
bugprone-incorrect-roundings -
bugprone-infinite-loop -
bugprone-integer-division -
bugprone-macro-parentheses -
bugprone-misplaced-widening-cast -
bugprone-narrowing-conversions -
bugprone-not-null-terminated-result -
bugprone-parent-virtual-call (!7673 (merged)) -
bugprone-reserved-identifier -
bugprone-signed-char-misuse -
bugprone-sizeof-expression (!7673 (merged)) -
bugprone-string-constructor (!7673 (merged)) -
bugprone-suspicious-include (!7673 (merged)) -
bugprone-suspicious-missing-comma (!7673 (merged)) -
bugprone-suspicious-semicolon (!7673 (merged)) -
bugprone-suspicious-string-compare (!7673 (merged)) -
bugprone-throw-keyword-missing (!7673 (merged)) -
bugprone-unhandled-self-assignment -
bugprone-unused-raii (!7673 (merged)) -
bugprone-unused-return-value (!7673 (merged)) -
bugprone-use-after-move (!7673 (merged)) -
clang-analyzer-core.CallAndMessage -
clang-analyzer-core.DivideZero -
clang-analyzer-core.NonNullParamChecker -
clang-analyzer-core.NullDereference -
clang-analyzer-core.UndefinedBinaryOperatorResult -
clang-analyzer-core.VLASize -
clang-analyzer-core.uninitialized.ArraySubscript -
clang-analyzer-core.uninitialized.Assign -
clang-analyzer-core.uninitialized.Branch -
clang-analyzer-cplusplus.Move -
clang-analyzer-cplusplus.NewDelete -
clang-analyzer-cplusplus.NewDeleteLeaks -
clang-analyzer-cplusplus.PlacementNew -
clang-analyzer-deadcode.DeadStores -
clang-analyzer-optin.cplusplus.UninitializedObject -
clang-analyzer-optin.cplusplus.VirtualCall -
clang-analyzer-optin.mpi.MPI-Checker -
clang-analyzer-optin.portability.UnixAPI -
clang-analyzer-security.FloatLoopCounter -
clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling -
clang-analyzer-security.insecureAPI.strcpy -
clang-analyzer-unix.Malloc -
clang-analyzer-unix.MallocSizeof -
clang-analyzer-unix.MismatchedDeallocator -
clang-analyzer-valist.Unterminated -
misc-no-recursion -
misc-non-private-member-variables-in-classes -
misc-redundant-expression -
misc-throw-by-value-catch-by-reference -
misc-unconventional-assign-operator (see #18119) -
misc-unused-parameters -
misc-unused-using-decls -
modernize-avoid-c-arrays -
modernize-deprecated-headers -
modernize-loop-convert -
modernize-pass-by-value -
modernize-raw-string-literal -
modernize-redundant-void-arg (!7714 (merged)) -
modernize-replace-random-shuffle -
modernize-return-braced-init-list -
modernize-use-auto -
modernize-use-bool-literals (!7714 (merged)) -
modernize-use-default-member-init -
modernize-use-emplace (!7714 (merged)) -
modernize-use-equals-default (!7610 (merged)) -
modernize-use-equals-delete (see #18119) -
modernize-use-nullptr (!7610 (merged)) -
modernize-use-override (!7610 (merged)) -
modernize-use-trailing-return-type -
modernize-use-using -
performance-for-range-copy (!7714 (merged)) -
performance-inefficient-string-concatenation (!7714 (merged)) -
performance-inefficient-vector-operation (!7714 (merged)) -
performance-move-const-arg (!7714 (merged)) -
performance-no-automatic-move (!7714 (merged)) -
performance-noexcept-move-constructor (!7714 (merged)) -
performance-type-promotion-in-math-fn -
performance-unnecessary-copy-initialization (!7714 (merged)) -
performance-unnecessary-value-param -
readability-avoid-const-params-in-decls (!7610 (merged)) -
readability-braces-around-statements -
readability-container-size-empty (!7673 (merged)) -
readability-convert-member-functions-to-static -
readability-delete-null-pointer (!7673 (merged)) -
readability-else-after-return -
readability-function-size -
readability-implicit-bool-conversion -
readability-inconsistent-declaration-parameter-name (!7673 (merged)) -
readability-isolate-declaration -
readability-magic-numbers -
readability-make-member-function-const -
readability-named-parameter -
readability-non-const-parameter -
readability-qualified-auto -
readability-redundant-access-specifiers (!7714 (merged)) -
readability-redundant-control-flow (!7714 (merged)) -
readability-redundant-declaration (was in !7673 (merged), but removed due to cmake/cmake!5856 (merged)) -
readability-redundant-member-init (!7673 (merged)) -
readability-redundant-preprocessor -
readability-redundant-smartptr-get (!7714 (merged)) -
readability-redundant-string-cstr (!7673 (merged)) -
readability-redundant-string-init (!7673 (merged)) -
readability-simplify-boolean-expr (partly fixed in !7714 (merged); some instances make sense as-is) -
readability-static-accessed-through-instance (!7714 (merged)) -
readability-static-definition-in-anonymous-namespace (!7673 (merged)) -
readability-string-compare (!7673 (merged)) -
readability-uppercase-literal-suffix -
readability-use-anyofallof
Edited by Ben Boeckel