[clang-tidy] Move some of the misc checks to readability/

Summary:
Some of the misc checks belong to readability/. I'm moving them there
without changing check names for now. As the next step, I want to register some
of these checks in the google and llvm modules with suitable settings (e.g.
BracesAroundStatementsCheck). I'm not sure if we want to create a "readability"
module, probably not.

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D5792

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@219786 91177308-0d34-0410-b5e6-96231b3b80d8
Reformatted code samples in the unit test. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@219788 91177308-0d34-0410-b5e6-96231b3b80d8
Fix llvm-header-guard check.

Summary:
This patch makes the check work better for LLVM code:
  * always fix existing #endif comments
  * use one space before the comment (+allow customization for other styles)

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5795

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@219789 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid having "using namespace" for both "clang" and "llvm" namespaces.
This is fragile, as there are classes with the same name in both
namespaces (e.g. llvm::Module and clang::Module).


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@219855 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Default options in modules.

Summary:
This patch allows modules to specify default options for the checks
defined in them. This way a sufficiently configurable check can be registered in
multiple modules with different default options. E.g. the SpacesBeforeComments
option may be set to 1 for the "llvm-namespace-comments" check and to 2 for the
"google-readability-namespace-comment" check without modifying or extending the
check code.

This patch also registers the google-readability-braces-around-statements check
with suitable defaults.

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D5798

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@219923 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Minor fixes for the NamespaceCommentCheck.

  * Make SmallVector size enough for all groups.
  * Allow trailing period in the comment.
  * Fix "// anonymous namespace qqq".



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@219926 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Add support for custom configuration file names/formats.

Summary: We're using different clang-tidy frontends (command-line, batch analysis jobs, code review integration), some of which are limited in the choice of configuration format. In order to avoid duplication of configuration information, we need to support the same configuration format in the command-line tool. This patch adds an extension point to make this possible without rewriting FileOptionsProvider.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5821

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220199 91177308-0d34-0410-b5e6-96231b3b80d8
Add flag --enable-check-profile to clang-tidy.

Summary:
Add flag --enable-check-profile to clang-tidy.
It turns on per-matcher profiles in MatchFinder and prints a report to
stderr at the end.

Reviewers: alexfh

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D5937

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220491 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Bring order to check registration.

Summary:
Register readability checks in a separate module. Renamed the checks
and test file names accordingly.

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D5936

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220631 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Simplify RUN: lines in the test

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220632 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Clean up test.

Simplify RUN lines and make checks stricter, check messages instead of fixes.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220633 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] check_clang_tidy_fix.sh -> check_clang_tidy.sh

Summary: Make the script suitable for checking just messages. Move most of the tests to use it. Clean up the tests: shorten messages, insert line numbers, remove unnecessary RUN: lines, etc.

Reviewers: klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D5989

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220634 91177308-0d34-0410-b5e6-96231b3b80d8
Prune CRLF.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220678 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Added -system-headers option.

Added -system-headers option to allow display of warnings from system headers.
This is needed for testing libcxx, for example.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220826 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Updated docs for r220826.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220830 91177308-0d34-0410-b5e6-96231b3b80d8
Suppress clang-tools-extra/test/clang-tidy/file-filter.cpp on win32 for investigaitng.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220837 91177308-0d34-0410-b5e6-96231b3b80d8
Shrink the set of checks enabled by default.

Summary:
Enable only compiler diagnostics and safe static analyzer checks by
default. Let the defaults be conservative and safe for an average project.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6027

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220865 91177308-0d34-0410-b5e6-96231b3b80d8
Fix Makefiles after r220867.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220868 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Reformat.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220888 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Add dependencies on clangToolingCore.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220890 91177308-0d34-0410-b5e6-96231b3b80d8