Using `const` should not be warned about everywhere if it does not have
a clear advantages. Compilers are able to deduce constness in most cases
and on top of that, it's generally accepted that using `const`
communicates developer intent above all else.
IncludeCleaner is a new feature of clang-tidy/clangd that adds upstream
support for the include-what-you-use (IWYU) tool's checks.
However, this tool is very noisy on our codebase. It can be enabled by
individual contributors at their leisure.
We use recursive algorithms all over the place, and this check makes
it hard to read those algorithms in CLion, since it draws squiggles
under everything.
Add a basic clang-tidy configuration that enables checks from the
following categories:
- bugprone
- cert
- clang-analyzer
- concurrency
- misc
- performance
- portability
- readability
The noisiest rules that have conflicts with the project style guide or
accepted practices have been turned off.
There's absolutely more work to be done here before we could consider
setting any of these warnings as errors and enforcing them in CI, but
committing a project clang-tidy configuration should help the rules
become more visible and let other contributors take a crack at tweaking
rules and/or finding possible bugs.
Sadly the cpp-core-guidelines and modernize categories are very, very
noisy. If we want to enable rules from these categories, they would need
to be on a rule by rule basis.