<div dir="ltr">After thinking a bit about this, I'd like to revisit this from scratch (as it has changed quite a bit).<div><br></div><div>Why is: -check=<regexp> not enough? Give it a good enough default value (that is printed if you say -help), and we have the following use cases:</div>
<div>- add something to the default set: clang-tidy -help, copy default set, add own</div><div>- run only a single check: -check=my-full.check</div><div>- run only google checks: -check=google-.*</div><div><br></div><div>
<br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 14, 2014 at 10:13 PM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi klimek,<br>
<br>
Make checks filtering more intuitive and easy to use. Remove<br>
-disable-checks and change the format of -checks= to a comma-separated list of<br>
globs with optional '-' prefix to denote exclusion. The -checks= option is now<br>
cumulative, so it modifies defaults, not overrides them. Each glob adds or<br>
removes to the current set of checks, so the filter can be refined or overriden<br>
by adding globs.<br>
<br>
Example:<br>
  The default value for -checks= is<br>
  '*,-clang-analyzer-alpha*,-llvm-include-order,-llvm-namespace-comment,-google-*',<br>
  which allows all checks except for the ones named clang-analyzer-alpha* and<br>
  others specified with the leading '-'. To allow all google-* checks one can<br>
  write:<br>
    clang-tidy -checks=google-* ...<br>
  If one needs only google-* checks, we first need to remove everything (-*):<br>
    clang-tidy -checks=-*,google-*<br>
  etc.<br>
<br>
I'm not sure if we need to change something here, so I didn't touch the docs<br>
yet.<br>
<br>
<a href="http://reviews.llvm.org/D3770" target="_blank">http://reviews.llvm.org/D3770</a><br>
<br>
Files:<br>
  clang-tidy/ClangTidyDiagnosticConsumer.cpp<br>
  clang-tidy/ClangTidyDiagnosticConsumer.h<br>
  clang-tidy/ClangTidyOptions.h<br>
  clang-tidy/tool/ClangTidyMain.cpp<br>
  test/clang-tidy/arg-comments.cpp<br>
  test/clang-tidy/basic.cpp<br>
  test/clang-tidy/check_clang_tidy_fix.sh<br>
  test/clang-tidy/check_clang_tidy_output.sh<br>
  test/clang-tidy/deduplication.cpp<br>
  test/clang-tidy/diagnostic.cpp<br>
  test/clang-tidy/file-filter.cpp<br>
  test/clang-tidy/fix.cpp<br>
  test/clang-tidy/macros.cpp<br>
  test/clang-tidy/nolint.cpp<br>
  test/clang-tidy/select-checks.cpp<br>
  test/clang-tidy/static-analyzer.cpp<br>
  test/clang-tidy/temporaries.cpp<br>
  unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp<br>
</blockquote></div><br></div>