summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-tidy
Commit message (Collapse)AuthorAgeFilesLines
* Fix Clang-tidy modernize-use-override warning in ↵Eugene Zelenko2016-01-261-2/+1
| | | | | | | | unittests/clang-tidy/IncludeInserterTest.cpp; other minor fixes. Differential revision: http://reviews.llvm.org/D16566 llvm-svn: 258870
* Remove autoconf supportChris Bieneman2016-01-261-30/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "Now I am become Death, the destroyer of worlds." -J. Robert Oppenheimer Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D16475 llvm-svn: 258864
* Revert "Apply modernize-use-default to clang-tools-extra."David Blaikie2015-10-201-1/+1
| | | | | | | | | 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. llvm-svn: 250862
* Apply modernize-use-default to clang-tools-extra.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13889 llvm-svn: 250824
* Fix overlapping replacements in clang-tidy.Angel Garcia Gomez2015-10-161-43/+73
| | | | | | | | | | | | Summary: Prevent clang-tidy from applying fixes to errors that overlap with other errors' fixes, with one exception: if one fix is completely contained inside another one, then we can apply the big one. Reviewers: bkramer, klimek Subscribers: djasper, cfe-commits, alexfh Differential Revision: http://reviews.llvm.org/D13516 llvm-svn: 250509
* [VFS] Switch clang-tidy tests to use an in-memory fs.Benjamin Kramer2015-10-071-4/+8
| | | | | | | Again, this is both cleaner and completely removes any depedency on the host file system. llvm-svn: 249526
* Create interfaces and tests for the overlapping replacements fix in clang-tidy.Angel Garcia Gomez2015-10-064-9/+413
| | | | | | | | | | | | Summary: No changes in clang-tidy yet. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13469 llvm-svn: 249402
* [clang-tidy] Fix PR22785.Alexander Kornienko2015-09-091-0/+21
| | | | | | | | | | | Fix http://llvm.org/PR22785. Bug 22785 - readability-braces-around-statements doesn't work well with macros. http://reviews.llvm.org/D12729 Patch by Marek Kurdej! llvm-svn: 247163
* Move some more functionality into the AST consumer creation factory ↵Aaron Ballman2015-09-021-3/+6
| | | | | | function, before registering matchers with the MatchFinder object. This allows us to set the language options for the ClangTidyContext object appropriately so that they can be used from registerMatchers(), and more closely models the way the clang-tidy tool works. llvm-svn: 246660
* Remove empty destructors added in r245500. I got confused by myDaniel Jasper2015-08-191-4/+0
| | | | | | | YouCompleteMe setup which apparently doesn't find the base classes and thus doesn't understand that there is an implicit virtual destructor. llvm-svn: 245510
* Fix IncludeInserter to allow for more than one added header per file.Daniel Jasper2015-08-191-46/+83
| | | | | | | | Also adapt tests a bit to make it possible to test this. Removed checking the number of errors reported per test. It was never actually checked and doesn't seem particularly relevant to the test itself. llvm-svn: 245500
* [clang-tidy] Move IncludeSorter.* and IncludeInserter.* to clang-tidy/utils/Alexander Kornienko2015-08-141-1/+1
| | | | | | | This is better structurally and it also fixes a linker error in the configure build. llvm-svn: 245052
* [clang-tidy] Don't use delegating constructors.Alexander Kornienko2015-08-141-2/+3
| | | | llvm-svn: 245046
* [clang-tidy] Fix IncludeInserter/IncludeSorter bug.Alexander Kornienko2015-08-141-0/+73
| | | | | | | | | | | If there weren't any includes in the file, or all of them had 'IncludeKind' greater than the desired one, then 'CreateIncludeInsertion' didn't work. http://reviews.llvm.org/D12017 Patch by Angel Garcia! llvm-svn: 245042
* Fix formatting.Manuel Klimek2015-08-131-1/+1
| | | | llvm-svn: 244876
* Reinstantiate better diagnostic, this time with a fatal error so we don't ↵Manuel Klimek2015-08-121-2/+7
| | | | | | add a dependency onto gtest from the header. llvm-svn: 244722
* Revert the diagnostic improvements in r244602 as they introduced a ↵David Blaikie2015-08-111-9/+1
| | | | | | | | | | problematic dependency Seems we had some internal uses that include ClangTidyTest.h and weren't ready for a gtest dependency. Reverting to give Manuel some time to look into it. llvm-svn: 244658
* 1. Disable tests that currently cannot work on windows due to missing path ↵Manuel Klimek2015-08-112-34/+54
| | | | | | | | canonicalization in the file manager. 2. Add better output when a clang-tidy unit test fails so it's clear what the error is. llvm-svn: 244602
* Also ClangTidyTests requires clangLex.NAKAMURA Takumi2015-08-111-0/+1
| | | | llvm-svn: 244599
* Do not use inheriting constructors.Manuel Klimek2015-08-111-3/+6
| | | | llvm-svn: 244597
* Default initialize from explicitly constructed object.Manuel Klimek2015-08-111-2/+3
| | | | llvm-svn: 244596
* Add an IncludeInserter to clang-tidy.Manuel Klimek2015-08-113-1/+416
| | | | | | Will be used to allow checks to insert includes at the right position. llvm-svn: 244586
* [clang-tidy] Set current main file name in tests.Alexander Kornienko2015-07-271-0/+1
| | | | llvm-svn: 243272
* [clang-tidy] Force braces around leaf 'else if' for consistency.Samuel Benzaquen2015-06-041-0/+13
| | | | | | | | | | | | | | Summary: Force braces around leaf 'else if' for consistency. This complements r233697. Reviewers: alexfh Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D10245 llvm-svn: 239054
* Force braces on the else branch if they are being added to the if branch.Samuel Benzaquen2015-03-312-5/+27
| | | | | | | | | | | | | | Summary: Force braces on the else branch if they are being added to the if branch. This ensures consistency in the transformed code. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8708 llvm-svn: 233697
* Fix false positive on anonymous namespaces in headers.Samuel Benzaquen2015-03-241-0/+4
| | | | | | | | | | | | | | | | Summary: Anynoumous namespaces inject a using directive into the AST to import the names into the containing namespace. We should not have them in headers, but there is another warning for that. Reviewers: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8443 llvm-svn: 233087
* [clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC.Alexander Kornienko2015-03-091-3/+3
| | | | | | | | | | 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) llvm-svn: 231669
* [clang-tidy] Slighly clarified a comment.Alexander Kornienko2015-03-051-1/+2
| | | | llvm-svn: 231370
* [clang-tidy] Replace unrecognized namespace ending comments.Alexander Kornienko2015-03-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | Summary: Replace unrecognized namespace ending comments. This will help in particular when a namespace ending comment is mistyped or doesn't fit the regexp for other reason, e.g.: namespace a { namespace b { namespace { } // anoynmous namespace } // b } // namesapce a Reviewers: djasper Reviewed By: djasper Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D8078 llvm-svn: 231369
* [clang-tidy] Refactor: Move google clang-tidy checks to namespace ↵Alexander Kornienko2015-03-051-0/+2
| | | | | | | | | | clang::tidy::google http://reviews.llvm.org/D7994 Patch by Richard Thomson! llvm-svn: 231364
* clang-tidy: Update test as underlying problem apparently was fixed.Daniel Jasper2015-03-021-2/+1
| | | | llvm-svn: 230982
* [clang-tidy] Refactor: Move llvm clang-tidy checks to namespace ↵Alexander Kornienko2015-03-021-0/+2
| | | | | | | | | | | | | clang::tidy::llvm clang-tidy checks are organized into modules. This refactoring moves the llvm module checks to clang::tidy::llvm http://reviews.llvm.org/D7995 Patch by Richard Thomson! llvm-svn: 230952
* [clang-tidy] Refactor: Move misc clang-tidy checks to namespace ↵Alexander Kornienko2015-03-021-0/+2
| | | | | | | | | | | | | clang::tidy::misc clang-tidy checks are organized into modules. This refactoring moves the misc module checks into the namespace clang::tidy::misc http://reviews.llvm.org/D7996 Patch by Richard Thomson! llvm-svn: 230950
* [clang-tidy] Organized clang-tidy unit tests. NFC.Alexander Kornienko2015-03-024-338/+333
| | | | | | | | | * Moved unit tests for BracesAroundStatementsCheck to ReadabilityModuleTest.cpp. * Moved EXPECT_NO_CHANGES macro to ClangTidyTest.h to avoid defining it three times. llvm-svn: 230947
* Revert "Adapt clang-tools-extra to clang module format changes."Adrian Prantl2015-02-251-3/+2
| | | | | | This reverts commit 230424. llvm-svn: 230456
* Adapt clang-tools-extra to clang module format changes.Adrian Prantl2015-02-251-2/+3
| | | | | | | - add clangCodeGen.a to the tools that need it - tweak pp-trace command line handling to not conflict with clang's. llvm-svn: 230424
* Revert "Adapt Makefile dependencies for the clang module format change in ↵Adrian Prantl2015-02-211-3/+3
| | | | | | r230089." llvm-svn: 230104
* Adapt Makefile dependencies for the clang module format change in r230089.Adrian Prantl2015-02-201-3/+3
| | | | llvm-svn: 230090
* Add clang-tidy check google-global-names-in-headers.Samuel Benzaquen2015-02-111-0/+46
| | | | | | | | | | | | | | 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
* [CMake] Add dependencies on clangToolingCore.NAKAMURA Takumi2014-10-301-0/+1
| | | | llvm-svn: 220890
* Fix Makefiles after r220867.Daniel Jasper2014-10-291-1/+2
| | | | llvm-svn: 220868
* [clang-tidy] Bring order to check registration.Alexander Kornienko2014-10-262-4/+4
| | | | | | | | | | | | | | | | 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] Minor fixes for the NamespaceCommentCheck.Alexander Kornienko2014-10-161-0/+8
| | | | | | | | * Make SmallVector size enough for all groups. * Allow trailing period in the comment. * Fix "// anonymous namespace qqq". llvm-svn: 219926
* Fix llvm-header-guard check.Alexander Kornienko2014-10-151-3/+13
| | | | | | | | | | | | | | | | | Summary: This patch makes the check work better for LLVM code: * always fix existing #endif comments * use one space before the comment (+allow customization for other styles) Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5795 llvm-svn: 219789
* Reformatted code samples in the unit test. No functional changes.Alexander Kornienko2014-10-151-64/+111
| | | | llvm-svn: 219788
* [clang-tidy] Move some of the misc checks to readability/Alexander Kornienko2014-10-151-1/+4
| | | | | | | | | | | | | | | | | | | Summary: Some of the misc checks belong to readability/. I'm moving them there without changing check names for now. As the next step, I want to register some of these checks in the google and llvm modules with suitable settings (e.g. BracesAroundStatementsCheck). I'm not sure if we want to create a "readability" module, probably not. Reviewers: djasper Reviewed By: djasper Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D5792 llvm-svn: 219786
* Small cleanups from review comments.Manuel Klimek2014-10-091-5/+3
| | | | llvm-svn: 219409
* Make clang-tidy's runCheckOnCode actually use the DiagnosticConsumer.Manuel Klimek2014-10-072-19/+27
| | | | | | | | | A precondition of that was to run both the preprocessor checks and AST checks from the same FrontendAction, otherwise we'd have needed to duplicate all involved objects in order to not have any references to a deleted source manager. llvm-svn: 219212
* [clang-tidy] Add check misc-braces-around-statements.Alexander Kornienko2014-10-021-0/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | This check looks for if statements and loops: for, range-for, while and do-while, and verifies that the inside statements are inside braces '{}'. If not, proposes to add braces around them. Example: if (condition) action(); becomes if (condition) { action(); } This check ought to be used with the -format option, so that the braces be well-formatted. Patch by Marek Kurdej! http://reviews.llvm.org/D5395 llvm-svn: 218898
* Provide user name in ClangTidyOptions.Alexander Kornienko2014-09-241-9/+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
OpenPOWER on IntegriCloud