[clang-tidy] New option to remove arguments from the command line (#164344)
When using clang-tidy from a compilation database, some options might
not be
recognized by clang if the compilation database was generated for
another compiler.
This forces the user to add conditional code in their CMakeLists.txt to
remove
those arguments when using clang-tidy.
A new option was added to the .clang-tidy config to remove
those unknown flags without the need to generate a second
compilation_commands.json
Fixes #108455
Please see #111453 and #162201 for previous discussions regarding this
option.
This implementation was slightly changed from the initial PR based on
the following comment
(https://github.com/llvm/llvm-project/pull/162201#issuecomment-3393569422).
The goal is to keep this feature as simple as possible and to make sure
there aren't any side effects. So the user has to explicitly list the
arguments he wants to remove. A mention was also added to warn the user
that removing arguments might lead to false positive / negative if the
code isn't properly recognized by the clang compiler.