[PATCH] Change the behavior of clang-tidy -checks=, remove -disable-checks.

Alexander Kornienko alexfh at google.com
Wed May 14 13:13:36 PDT 2014


Hi klimek,

Make checks filtering more intuitive and easy to use. Remove
-disable-checks and change the format of -checks= to a comma-separated list of
globs with optional '-' prefix to denote exclusion. The -checks= option is now
cumulative, so it modifies defaults, not overrides them. Each glob adds or
removes to the current set of checks, so the filter can be refined or overriden
by adding globs.

Example:
  The default value for -checks= is
  '*,-clang-analyzer-alpha*,-llvm-include-order,-llvm-namespace-comment,-google-*',
  which allows all checks except for the ones named clang-analyzer-alpha* and
  others specified with the leading '-'. To allow all google-* checks one can
  write:
    clang-tidy -checks=google-* ...
  If one needs only google-* checks, we first need to remove everything (-*):
    clang-tidy -checks=-*,google-*
  etc.

I'm not sure if we need to change something here, so I didn't touch the docs
yet.

http://reviews.llvm.org/D3770

Files:
  clang-tidy/ClangTidyDiagnosticConsumer.cpp
  clang-tidy/ClangTidyDiagnosticConsumer.h
  clang-tidy/ClangTidyOptions.h
  clang-tidy/tool/ClangTidyMain.cpp
  test/clang-tidy/arg-comments.cpp
  test/clang-tidy/basic.cpp
  test/clang-tidy/check_clang_tidy_fix.sh
  test/clang-tidy/check_clang_tidy_output.sh
  test/clang-tidy/deduplication.cpp
  test/clang-tidy/diagnostic.cpp
  test/clang-tidy/file-filter.cpp
  test/clang-tidy/fix.cpp
  test/clang-tidy/macros.cpp
  test/clang-tidy/nolint.cpp
  test/clang-tidy/select-checks.cpp
  test/clang-tidy/static-analyzer.cpp
  test/clang-tidy/temporaries.cpp
  unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3770.9399.patch
Type: text/x-patch
Size: 15728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140514/c9ceeb34/attachment.bin>


More information about the cfe-commits mailing list