summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/add_new_check.py
Commit message (Collapse)AuthorAgeFilesLines
* clang-tidy doc: Refresh the list of checkers and polish the scriptSylvestre Ledru2020-01-101-4/+2
|
* [clang-tidy] Refresh the add_new_check.py now that we use a table + autofixSylvestre Ledru2020-01-091-12/+67
| | | | | | | | | | | | Reviewers: alexfh Reviewed By: alexfh Subscribers: njames93, xazax.hun, mgorny, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D72421
* Updated add_new_check.py to create checker tests in the new directoryDmitri Gribenko2019-10-111-1/+1
| | | | llvm-svn: 374551
* Make add_new_check.py's insertion of registerCheck<> match the sort orderDaniel Sanders2019-08-301-20/+39
| | | | | | | | | | | | | | | | | Summary: Following on from review comments in D65919 about the ordering of the registerCheck<> calls. Sort based on the check name which might be on the line after the registerCheck<> Reviewers: aaron.ballman Subscribers: cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66505 llvm-svn: 370527
* [clang-tidy] Change the namespace for llvm checkers from 'llvm' to 'llvm_check'Don Hinton2019-05-101-10/+19
| | | | | | | | | | | | | | | | | | | | | | | Summary: Change the namespace for llvm checkers from 'llvm' to 'llvm_check', and modify add_new_check.py and rename_check.py to support the new namespace. Checker, file, and directory names remain unchanged. Used new version of rename_check.py to make the change in existing llvm checkers, but had to fix LLVMTidyModule.cpp and LLVMModuleTest.cpp by hand. The changes made by rename_check.py are idempotent, so if accidentally run multiple times, it won't do anything. Reviewed By: aaron.ballman Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D60629 llvm-svn: 360450
* [clang-tidy] Add fix descriptions to clang-tidy checks.Haojian Wu2019-04-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Motivation/Context: in the code review system integrating with clang-tidy, clang-tidy doesn't provide a human-readable description of the fix. Usually developers have to preview a code diff (before vs after apply the fix) to understand what the fix does before applying a fix. This patch proposes that each clang-tidy check provides a short and actional fix description that can be shown in the UI, so that users can know what the fix does without previewing diff. This patch extends clang-tidy framework to support fix descriptions (will add implementations for existing checks in the future). Fix descriptions and fixes are emitted via diagnostic::Note (rather than attaching the main warning diagnostic). Before this patch: ``` void MyCheck::check(...) { ... diag(loc, "my check warning") << FixtItHint::CreateReplacement(...); } ``` After: ``` void MyCheck::check(...) { ... diag(loc, "my check warning"); // Emit a check warning diag(loc, "fix description", DiagnosticIDs::Note) << FixtItHint::CreateReplacement(...); // Emit a diagnostic note and a fix } ``` Reviewers: sammccall, alexfh Reviewed By: alexfh Subscribers: MyDeveloperDay, Eugene.Zelenko, aaron.ballman, JonasToth, xazax.hun, jdoerfert, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D59932 llvm-svn: 358576
* [clang-tidy] ClangTidy.h -> ClangTidyCheck.hAlexander Kornienko2019-03-251-1/+1
| | | | llvm-svn: 356902
* Rename directory housing clang-include-fixer to be eponymousNico Weber2019-03-251-1/+1
| | | | | | | | | | | Makes the name of this directory consistent with the names of the other directories in clang-tools-extra. Similar to r356254. No intended behavior change. Differential Revision: https://reviews.llvm.org/D59750 llvm-svn: 356897
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-12/+9
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clang-tidy] insert release notes for new checkers alphabeticallyJonas Toth2018-12-101-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Almost all code review comments on new checkers {D55433} {D48866} {D54349} seem to ask for the release notes to be added alphabetically, plus I've seen commits by @Eugene.Zelenko reordering the lists Make add_new_check.py add those release notes alphabetically based on checker name If include-fixer section is seen add it at the end Minor change in the message format to prevent double newlines added before the checker. Do the tools themselves have unit tests? (sorry new to this game) - Tested adding new checker at the beginning - Tested on adding new checker in the middle - Tested on empty ReleasesNotes.rst (as we would see after RC) Patch by MyDeveloperDay. Reviewers: alexfh, JonasToth, curdeius, aaron.ballman, benhamilton, hokein Reviewed By: JonasToth Subscribers: cfe-commits, xazax.hun, Eugene.Zelenko Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D55508 llvm-svn: 348793
* [Clang-tidy] Alphabetical sort of files/checks. Add space after clang-tidy ↵Eugene Zelenko2018-09-201-4/+4
| | | | | | in source code headers. llvm-svn: 342601
* Add a trailing period in release notes.Alexander Kornienko2018-05-031-1/+1
| | | | llvm-svn: 331460
* [clang-tidy] Enable Python 3 support for add_new_check.pyJonathan Coe2018-03-241-16/+18
| | | | | | | | | | | | | | Summary: In Python 3, filters are lazily evaluated and strings are not bytes. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D44217 llvm-svn: 328418
* [clang-tidy] Use :doc: for check links in Release Notes.Eugene Zelenko2018-03-211-2/+2
| | | | | | Differential revision: https://reviews.llvm.org/D44694 llvm-svn: 328115
* [clang-tidy] Fix 'add_new_check.py --udpate-docs'Alexander Kornienko2018-02-281-0/+7
| | | | llvm-svn: 326321
* [clang-tidy] New argument --language to add_new_check.pyBen Hamilton2018-01-311-16/+33
| | | | | | | | | | | | | | | | | | | | | | Summary: Currently, add_new_check.py assumes all checks are for C++ code. This adds a new argument --language=[LANG] to add_new_check.py so authors of new checks can specify that the test file should be in a different language. For example, authors can pass --language=objc for Objective-C clang-tidy checks. Reviewers: hokein, alexfh Reviewed By: alexfh Subscribers: Wizard, xazax.hun Differential Revision: https://reviews.llvm.org/D39141 llvm-svn: 323919
* [clang-tidy] Actually fix header guard handling in scriptsAlexander Kornienko2017-11-251-1/+1
| | | | llvm-svn: 318971
* [clang-tidy] add_new_check.py updates ReleaseNotes.rst nowAlexander Kornienko2017-07-121-0/+32
| | | | llvm-svn: 307787
* [clang-tidy] Rename modernize-use-default to modernize-use-equals-defaultMalcolm Parsons2016-12-011-1/+6
| | | | | | | | | | Reviewers: angelgarcia, aaron.ballman, alexfh Subscribers: JDevlieghere, Prazek, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D26511 llvm-svn: 288375
* [clang-tidy] Remove redundant quote in add_new_check scriptEtienne Bergeron2016-05-301-1/+1
| | | | | | | | | | | | | | Summary: Remove redundant quote. These quotes were added here: http://reviews.llvm.org/D20766 Reviewers: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20792 llvm-svn: 271210
* [clang-tidy] Fix script adding new clang-tidy checkEtienne Bergeron2016-05-301-1/+1
| | | | | | | | | | | | | | Summary: The `getName()` call is useless. It's better to show a better example as tutorial. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20766 llvm-svn: 271207
* [clang-tidy] add_new_check.py should fail if check name starts with the ↵Alexander Kornienko2016-04-131-21/+30
| | | | | | | | module name + updated formatting llvm-svn: 266181
* [clang-tidy] ForRangeCopyCheck that warns on and fixes unnecessary copies of ↵Alexander Kornienko2016-01-291-5/+13
| | | | | | | | | | loop variables. Patch by Felix Berger! Differential revision: http://reviews.llvm.org/D13849 llvm-svn: 259199
* Add documentation redirects for clang-tidy checkers that are exposed under ↵Aaron Ballman2016-01-111-7/+17
| | | | | | multiple checker names. Updates the Python script for adding checks to properly handle these aliases. llvm-svn: 257347
* [clang-tidy] Don't generate duplicated blank line in add_new_check.py script.Alexander Kornienko2015-12-291-2/+0
| | | | | | | | | | | | Reviewers: alexfh Subscribers: cfe-commits Patch by Haojian Wu! Differential Revision: http://reviews.llvm.org/D15803 llvm-svn: 256554
* [clang-tidy] Updates to documentation: formatting, titles, etc.Alexander Kornienko2015-12-221-1/+3
| | | | llvm-svn: 256259
* [clang-tidy] Add namespace support to add_new_check.pyAlexander Kornienko2015-12-161-4/+10
| | | | | | | | | | | | | | Summary: Without namespace you can not create checks with same name in different modules Reviewers: alexfh Subscribers: cfe-commits Patch by Cong Liu! Differential Revision: http://reviews.llvm.org/D15571 llvm-svn: 255770
* clang-tidy/add_new_check.py: Adapt to use %check_clang_tidy in testsMatthias Gehre2015-10-261-1/+1
| | | | | | | | | | | | Summary: Adapt clang-tidy/add_new_check.py according to commit r251010 "Add %check_clang_tidy and %clang_tidy_diff" Reviewers: alexfh, sbenza, bkramer, aaron.ballman Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D14049 llvm-svn: 251355
* Change the write modes to "binary" so that line endings do not get munged on ↵Aaron Ballman2015-10-061-7/+7
| | | | | | Windows. Otherwise, when this script is run, all files created on Windows have CRLF instead of LF line endings. llvm-svn: 249444
* Add a new module for the C++ Core Guidelines, and the first checker for ↵Aaron Ballman2015-10-061-1/+2
| | | | | | | | those guidelines: cppcoreguidelines-pro-type-reinterpret-cast. Patch by Matthias Gehre! llvm-svn: 249399
* [clang-tidy] fix add_new_check.pyAlexander Kornienko2015-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Before this check, I would get the following error: Updating ./misc/CMakeLists.txt... Creating ./misc/NoReinterpret_castCheck.h... Creating ./misc/NoReinterpret_castCheck.cpp... Updating ./misc/MiscTidyModule.cpp... Creating ../test/clang-tidy/misc-no-reinterpret_cast.cpp... Creating ../docs/clang-tidy/checks/misc-no-reinterpret_cast.rst... Traceback (most recent call last): File "./add_new_check.py", line 271, in <module> main() File "./add_new_check.py", line 267, in main update_checks_list(module_path) File "./add_new_check.py", line 220, in update_checks_list os.listdir('docs/clang-tidy/checks'))) OSError: [Errno 2] No such file or directory: 'docs/clang-tidy/checks' Patch by Matthias Gehre! Differential revision: http://reviews.llvm.org/D13272 llvm-svn: 248997
* [clang-tidy] add_new_check.py improvements: add doc file, refer it from .hAlexander Kornienko2015-09-101-13/+59
| | | | | | + some console logging and minor cleanups. llvm-svn: 247282
* [clang-tidy] Fix add_new_check.py.Alexander Kornienko2015-09-041-2/+3
| | | | | | | | | | | | This fixes the case where the check should be added at the end of the list of checks in CMakeLists.txt of the corresponding module. Before it was added after LINK_LIBS line. http://reviews.llvm.org/D12629 Patch by Marek Kurdej! llvm-svn: 246854
* Tests no longer need the 'REQUIRES: SHELL' line.Angel Garcia Gomez2015-08-251-1/+0
| | | | | | | | | | | | Summary: Update python script, so that it doesn't print that line in new tests. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D12281 llvm-svn: 245926
* [clang-tidy] Use check_clang_tidy.py instead of check_clang_tidy.sh by default.Alexander Kornienko2015-08-201-1/+1
| | | | llvm-svn: 245586
* [clang-tidy] Extended the example check, added a fix-it, etc.Alexander Kornienko2014-12-091-12/+23
| | | | llvm-svn: 223771
* clang-tidy: Add a basic python script to generate checks.Daniel Jasper2014-12-091-0/+214
There are still a vast range of improvements that can be done to this, but it seems like an ok initial version. Suggestions or patches are highly welcome. llvm-svn: 223766
OpenPOWER on IntegriCloud