Open psalz opened 1 year ago
My list of personal grievances (to be continued):
clang-analyzer-optin.mpi.MPI-Checker
: We have little explicit MPI code and for that this option generates false positives basically for every single MPI calll (see e.g. #252)
misc-misplaced-const
lints against const pointer_t
function parameters because they expand to pointer_target *const
(which is exactly what I wanted)cppcoreguidelines-pro-bounds-constant-array-index
lints against things like for (int d=0; d<Dims; d++) range[d] = 1
because the subscript is not a constant expression. No way to avoid this in a template<int Dims>
.readability-else-after-return
seems to be the exact opposite of the school of "every function should only have a single return statement", but equally misguided. I often want to have an if-else cascade where every branch return
s from the function, because the first check is not an early-return but branches have equal weight.cppcoreguidelines-pro-type-const-cast
and cppcoreguidelines-avoid-goto
: I feel like we know our language well enough so when we end up using one of these, we know exactly what we are doing.readability-convert-member-functions-to-static
is frequently emitted for concept implementations such as std::hash<T>::operator()
. I have never encountered a case where this ended up being helpful. Sometimes I deliberately make functions non-static because that's the API I want to present to a user.cppcoreguidelines-avoid-do-while
: Why? Not that I write these frequently, but they do have valid uses, especially inside macro definitions.bugprone-unchecked-optional-access
generates too many false positives (e.g. if has_value
was part of a loop condition, or when .value()
which is a checked access is used without a conditional)Additionally, in tests:
cppcoreguidelines-avoid-non-const-global-variables
triggered by Catch2cppcoreguidelines-avoid-do-while
triggered by Catch2misc-use-anonymous-namespace
triggered by Catch2 (also anonymous namespaces are as stupid of a concept as statics)
I've parsed all clang-tidy diagnostics generated with the following checks enabled:
and those are the results:
You can find the raw clang-tidy output here (useful for checking what some of these diagnostics even do).
Based on this, I would suggest the following configuration:
Thoughts?