summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/tool
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Fix a typo.Alexander Kornienko2014-12-091-2/+3
| | | | llvm-svn: 223777
* [clang-tidy] Update help messages and docs.Alexander Kornienko2014-12-031-6/+21
| | | | | | Fixed incorrect examples of configuration, clarified the usage of -dump-config. llvm-svn: 223235
* [clang-tidy] Added -fix-errors optionAlexander Kornienko2014-11-031-4/+26
| | | | | | | | | | | | | | | | | | Summary: Added -fix-errors option to allow applying fixes when compiler errors are present. Without this flag -fix would bail out if there are compiler errors. This is needed to avoid applying wrong fixes if Clang fails to recover from compilation errors correctly. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D6059 llvm-svn: 221152
* Fix Makefiles after r220867.Daniel Jasper2014-10-291-3/+3
| | | | llvm-svn: 220868
* Shrink the set of checks enabled by default.Alexander Kornienko2014-10-291-5/+4
| | | | | | | | | | | | | | | | 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 llvm-svn: 220865
* [clang-tidy] Added -system-headers option.Alexander Kornienko2014-10-281-0/+7
| | | | | | | Added -system-headers option to allow display of warnings from system headers. This is needed for testing libcxx, for example. llvm-svn: 220826
* [clang-tidy] Bring order to check registration.Alexander Kornienko2014-10-262-0/+5
| | | | | | | | | | | | | | | | 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 llvm-svn: 220631
* Add flag --enable-check-profile to clang-tidy.Samuel Benzaquen2014-10-231-1/+51
| | | | | | | | | | | | | | | 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 llvm-svn: 220491
* Fix a typoAlexander Kornienko2014-09-261-1/+1
| | | | llvm-svn: 218512
* [clang-tidy] Add a -config={YAML} option.Alexander Kornienko2014-09-261-6/+35
| | | | | | | | | | | | | | | | 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 llvm-svn: 218511
* Provide user name in ClangTidyOptions.Alexander Kornienko2014-09-241-5/+10
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 218402
* Add missing dependency.Alexander Kornienko2014-09-221-2/+2
| | | | llvm-svn: 218249
* run-clang-tidy.py: don't fail when running without -checks=.Alexander Kornienko2014-09-221-2/+5
| | | | llvm-svn: 218227
* Implemented clang-tidy-check-specific options.Alexander Kornienko2014-09-121-0/+1
| | | | | | | | | | | | | | | | | 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 llvm-svn: 217661
* Moved main() to the clang::tidy namespace, no functional changes.Alexander Kornienko2014-09-101-22/+24
| | | | llvm-svn: 217493
* run-clang-tidy: Make clang-tidy path configurable and don't fail as horriblyBenjamin Kramer2014-09-081-9/+23
| | | | | | when it's not around. llvm-svn: 217374
* [clang-tidy] Add a little python script that can run clang-tidy and apply ↵Benjamin Kramer2014-09-081-0/+175
| | | | | | | | | | | | | | | | fixes over an entire codebase. Ever wanted to fix all the header guards in clang? Now it's easy. Make sure clang-tidy is in $PATH and a compilation database is available. $ ./run-clang-tidy.py -checks=-*,llvm-header-guard -fix ... get coffee (or more CPU cores) ... $ svn diff Some may argue that this is just a glorified xargs -P, but it does a bit more ;) Differential Revision: http://reviews.llvm.org/D5188 llvm-svn: 217368
* Don't write files with no fixes.Alexander Kornienko2014-09-041-1/+1
| | | | llvm-svn: 217163
* Implemented clang-tidy configurability via .clang-tidy files.Alexander Kornienko2014-09-041-15/+51
| | | | | | | | | | | | | | | | | 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 llvm-svn: 217155
* [clang-tidy] Add an option to export suggested fixes into a file.Benjamin Kramer2014-09-041-0/+17
| | | | | | | | Allows gathering fixes and applying them with clang-apply-fixes. Differential Revision: http://reviews.llvm.org/D5176 llvm-svn: 217139
* Fix linking in the Makefile build.Benjamin Kramer2014-08-131-1/+1
| | | | llvm-svn: 215550
* Track clang r213171Alp Toker2014-07-161-1/+1
| | | | | | The clang rewriter is now a core facility. llvm-svn: 213172
* Make clang-tidy-diff.py py3-compatible.NAKAMURA Takumi2014-06-271-1/+1
| | | | llvm-svn: 211834
* Add clang-tidy-diff.py script to run clang-tidy and display warnings on ↵Alexander Kornienko2014-06-251-0/+115
| | | | | | | | | | | | | | changed lines only. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4288 llvm-svn: 211698
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210776
* Allow per-file clang-tidy options.Alexander Kornienko2014-06-051-8/+13
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 210260
* Exit with error when no checks enabled.Alexander Kornienko2014-06-021-1/+9
| | | | | | | | | | | | | | | | Summary: This seems like a more appropriate reaction to the user specifying a single check with a wrong name, for example. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3981 llvm-svn: 210043
* Add clang-tidy -line-filter option to filter findings by line ranges.Alexander Kornienko2014-05-221-8/+32
| | | | | | | | | | | | | | | | | 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 llvm-svn: 209450
* Improved llvm-namespace-comment check.Alexander Kornienko2014-05-191-1/+0
| | | | | | | | | | | | | | | | | | | Summary: Handle various forms of existing namespace closing comments, fix existing comments with wrong namespace name, ignore short namespaces. The state of this check now seems to be enough to enable it by default to gather user feedback ;) Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3825 llvm-svn: 209141
* Update clang-tidy documentation.Alexander Kornienko2014-05-161-19/+24
| | | | | | | | | | | | | | | | Summary: Updated the help message, updated description of -checks=, removed mentions of -disable-checks. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3793 llvm-svn: 208979
* Change the behavior of clang-tidy -checks=, remove -disable-checks.Alexander Kornienko2014-05-151-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 208883
* Store Errors inside ClangTidyContext instead of just pointer to an externalAlexander Kornienko2014-05-091-1/+1
| | | | | | | | | | | | | | | array. This simplifies usage of ClangTidyContext a bit and seems to be more consistent. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3685 llvm-svn: 208407
* Print stats on displayed and ignored warnings.Alexander Kornienko2014-05-071-2/+29
| | | | | | | | | | | | | | | | Summary: Also displays a hint to use -header-filter='.*' in case any warnings are in non-user code. This will help discoverability of this option. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3621 llvm-svn: 208174
* Add clang-tidy -header-filter optionAlexander Kornienko2014-05-051-0/+7
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 207970
* Add a clang-tidy flag to support temporary destructor-aware analysis ↵Alex McCarthy2014-04-301-0/+8
| | | | | | | | | | | | (workaround for bug 15599). Reviewers: alexfh Subscribers: jordan_rose, klimek, djasper, cfe-commits Differential Revision: http://reviews.llvm.org/D3556 llvm-svn: 207652
* Add ClangTidyOptions to encapsulate all clang-tidy options.Alexander Kornienko2014-04-291-3/+6
| | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3544 llvm-svn: 207532
* Fix typo (first commit to test commit access).Alex McCarthy2014-04-291-1/+1
| | | | llvm-svn: 207490
* Fix regex bug in clang-tidy.Daniel Jasper2014-04-021-1/+1
| | | | | | | | Also make tests slightly less dependent on default flags. Once we have implemented configuration file support, we might want to store the clang-tidy configuration for the tests there. llvm-svn: 205408
* Disable a few clang-tidy checks by default.Daniel Jasper2014-04-021-1/+5
| | | | | | | | The goal is to be able to run clang-tidy on LLVM files without further configuration for now. Once llvm.org/PR19306 is addressed, we can add a configuration file instead and choose other defaults. llvm-svn: 205407
* Added a module for checks not related to LLVM or Google coding style.Alexander Kornienko2014-03-053-4/+8
| | | | llvm-svn: 202970
* Make the OptionCategory variable static.Alexander Kornienko2014-02-051-1/+1
| | | | llvm-svn: 200841
* Clang-tidy: added --disable-checks, --list-checks options.Alexander Kornienko2013-12-191-3/+20
| | | | | | | | | | | | | | | | | | | | | | | Summary: Allow disabling checks by regex. By default, disable alpha.* checks, that are not particularly good tested (e.g. IdempotentOperationChecker, see http://llvm-reviews.chandlerc.com/D2427). Fixed a bug, that would disable all analyzer checks, when using a regex more strict, than 'clang-analyzer-', for example --checks='clang-analyzer-deadcode-'. Added --list-checks to list all enabled checks. This is useful to test specific values in --checks/--disable-checks. Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2444 llvm-svn: 197717
* Fix the usage of the CommonOptionsParser ctor changed in r197139.Alexander Kornienko2013-12-121-2/+1
| | | | llvm-svn: 197141
* [CMake] clang-tools-extra: Update dependencies.NAKAMURA Takumi2013-12-101-2/+4
| | | | llvm-svn: 196860
* [CMake] clang-tools-extra may not depend on LLVM CodeGen.NAKAMURA Takumi2013-12-091-4/+0
| | | | llvm-svn: 196805
* Make clang's static analyzer checks available through clang-tidy.Manuel Klimek2013-11-143-9/+8
| | | | | | | | | | | | | This is implemented in a way that the current static analyzer architecture allows, in the future we might want to revisit this. With this change static analyzer checks are available from clang-tidy by specifying -checks=clang-analyzer-<name>. This change also fixes the use of the compilation database to allow clang-tidy to be used like any other clang tool. llvm-svn: 194707
* Fix clang-tidy dependencies and bad file comment.Daniel Jasper2013-08-042-0/+16
| | | | | | This addresses comments in post-commit review of r187345. llvm-svn: 187707
* Remove dead #includes.Hans Wennborg2013-07-311-2/+0
| | | | llvm-svn: 187536
* Fix build error caused by r187345.Daniel Jasper2013-07-291-2/+2
| | | | llvm-svn: 187346
* Initial architecture for clang-tidy.Daniel Jasper2013-07-293-0/+99
This is the first version of a possible clang-tidy architecture. The purpose of clang-tidy is to detect errors in adhering to common coding patterns, e.g. described in the LLVM Coding Standards. This is still heavily in flux. Review: http://llvm-reviews.chandlerc.com/D884 llvm-svn: 187345
OpenPOWER on IntegriCloud