Граф коммитов

24 Коммитов

Автор SHA1 Сообщение Дата
Haojian Wu 67b26d6f44 [ClangTidy] Add an 'explain-checks' option to diagnose where each checks comes from.
Reviewers: alexfh

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 09:15:01 +00:00
Jonathan Roelofs f502328e6c Teach clang-tidy how to upgrade warnings into errors.
Similar in format to the `-checks=` argument, this new `-warnings-as-errors=`
argument upgrades any warnings emitted by the former to errors.

http://reviews.llvm.org/D15528


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@257642 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 17:36:41 +00:00
Alexander Kornienko 2e1c6fad8d Add ExtraArgs and ExtraArgsBefore options to enable clang warnings via configuration files.
Summary: This patch depends on http://reviews.llvm.org/D14191

Reviewers: djasper, klimek

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@252485 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 16:28:11 +00:00
David Blaikie 1ec3c0fcf8 Revert "Apply modernize-use-default to clang-tools-extra."
Breaks the build in GCC 4.7.2 (see
http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3 for example)

This reverts commit r250824.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@250862 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 21:45:52 +00:00
Angel Garcia Gomez dec2fa63a9 Apply modernize-use-default to clang-tools-extra.
Summary: Replace empty bodies of default constructors and destructors with '= default'.

Reviewers: klimek

Subscribers: alexfh, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@250824 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 12:56:27 +00:00
Alexander Kornienko df70b2be5e [clang-tidy] Make FileOptionsProvider fields protected to make extending it easier
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@244793 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 19:29:57 +00:00
Alexander Kornienko 6f511ea7ca [clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC.
The patch was generated using this command:
$ clang-tidy/tool/run-clang-tidy.py -header-filter=.*clang-tidy.* -fix \
    -checks=-*,llvm-header-guard clang-tidy.*
$ svn revert --recursive clangt-tidy/llvm/
(to revert a few buggy fixes)


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@231669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 16:52:33 +00:00
Alexander Kornienko b4899652cc [clang-tidy] Make ClangTidyOptionsProvider::getOptions return by value.
Returning by reference limits possible implementations and doesn't bring any
benefits as all callers make copies of the returned value anyway.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@226553 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-20 09:48:51 +00:00
Alexander Kornienko 4960433ea5 [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
2014-10-28 22:16:13 +00:00
Alexander Kornienko 41094c7cc6 [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
2014-10-20 12:29:15 +00:00
Alexander Kornienko 91fddd15a2 [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
2014-10-16 11:27:57 +00:00
Alexander Kornienko 07cc408773 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
2014-09-24 18:36:03 +00:00
Alexander Kornienko fa2f5e82a0 Implemented clang-tidy-check-specific options.
Summary:
Each check can implement readOptions and storeOptions methods to read
and store custom options. Each check's options are stored in a local namespace
to avoid name collisions and provide some sort of context to the user.

Reviewers: bkramer, klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@217661 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-12 08:53:36 +00:00
Alexander Kornienko 529b6cb88b Implemented clang-tidy configurability via .clang-tidy files.
Summary:
This adds a support for the .clang-tidy file reading using
FileOptionsProvider, -dump-config option, and changes tests to not depend on
default checks set.

Reviewers: klimek, bkramer, djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@217155 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-04 14:23:36 +00:00
Rafael Espindola c0ca6a0974 include system_error directly.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@210797 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-12 16:53:02 +00:00
Rafael Espindola b0a3dbbc33 Replace llvm::error_code with std::error_code.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@210776 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-12 13:32:11 +00:00
Alexander Kornienko 905eb413b4 A follow-up to r210260: updated a comment. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@210767 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-12 11:25:45 +00:00
Alexander Kornienko ac560ec8cb Allow per-file clang-tidy options.
Summary:
This patch makes it possible for clang-tidy clients to provide
different options for different translation units. The option, which doesn't
make sense to be file-dependent, was moved to a separate ClangTidyGlobalOptions
struct. Added parsing of ClangTidyOptions.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@210260 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-05 13:31:45 +00:00
Alexander Kornienko daa7400882 Add clang-tidy -line-filter option to filter findings by line ranges.
Summary:
This is going to be used for a clang-tidy-diff script to display
warnings in changed lines only. The option uses JSON, as its value is not
intended to be entered manually.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209450 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-22 16:07:11 +00:00
Alexander Kornienko 87404e11b9 Change the behavior of clang-tidy -checks=, remove -disable-checks.
Summary:
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.

Reviewers: klimek, alexfh

Reviewed By: alexfh

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@208883 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 14:27:36 +00:00
Alexander Kornienko 35cd343bab Add clang-tidy -header-filter option
Summary:
Add clang-tidy -header-filter option to specify from which headers we
want diagnostics to be printed. By default we don't print diagnostics from
headers. We always print diagnostics from the main file of each translation
unit.

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@207970 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-05 14:54:47 +00:00
Alex McCarthy 45e751fbe4 Fix ClangTidyOptions constructor to initialize all members. Fixes bug introduced in r207652.
Reviewers: rsmith

Subscribers: cfe-commits, alexfh, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@207715 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-30 22:32:51 +00:00
Alex McCarthy 10c783a34e Add a clang-tidy flag to support temporary destructor-aware analysis (workaround for bug 15599).
Reviewers: alexfh

Subscribers: jordan_rose, klimek, djasper, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@207652 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-30 14:09:24 +00:00
Alexander Kornienko 6c8a52b813 Add ClangTidyOptions to encapsulate all clang-tidy options.
Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@207532 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-29 15:20:10 +00:00