summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Add non-constant references in function parameters check.Alexander Kornienko2016-02-021-0/+3
| | | | | | | | | | | | | | | Summary: This is implemented originally by Alexander Kornienko. Reviewers: alexfh Subscribers: cfe-commits Patch by Haojian Wu! Differential Revision: http://reviews.llvm.org/D16717 llvm-svn: 259530
* [clang-tidy] Move google-readability-function check to ↵Alexander Kornienko2015-03-161-3/+0
| | | | | | | | | | | | | | | | readability-named-parameter. Summary: The relevant style rule is going to be removed, thus the check is no longer needed in the Google module. Leaving the check in readability/ in case someone needs it. Reviewers: djasper Reviewed By: djasper Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D8261 llvm-svn: 232431
* [clang-tidy] Refactor: Rename clang-tidy readability check files and classes ↵Alexander Kornienko2015-03-091-3/+3
| | | | | | | | | | | | | to follow naming conventions Classes are named WhateverCheck, files are WhateverCheck.cpp and` WhateverCheck.h` http://reviews.llvm.org/D8144 Patch by Richard Thomson! llvm-svn: 231650
* [clang-tidy] Refactor: Move google clang-tidy checks to namespace ↵Alexander Kornienko2015-03-051-7/+13
| | | | | | | | | | clang::tidy::google http://reviews.llvm.org/D7994 Patch by Richard Thomson! llvm-svn: 231364
* Add clang-tidy check google-global-names-in-headers.Samuel Benzaquen2015-02-111-0/+3
| | | | | | | | | | | | | | Summary: google-global-names-in-headers flags global namespace pollution in header files. Right now it only triggers on using declarations and directives. Reviewers: alexfh Subscribers: curdeius Differential Revision: http://reviews.llvm.org/D7563 llvm-svn: 228875
* [cleanup] Re-sort the #include lines with llvm/utils/sort_includes.pyChandler Carruth2015-01-141-4/+4
| | | | | | | No functionality changed, this is just a mechanical cleanup to keep the order of #include lines consistent across the project. llvm-svn: 225976
* [clang-tidy] Set google-readability-namespace-comments.ShortNamespaceLines to 10Alexander Kornienko2014-11-201-1/+1
| | | | | | This value is used in cpplint, so we'd better be consistent. llvm-svn: 222431
* [clang-tidy] Bring order to check registration.Alexander Kornienko2014-10-261-2/+9
| | | | | | | | | | | | | | | | 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
* [clang-tidy] Default options in modules.Alexander Kornienko2014-10-161-0/+13
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 219923
* Add NamespaceCommentCheck to the Google module.Alexander Kornienko2014-09-221-0/+3
| | | | | | | | | | | | | | | | | 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 llvm-svn: 218240
* [clang-tidy] Add a checker that warns on TODO comments without username.Benjamin Kramer2014-09-181-0/+3
| | | | | | | | | It also suggests a fix-it, taking the name from $USER. This will be made configurable eventually. Differential Revision: http://reviews.llvm.org/D5393 llvm-svn: 218049
* Unique-ptrify ClangTidyCheckFactories. Add a more convenient alternative toAlexander Kornienko2014-09-101-30/+20
| | | | | | | | | | | | | | addCheckFactory: registerCheck. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5288 llvm-svn: 217489
* [clang-tidy] Add a checker that suggests replacing short/long/long long with ↵Benjamin Kramer2014-08-291-0/+4
| | | | | | | | fixed-size types. Differential Revision: http://reviews.llvm.org/D5119 llvm-svn: 216726
* [clang-tidy] Add a checker for zero-length memset.Benjamin Kramer2014-07-161-0/+4
| | | | | | | | | | | | If there's memset(x, y, 0) in the code it's most likely a mistake. The checker suggests a fix-it to swap 'y' and '0'. I think this has the potential to be promoted into a general clang warning after some testing in clang-tidy. Differential Revision: http://reviews.llvm.org/D4535 llvm-svn: 213155
* [clang-tidy] Add namespaces checkers.Benjamin Kramer2014-07-161-0/+8
| | | | | | | | | | This change contains of two checkers that warn about 1. anonymous namespaces in header files. 2. 'using namespace' directives everywhere. Differential Revision: http://reviews.llvm.org/D4523 llvm-svn: 213153
* [clang-tidy] Add a checker that warns on const string & members.Benjamin Kramer2014-07-161-0/+4
| | | | | | | | | | | | | | Summary: Those are considered unsafe and should be replaced with simple pointers or full copies. It recognizes both std::string and ::string. Reviewers: alexfh, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4522 llvm-svn: 213133
* [clang-tidy] Add a checker that flags unnamed parameters.Benjamin Kramer2014-07-151-0/+4
| | | | | | | | | | | | | | | | Summary: We still allow the escape hatch foo(int /*x*/) and also suggest this in a fixit. This is more powerful than the corresponding cpplint.py check it also flags functions with multiple arguments as naming all arguments is recommended by the google style guide. Reviewers: alexfh, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4518 llvm-svn: 213075
* [clang-tidy] Add a checker that flags all instances of overloaded unary ↵Benjamin Kramer2014-07-151-0/+4
| | | | | | | | | | operator& This handles both methods and freestanding overloads. Differential Revision: http://reviews.llvm.org/D4498 llvm-svn: 213067
* [clang-tidy] Add a checker that removes deducible arguments from std::make_pairBenjamin Kramer2014-07-151-0/+4
| | | | | | | | | | | Those may be incompatible with C++11 and are unnecessary. We suggest removing the template arguments when they match the types of the make_pair arguments or replace it with std::pair and explicit template arguments when not. Differential Revision: http://reviews.llvm.org/D4497 llvm-svn: 213058
* Another attempt to add a clang-tidy check for flagging C-style casts.Alexander Kornienko2014-06-291-0/+4
| | | | | | | | | | | | | | | | | | | Summary: The first version failed the SubstNonTypeTempateParmExpr-related test on some buildbots. This one uses the new substNonTypeTempateParmExpr matcher to filter out implicit C-style casts. This patch depends on D4327. Reviewers: djasper Reviewed By: djasper Subscribers: aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D4328 llvm-svn: 212002
* Rolling back, as the test fails on one of the buildbots:Alexander Kornienko2014-06-251-4/+0
| | | | | | http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/13505/steps/check-all/logs/Clang%20Tools%3A%3Ac-style-casts.cpp llvm-svn: 211708
* Add a check to flag the usage of C-style casts (Google Style).Alexander Kornienko2014-06-251-0/+4
| | | | | | | | | | | | | | | | | Summary: Add a check to flag the usage of C-style casts, as per Google Style Guide: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Casting#Casting Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4189 llvm-svn: 211702
* Move google-explicit-constructor check to a separate source file.Alexander Kornienko2014-06-181-72/+1
| | | | | | | | | | | | | | Summary: No functional changes. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4188 llvm-svn: 211154
* Track clang changes from r209061Alp Toker2014-05-171-2/+1
| | | | llvm-svn: 209062
* Fix assertion in google-explicit-constructor check when the constructor isAlexander Kornienko2014-05-051-3/+5
| | | | | | | | | | | | | | | | | | defined in a macro. Summary: We shouldn't suggest replacements in macros anyway, as we can't see all usages of the macro and ensure the replacement is safe for all of them. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3611 llvm-svn: 207987
* Fix the message for "Move constructor declared explicit".Alexander Kornienko2014-04-291-1/+2
| | | | | | Make the tests for removal of 'explicit' more diverse. llvm-svn: 207534
* Warn on explicit copy constructors.Alexander Kornienko2014-04-291-3/+46
| | | | | | | | | | | | | | | | | Summary: The Google C++ Style Guide doesn't require copy constructors to be declared explicit, but some people do this by mistake. Make this check detect and fix such cases. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3541 llvm-svn: 207531
* clang-tidy explicit constructor check: don't warn on copy or move constructors.Alexander Kornienko2014-03-201-1/+1
| | | | | | | | | | | | | | | | | Summary: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Explicit_Constructors "The exception is copy constructors, which, in the rare cases when we allow them, should probably not be explicit." Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3122 llvm-svn: 204322
* clang-tidy explicit constructors check: don't warn on deleted constructors.Alexander Kornienko2014-03-191-1/+2
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3116 llvm-svn: 204226
* Fixed formatting.Alexander Kornienko2014-03-051-2/+1
| | | | llvm-svn: 202969
* [C++11] Replace LLVM_OVERRIDE with 'override'Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202632
* Normalized "virtual" and "LLVM_OVERRIDE" usage in clang-tidy.Alexander Kornienko2014-02-271-1/+2
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2894 llvm-svn: 202392
* Fix ExplicitConstructorCheck to warn only on in-class declarations.Alexander Kornienko2014-02-131-10/+12
| | | | | | | | | | | | | | | | Summary: I'm not absolutely sure this is 100% correct solution, but it seems to do what I expect. Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2756 llvm-svn: 201308
* Add the check name to the clang-tidy diagnostic output.Alexander Kornienko2014-01-131-1/+1
| | | | | | | | | | | | | | | | | Summary: Pass check names all the way from ClangTidyModule through ClangTidyCheck and ClangTidyContext to ClangTidyError, and output it in handleErrors. This allows to find mis-behaving check and disable it easily. Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2534 llvm-svn: 199094
* Run llvm/utils/sort_includes.py over the Clang tools code. This doesn'tChandler Carruth2014-01-071-2/+2
| | | | | | | | | | always produce as pretty of results as it does in LLVM and Clang, but I don't mind and the value of having a single canonical ordering is very high IMO. Let me know if you spot really serious problems here. llvm-svn: 198703
* Initial architecture for clang-tidy.Daniel Jasper2013-07-291-0/+61
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