summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] remove default header-filter for run-clang-tidyDon Hinton2019-05-221-3/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: run-clang-tidy.py was enforcing '-header-filter' parameter with an unfortunate default value when none was given. Thus, leading to overwritten clang-tidy configuration (e.g. from .clang-tidy). This change removes the default value for '-header-filter' resulting in the default behaviour of clang-tidy itself. Fixes PR#41426 Reviewed By: hintonda Patch by Torbjörn Klatt! Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D61747 llvm-svn: 361344
* [clang-tidy] Removed superfluous and slightly annoying newlines in ↵Jonas Toth2019-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | run-clang-tidy's output. Summary: The output of clang-tidy itself already has enough newlines, so the resulting output is more in line with the usual compiler output. Patch by svenpanne. Reviewers: alexfh, JonasToth Reviewed By: JonasToth Subscribers: JonasToth, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61850 llvm-svn: 360883
* [clang-tidy] Do not list enabled checks when -quiet is given to run-clang-tidy.Jonas Toth2019-05-161-1/+6
| | | | | | | | | | | | | | | | | | Summary: When run-clang-tidy is given the -quiet flag, do not output the potentially hundreds of enabled check names at the beginning. Patch by svenpanne. Reviewers: alexfh, JonasToth Reviewed By: JonasToth Subscribers: JonasToth, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61849 llvm-svn: 360869
* ClangTidy: Avoid mixing stdout with stderror when dealing with a large ↵Andi-Bogdan Postelnicu2019-04-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | number of files. Summary: At Mozilla we are using this tool in order to perform review-time static-analysis, since some patches contain a large number of files we've discovered this issue, where `stderr` gets mixed with `stdout` thus obfuscating our possibility to parse the output. The patch that we are currently use can be found [here](https://searchfox.org/mozilla-central/source/build/build-clang/clang-tidy-8.patch). This is just an upstream of the original patch. Reviewers: JonasToth Reviewed By: JonasToth Subscribers: cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D60453 llvm-svn: 357994
* [clang-tidy] Handle missing yaml module in run-clang-tidy.pyZinovy Nis2019-03-271-6/+11
| | | | | | | | | | | | The Yaml module is missing on some systems and on many of clang buildbots. But the test for run-clang-tidy.py doesn't fail due to 'NOT' statement masking a python runtime error. This patch conditionally imports and enables the yaml module only if it's present in the system. If not, then '-export-fixes' is disabled. Differential Revision: https://reviews.llvm.org/D59734 llvm-svn: 357114
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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] run-clang-tidy.py - fails using python 3.7Andi-Bogdan Postelnicu2018-09-191-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D51220 llvm-svn: 342540
* [clang-tidy] run-clang-tidy.py - add synchronisation to the outputAndi-Bogdan Postelnicu2018-08-101-5/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D49851 llvm-svn: 339427
* run-clang-tidy: forward clang-tidy exit statusMiklos Vajna2018-03-191-4/+10
| | | | | | | | | | | | | | | | | | | | | Exit with a non-zero value in case any of the underlying clang-tidy invocations exit with a non-zero value. This is useful in case WarningsAsErrors is enabled for some of the checks: if any of those checks find something, the exit status now reflects that. Also add the ability to use run-clang-tidy.py via lit, and assert that the exit code is not 0 when modernize-use-auto is triggered intentionally. Reviewers: alexfh, aaron.ballman Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D44366 llvm-svn: 327854
* [clang-tidy] Update run-clang-tidy.py with config argJulie Hockett2018-03-091-2/+13
| | | | | | | | | Updating the run-clang-tidy.py script to allow specification of the config argument to the clang-tidy invocation. Differential Revision: https://reviews.llvm.org/D43538 llvm-svn: 327186
* run-clang-tidy: Use check_call instead of check_outputKevin Funk2017-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Streamlines the output under Python 3.x. Before: ``` b'Enabled checks:\n clang-analyzer-apiModeling.google.GTest\n ... ``` After: ``` Enabled checks: clang-analyzer-apiModeling.google.GTest ... ``` Reviewers: cfe-commits, alexfh Reviewed By: alexfh Subscribers: JDevlieghere Differential Revision: https://reviews.llvm.org/D37482 Change-Id: I6287104bc73926ae6d0f66c15c250c3cb44bee33 llvm-svn: 319148
* [clang-tidy] Support relative paths in run-clang-tidy.pyGabor Horvath2017-11-061-1/+8
| | | | | | | | | | Unfortunately, these python scripts are not tested currently. I did the testing manually on LLVM by editing the CMake generated compilation database to contain relative paths for some of the files. Differential Revision: https://reviews.llvm.org/D39603 llvm-svn: 317468
* Make run-clang-tidy compatible with Python 3.xKevin Funk2017-09-051-5/+11
| | | | | | | | | | | | | | | Reviewers: alexfh Reviewed By: alexfh Subscribers: cfe-commits, JDevlieghere Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D37138 Change-Id: I89a95d1e082e566e7e64c2a5ca4123c543e6b1be llvm-svn: 312532
* [clang-tidy] Add option to export fixes to run-clang-tidy.pyAlexander Kornienko2017-07-211-8/+46
| | | | | | | | | | | | | | | This patch adds the option to keep the list of proposed fixes even though they should not be applied. This allows to detect possible fixes using the parallelised run-clang-tidy.py and apply them using clang-apply-replacements at a later time. Essentially the patch causes the individual temporary yaml files by the parallel clang-tidy instances to be merged into one user-defined file. Patch by Michael F. Herbst! Differential revision: https://reviews.llvm.org/D31326 llvm-svn: 308726
* [clang-tidy] D33930: Do not pick up by default the LLVM style if passing ↵Vassil Vassilev2017-06-091-0/+4
| | | | | | | | | -format. This adds a new flag -style which is passed to clang-apply-replacements and defaults to file meaning it would pick up the closest .clang-format file in tree. llvm-svn: 305125
* [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeedsJakub Kuderski2017-04-251-7/+31
| | | | | | | | | | | | | | | | | | | | | | Summary: When running run-clang-tidy.py with -fix it tries to apply found replacements at the end. If there are errors running clang-apply-replacements, the script currently crashes or displays no error at all. This patch checks for errors running clang-apply-replacements the same way clang-tidy binary is handled. Another option would be probably checking for clang-apply-replacements (when -fix is passed) even before running clang-tidy. Reviewers: Prazek, alexfh, bkramer, mfherbst Reviewed By: Prazek, alexfh Subscribers: kimgr, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D32294 llvm-svn: 301365
* [clang-tidy] Don't use groups in the big regexy filterAlexander Kornienko2017-03-231-1/+1
| | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=27641. llvm-svn: 298619
* [clang-tidy] Add -quiet option to suppress extra outputEhsan Akhgari2017-02-091-2/+7
| | | | | | | | | | | | | | | Summary: This new flag instructs clang-tidy to not output anything except for errors and warnings. This makes it easier to script clang-tidy to run as part of external build systems. Reviewers: bkramer, alexfh, klimek Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29661 llvm-svn: 294607
* [clang-tidy] Add -extra-arg and -extra-arg-before to run-clang-tidy.pyEhsan Akhgari2017-01-181-2/+15
| | | | | | | | | | | | Summary: These flags allow specifying extra arguments to the tool's command line which don't appear in the compilation database. Reviewers: alexfh Differential Revision: https://reviews.llvm.org/D28334 llvm-svn: 292415
* [clang-tidy] add option to specify build pathGuillaume Papin2015-09-281-4/+11
| | | | | | | | | | | | | | | | | | Summary: compile_commands.json is usually generated in the build directory. Projects like LLVM/Clang enforce out-of-source builds. This option allow allow such projects to work out of the box, without moving the compilation database manually. The naming of the option is similar to the one use by other tools: clang-{check,modernize,query,rename,tidy} -p=<build_path> <...> Reviewers: alexfh Differential Revision: http://reviews.llvm.org/D13199 llvm-svn: 248723
* [clang-tidy] Fix run-clang-tidy.py.Alexander Kornienko2015-09-081-2/+2
| | | | | | | | | | | | Do not add "-*" to the list of checks. Make consistent the list of enabled checks and the checks in use. Moreover, removing "-*" makes the behaviour consistent with clang-tidy and allows user to use .clang-tidy configuration... http://reviews.llvm.org/D12687 Patch by Marek Kurdej! llvm-svn: 247002
* run-clang-tidy.py: don't fail when running without -checks=.Alexander Kornienko2014-09-221-2/+5
| | | | llvm-svn: 218227
* 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
OpenPOWER on IntegriCloud