Make a variable local so it's lifetime becomes more obvious.

NFC

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@217952 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Add a checker that warns on TODO comments without username.

It also suggests a fix-it, taking the name from $USER. This will be made
configurable eventually.

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218049 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Don't leak the TodoCommentHandler object

Preprocessor:addCommentHandler() does not take ownership,
so we'd end up leaking the TodoCommentHandler.

This patch makes it owned by the Check object.

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218068 91177308-0d34-0410-b5e6-96231b3b80d8
Disable most of the google-readability-casting check for non-C++ files (only
leave the "redundant cast to the same type" part).


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218225 91177308-0d34-0410-b5e6-96231b3b80d8
run-clang-tidy.py: don't fail when running without -checks=.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218227 91177308-0d34-0410-b5e6-96231b3b80d8
Add newline at eof.

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218235 91177308-0d34-0410-b5e6-96231b3b80d8
Add NamespaceCommentCheck to the Google module.

Summary:
This uses a bit hacky way to set the defaults for the spaces before
comments, but it's also one of the simplest ways. Fixed a bug with how the
SpacesBeforeComments option was used.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

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



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218249 91177308-0d34-0410-b5e6-96231b3b80d8
Try to pacify dash-using linux distros with a very old-school shell variable compare.

While there fix the cmake shared build.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218274 91177308-0d34-0410-b5e6-96231b3b80d8
ClangTidyTests: Add dependency on clangTidyUtils.

I missed to add it since I suppressed checks on win32 in r215590.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218289 91177308-0d34-0410-b5e6-96231b3b80d8
Drop superfluous semicolon. GCC's -pedantic warns about this.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218310 91177308-0d34-0410-b5e6-96231b3b80d8
Provide user name in ClangTidyOptions.

Summary:
This adds the ClangTidyOptions::User field and fills it from the USER
or the USERNAME environment variable, if possible. The FileOptionsProvider now
takes "default" options instead of "fallback" options, as it now uses these when
an option is not set in the configuration file (one exception is the checks
list).

Reviewers: bkramer, klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218402 91177308-0d34-0410-b5e6-96231b3b80d8
Clang-tidy google-readability-function check: don't warn on gmock
testing::Unused parameters.

Reviewers: bkramer, klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218443 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Add a -config={YAML} option.

Summary:
Add -config option to allow specifying configuration in YAML/JSON
format on the command line.

Reviewers: klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218512 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Test username substitution in TODO() check.

Summary:
This patch depends on D5501.
Check user name substitution more specifically by specifying it via the new
-config= option.
This also lets clang-tidy tests specify clang-tidy options before the '--'
when using check_clang_tidy_fix.sh.

Reviewers: klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218515 91177308-0d34-0410-b5e6-96231b3b80d8
Corrected a comment in check_clang_tidy_fix.sh

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


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


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