Details
- Reviewers
- None
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Could you summarize what problem this is solving? There's multiple ways to "ignore diagnostics from specific checks", I think it would be confusing to add yet another one.
I actually couldn't find a way to black-list specific checks. Is there a way to do that?
Just prepend a dash to the check name that you want to disable:
checks=cppcoreguidelines-*,-cppcoreguidelines-pro-type-pointer-arithmetic
This will enable all checks from cppcoreguidelines except cppcoreguidelines-pro-type-pointer-arithmetic.
Normally you do this with pretty formatting in the .clang-tidy file:
Checks: > cppcoreguidelines-*, -cppcoreguidelines-pro-type-pointer-arithmetic, -cppcoreguidelines-avoid-c-arrays,
Well now I feel stupid for not realizing that, thanks for pointing it out :)
At least I learned how to hack around in clang-tidy 😄
No worries, it's indeed good practice! Feel free to take a look at the docs, where this (and many more features) is described :)
https://clang.llvm.org/extra/clang-tidy/
will disable all default checks (-*) and enable all clang-analyzer-* checks except for clang-analyzer-cplusplus* ones.
And of course if you think something is unclear feel free to improve it :)