summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Add a readability-deleted-default clang-tidy check.Alexander Kornienko2016-04-131-0/+3
| | | | | | | | | | | Checks if constructors and assignment operators that are marked '= default' are actually deleted by the compiler. Patch by Alex Pilkiewicz! Differential Revision: http://reviews.llvm.org/D18961 llvm-svn: 266190
* [clang-tidy] Add a check to detect static definitions in anonymous namespace.Haojian Wu2016-04-051-0/+3
| | | | | | | | | | | | Summary: Fixes PR26595 Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18180 llvm-svn: 265384
* [clang-tidy] readability check for const params in declarationsAlexander Kornienko2016-03-301-0/+3
| | | | | | | | | | | | | | Summary: Adds a clang-tidy warning for top-level consts in function declarations. Reviewers: hokein, sbenza, alexfh Subscribers: cfe-commits Patch by Matt Kulukundis! Differential Revision: http://reviews.llvm.org/D18408 llvm-svn: 264856
* Add a new check, readability-redundant-string-init, that checks unnecessary ↵Alexander Kornienko2016-02-251-0/+3
| | | | | | | | | | | | | | string initializations. Reviewers: hokein, alexfh Subscribers: cfe-commits Patch by Shuai Wang! Differential Revision: http://reviews.llvm.org/D17586 llvm-svn: 261939
* Sort checks alphabetically in ReadabilityTidyModule.cpp.Eugene Zelenko2016-02-011-4/+4
| | | | llvm-svn: 259393
* Add a new check, readability-redundant-control-flow, that check for some ↵Aaron Ballman2016-02-011-0/+3
| | | | | | | | forms of redundant control flow statements. Currently checks for return statements at the end of a function with a void return type and continue statements at the end of looping statements. Patch by Richard Thomson. llvm-svn: 259362
* [clang-tidy] Add check readability-implicit-bool-castPiotr Dziwinski2015-10-251-0/+3
| | | | | | | | | | | | | | | | | | | | | Summary: This is another check that I ported to clang-tidy from colobot-lint tool. As previously discussed on cfe-dev mailing list, this is one of those checks that I think is general and useful enough for contribution to clang-tidy. This patch contains implementation of check taken from colobot-lint, but it is extended a great deal, including FixIt hints for automated refactoring, exhaustive testcases, and user documentation. Reviewers: sbenza, aaron.ballman, alexfh Subscribers: Eugene.Zelenko Differential Revision: http://reviews.llvm.org/D13635 llvm-svn: 251235
* Added check uniqueptr-delete-release to replace "delete x.release()" with "x ↵Samuel Benzaquen2015-10-191-0/+3
| | | | | | | | | | = nullptr" Reviewers: alexfh Differential Revision: http://reviews.llvm.org/D13179 llvm-svn: 250742
* [clang-tidy] Add inconsistent declaration parameter name checkAlexander Kornienko2015-09-101-0/+3
| | | | | | | | | | | | | | | | | | | | This is first of series of patches, porting code from my project colobot-lint, as I mentioned recently in cfe-dev mailing list. This patch adds a new check in readability module: readability-inconsistent-declaration-parameter-name. I also added appropriate testcases and documentation. I chose readability module, as it seems it is the best place for it. I think I followed the rules of LLVM coding guideline, but I may have missed something, as I usually use other code formatting style. http://reviews.llvm.org/D12462 Patch by Piotr Dziwinski! llvm-svn: 247261
* [clang-tidy] Move misc-use-override and readability-shrink-to-fit to ↵Alexander Kornienko2015-08-311-3/+0
| | | | | | | | | "modernize/" These checks are focusing on migrating the code from C++98/03 to C++11, so they belong to the modernize module. llvm-svn: 246437
* [clang-tidy] Add new IdentifierNaming checkAlexander Kornienko2015-08-191-0/+3
| | | | | | | | | | | | | | | | | | | | This check will try to enforce coding guidelines on the identifiers naming. It supports lower_case, UPPER_CASE, camelBack and CamelCase casing and tries to convert from one to another if a mismatch is detected. It also supports a fixed prefix and suffix that will be prepended or appended to the identifiers, regardless of the casing. Many configuration options are available, in order to be able to create different rules for different kind of identifier. In general, the rules are falling back to a more generic rule if the specific case is not configured. http://reviews.llvm.org/D10933 Patch by Beren Minor! llvm-svn: 245429
* [clang-tidy] Add readability-simplify-boolean-expr check to clang-tidyAlexander Kornienko2015-04-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This check looks for comparisons between boolean expressions and boolean constants and simplifies them to just use the appropriate boolean expression directly. if (b == true) becomes if (b) if (b == false) becomes if (!b) if (b && true) becomes if (b) if (b && false) becomes if (false) if (b || true) becomes if (true) if (b || false) becomes if (b) e ? true : false becomes e e ? false : true becomes !e if (true) t(); else f(); becomes t(); if (false) t(); else f(); becomes f(); if (e) return true; else return false; becomes return (e); if (e) return false; else return true; becomes return !(e); if (e) b = true; else b = false; becomes b = e; if (e) b = false; else b = true; becomes b = !(e); http://reviews.llvm.org/D7648 Patch by Richard Thomson! llvm-svn: 234626
* [clang-tidy] Move google-readability-function check to ↵Alexander Kornienko2015-03-161-0/+3
| | | | | | | | | | | | | | | | 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
* Move remove-cstr-calls from a standalone executable to a clang-tidy check ↵Alexander Kornienko2015-03-161-7/+9
| | | | | | | | | | readability-redundant-string-cstr http://reviews.llvm.org/D7318 Patch by Richard Thomson! llvm-svn: 232338
* [clang-tidy] Refactor: Rename clang-tidy readability check files and classes ↵Alexander Kornienko2015-03-091-4/+4
| | | | | | | | | | | | | 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] Use shrink_to_fit instead of copy and swap trickAlexander Kornienko2015-01-231-0/+3
| | | | | | | | | | | | | | | | The shrink_to_fit() method is more readable and more effective than the copy and swap trick to reduce the capacity of a shrinkable container. Note that, the shrink_to_fit() method is only available in C++11 and up. Example: std::vector<int>(v).swap(v); will be replaced with v.shrink_to_fit(); http://reviews.llvm.org/D7087 Patch by Gábor Horváth! llvm-svn: 226912
* clang-tidy: 'size' call that could be replaced with 'empty' on STL containersAlexander Kornienko2015-01-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We are porting some of the checkers at a company we developed to the Clang Tidy infrastructure. We would like to open source the checkers that may be useful for the community as well. This patch is the first checker that is being ported to Clang Tidy. We also added fix-it hints, and applied them to LLVM: http://reviews.llvm.org/D6924 The code compiled and the unit tests are passed after the fixits was applied. The documentation of the checker: /// The emptiness of a container should be checked using the empty method /// instead of the size method. It is not guaranteed that size is a /// constant-time function, and it is generally more efficient and also shows /// clearer intent to use empty. Furthermore some containers may implement the /// empty method but not implement the size method. Using empty whenever /// possible makes it easier to switch to another container in the future. It also uses some custom ASTMatchers. In case you find them useful I can submit them as separate patches to clang. I will apply your suggestions to this patch. http://reviews.llvm.org/D6925 Patch by Gábor Horváth! llvm-svn: 226172
* clang-tidy: Add initial check for "Don't use else after return".Daniel Jasper2015-01-141-0/+3
| | | | | | | | | | | As per the LLVM coding standards: http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return Initial version, probably still quite a bit to do until this is really useful. Review: http://reviews.llvm.org/D6927 llvm-svn: 226025
* [clang-tidy] Bring order to check registration.Alexander Kornienko2014-10-261-0/+44
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
OpenPOWER on IntegriCloud