Skip to content

Latest commit

 

History

History
198 lines (123 loc) · 6.76 KB

clang-tidy.md

File metadata and controls

198 lines (123 loc) · 6.76 KB

clang-tidy

Below are the reasoning why certain checks are (currently) disabled for out code base

Externals

We do not perform static analysis of the source of the external libraries. simplecpp has its own CI with a clang-tidy workflow.

Disabled Checks

abseil-*
altera-*
android-*
boost-*
darwin-*
fuchsia-*
linuxkernel-*
llvm-*
llvmlibc-*
mpi-*
objc-*
openmp-*
zircon-*

These are disabled since the platforms/libraries in question are not targeted by us.

cert-*
cppcoreguidelines-*
google-*
hicpp-*

These are coding guidelines we do not follow. Some of the checks might be explicitly enabled though.

readability-braces-around-statements
readability-isolate-declaration
modernize-use-trailing-return-type
modernize-use-auto
readability-uppercase-literal-suffix
readability-else-after-return
readability-identifier-length

These do not reflect the style we are (currently) enforcing.

readability-function-size
readability-function-cognitive-complexity

We are not interested in the size/complexity of a function.

readability-magic-numbers

These do not (always) increase readability.

bugprone-macro-parentheses

To be documented.

readability-implicit-bool-conversion

This does not appear to be useful as it is reported on very common code.

bugprone-narrowing-conversions
performance-no-automatic-move

It was decided not to apply these.

modernize-loop-convert

These might change the behavior of code which might not be intended (need to file an upstream issue)

modernize-raw-string-literal

This leads to a mismatch of raw string literals and regular ones and does reduce the readability.

-clang-analyzer-*

Disabled because of false positives (needs to file an upstream bug report).

misc-non-private-member-variables-in-classes

We intentionally use this.

misc-no-recursion

Leads to lots of "false positives". This seem to enforce a coding guidelines of certain codebases.

bugprone-easily-swappable-parameters

This produces a lot of noise and they are not fixable that easily.

readability-container-data-pointer

Disable because of false positives and inconsistent warnings (need to file an upstream bug report).

misc-const-correctness

Work in progress.

bugprone-assignment-in-if-condition

Is reported for valid patterns we are using.

readability-suspicious-call-argument

Produces a lot of false positives since it is too vague in its analysis.

performance-inefficient-string-concatenation

Produces warnings which might be considered false positives starting with C++11 - see llvm/llvm-project#54526.

modernize-avoid-c-arrays

Produces warnings when const char[] is being used which is quite common in our code. Does not make sense to enable before C++17 when std::string_view becomes available. Also reports a false positive about templates which deduce the array length: llvm/llvm-project#60053.

misc-include-cleaner

We run this separately via clang-include-cleaner in the iwyu.yml workflow as the findings of the include checkers still need to be reviewed manually before applying them.

bugprone-branch-clone
modernize-return-braced-init-list
misc-throw-by-value-catch-by-reference
readability-avoid-const-params-in-decls
bugprone-signed-char-misuse
readability-redundant-access-specifiers
concurrency-mt-unsafe
misc-use-anonymous-namespace
performance-avoid-endl
performance-noexcept-swap
bugprone-switch-missing-default-case
bugprone-empty-catch
performance-enum-size
readability-avoid-nested-conditional-operator

To be evaluated (need to remove exclusion).

cppcoreguidelines-missing-std-forward
cppcoreguidelines-avoid-const-or-ref-data-members
cppcoreguidelines-macro-usage
cppcoreguidelines-pro-type-member-init
cppcoreguidelines-pro-type-static-cast-downcast
cppcoreguidelines-prefer-member-initializer
cppcoreguidelines-misleading-capture-default-by-value
bugprone-argument-comment.CommentBoolLiterals
cert-err33-c
google-readability-namespace-comments
cppcoreguidelines-special-member-functions

To be evaluated (need to enable explicitly).

modernize-type-traits
modernize-use-nodiscard

These apply to codebases which use later standards then C++11 (C++17 is used when building with Qt6) so we cannot simply apply them.

Disabled for performance reasons

portability-std-allocator-const

Only necessary for code which is exclusively compiled with libc++. Also disabled for performance reasons - see llvm/llvm-project#57527 (comment).

modernize-deprecated-ios-base-aliases

Warns about aliases which are removed in C++20. Also disabled for performance reasons - see llvm/llvm-project#57527 (comment).

bugprone-unchecked-optional-access

We are not using any optional implementation. Also disabled for performance reasons - see llvm/llvm-project#57527 (comment).

modernize-replace-auto-ptr

Still available until C++17. It is unlikely such code will ever be introduced. Also disabled for performance reasons - see llvm/llvm-project#57527 (comment).

readability-identifier-naming

We are currently using our own naming.json to enforce naming schemes. Also disabled for performance reasons - see llvm/llvm-project#57527 (comment).

portability-simd-intrinsics

We are not using SIMD instructions and it suggests to use std::experiemental:: features which might not be commonly available. Also disabled for performance reasons - see llvm/llvm-project#57527 (comment).

modernize-macro-to-enum

It does not seem to produce any warnings for us (needs to be investigated) and it is one of the more expensive checks.

misc-unused-using-decls

This is the most expensive check for several files and it is providing much in terms of code quality. Reported upstream as llvm/llvm-project#72300.

Disabled for GUI only

readability-convert-member-functions-to-static

Disabled because of false positives with Qt slot methods (see llvm/llvm-project#57520).

readability-redundant-access-specifiers

Reports warning with the Qt <access-specifier> slots: syntax in class declarations - see llvm/llvm-project#60055.