1

I agree with the majority of the clang-tidy checks, but some I don't see tremendous value in. Mostly these are the fuschia* checks, such as the default argument warnings:

error: calling a function that uses a default argument is disallowed [fuchsia-default-arguments...

Therefore I would like to know how to run all of the checks except the fuschia ones. Right now, I just check everything in Cmake:

set(CMAKE_CXX_CLANG_TIDY
        clang-tidy;
        -header-filter=.;
        -checks=*;
        -warnings-as-errors=*;)
bremen_matt
  • 6,902
  • 7
  • 42
  • 90

1 Answers1

4

Clang-tidy allows you to use positive and negative globs in specifying checks. Just use - as a prefix when specifying checks you want to exclude. In your case:

-checks=*,-fuchsia*;

If you want to verify which checks are enabled you can run a command:

$ clang-tidy -checks=*,-fuchsia* -list-checks
pablo285
  • 2,460
  • 4
  • 14
  • 38