summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy/index.rst
Commit message (Collapse)AuthorAgeFilesLines
* doc: Document that extra-arg/extra-arg-before can be used several timesSylvestre Ledru2019-12-241-0/+2
| | | | Hopefully, it will help other people
* Fixed two issues in clang-tidy -help.Alexander Kornienko2019-07-011-105/+105
| | | | | | HeaderFilter -> HeaderFilterRegex llvm-svn: 364837
* [clang-tidy] Recommit r360785 "modernize-loop-convert: impl const cast iter" ↵Don Hinton2019-05-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with correct attribution Summary: modernize-loop-convert was not detecting implicit casts to const_iterator as convertible to range-based loops: std::vector<int> vec{1,2,3,4} for(std::vector<int>::const_iterator i = vec.begin(); i != vec.end(); ++i) { } Thanks to Don Hinton for advice. As well, this change adds a note for this check's applicability to code targeting OpenMP prior version 5 as this check will continue breaking compilation with `-fopenmp`. Thanks to Roman Lebedev for pointing this out. Fixes PR#35082 Patch by Torbjörn Klatt! Reviewed By: hintonda Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D61827 llvm-svn: 360788
* Revert [clang-tidy] modernize-loop-convert: impl const cast iterDon Hinton2019-05-151-2/+0
| | | | | | This reverts r360785 (git commit 42d28be802fe5beab18bc1a27f89894c0a290d44) llvm-svn: 360787
* [clang-tidy] modernize-loop-convert: impl const cast iterDon Hinton2019-05-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: modernize-loop-convert was not detecting implicit casts to const_iterator as convertible to range-based loops: std::vector<int> vec{1,2,3,4} for(std::vector<int>::const_iterator i = vec.begin(); i != vec.end(); ++i) { } Thanks to Don Hinton for advice. As well, this change adds a note for this check's applicability to code targeting OpenMP prior to version 5 as this check will continue breaking compilation with `-fopenmp`. Thanks to Roman Lebedev for pointing this out. Fixes PR#35082 Reviewed By: hintonda Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D61827 llvm-svn: 360785
* [clang-tidy] A new OpenMP moduleRoman Lebedev2019-03-221-0/+1
| | | | | | | | | | | | | | | | | | Summary: Just the empty skeleton. Previously reviewed as part of D57113. Reviewers: JonasToth, aaron.ballman, alexfh, xazax.hun, hokein, gribozavr Reviewed By: JonasToth, gribozavr Subscribers: jdoerfert, mgorny, rnkovacs, guansong, arphaman, cfe-commits Tags: #clang-tools-extra, #openmp, #clang Differential Revision: https://reviews.llvm.org/D57571 llvm-svn: 356800
* [clang-tidy] Fix links in docs.Alexander Kornienko2019-02-181-5/+6
| | | | llvm-svn: 354266
* [clang-tidy] Expand and clarify the NOLINT documentation a bit.Alexander Kornienko2019-02-071-11/+32
| | | | llvm-svn: 353382
* [Documentation] Use HTTPS whenever possible.Eugene Zelenko2019-01-221-3/+3
| | | | | | Differential revision: https://reviews.llvm.org/D56926 llvm-svn: 351862
* [clang-tidy] Fix whitespace in docs. NFCAlexander Kornienko2019-01-221-15/+14
| | | | | | Actually, just testing commits via monorepo ;) llvm-svn: 351814
* [Documentation] Add a chapter about Clang-tidy integrations.Eugene Zelenko2019-01-171-508/+2
| | | | | | | | Patch by Marina Kalashina. Differential Revision: https://reviews.llvm.org/D54945 llvm-svn: 351463
* [clang-tidy] Add a separate section for NOLINT(NEXTLINE)? doc.Alexander Kornienko2018-10-231-7/+10
| | | | llvm-svn: 345049
* [clang-tidy][docs] Update docs for `--check-suffixes`Zinovy Nis2018-10-091-3/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D52971 llvm-svn: 344016
* [clang-tidy] Build it even without static analyzerStephen Kelly2018-10-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | Conditionally compile the parts of clang-tidy which depend on the static analyzer. Funnily enough, I made the patch to exclude this from the build in 2013, and it was committed with the comment that the tool should not be fully excluded, but only the parts of it which depend on the analyzer should be excluded. http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130617/081797.html This commit implements that idea. Reviewed By: aaron.ballman Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52334 llvm-svn: 343528
* Reverting r343415 as it breaks at least one of the bots.Aaron Ballman2018-09-301-4/+0
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/37336 llvm-svn: 343418
* Allow clang-tidy to be built without a dependency on the clang static analyzer.Aaron Ballman2018-09-301-0/+4
| | | | | | Patch by Stephen Kelly. llvm-svn: 343415
* [clang-tidy] Add Abseil prefix to documentationHaojian Wu2018-08-221-0/+1
| | | | | | | | | | | | | | | | | | Summary: Adds the Abseil prefix to the list of prefixes in the documentation Patch by Deanna Garcia! Reviewers: aaron.ballman, hokein Reviewed By: hokein Subscribers: xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D51100 llvm-svn: 340412
* [clang-tidy] check_clang_tidy.py: support CHECK-NOTES prefixRoman Lebedev2018-08-101-1/+2
| | | | | | | | | | | | | | | | | | | | Summary: Currently, there is two configured prefixes: `CHECK-FIXES` and `CHECK-MESSAGES` `CHECK-MESSAGES` checks that there are no test output lines with `warning:|error:`, which are not explicitly handled in lit tests. However there does not seem to be a nice way to enforce for all the `note:` to be checked. This was useful for me when developing D36836. Reviewers: alexfh, klimek, aaron.ballman, hokein Reviewed By: alexfh, aaron.ballman Subscribers: JonasToth, JDevlieghere, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D36892 llvm-svn: 339437
* [clang-tidy] Store checks profiling info as JSON filesRoman Lebedev2018-06-061-99/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Continuation of D46504. Example output: ``` $ clang-tidy -enable-check-profile -store-check-profile=. -checks=-*,readability-function-size source.cpp $ # Note that there won't be timings table printed to the console. $ cat *.json { "file": "/path/to/source.cpp", "timestamp": "2018-05-16 16:13:18.717446360", "profile": { "time.clang-tidy.readability-function-size.wall": 1.0421266555786133e+00, "time.clang-tidy.readability-function-size.user": 9.2088400000005421e-01, "time.clang-tidy.readability-function-size.sys": 1.2418899999999974e-01 } } ``` There are two arguments that control profile storage: * `-store-check-profile=<prefix>` By default reports are printed in tabulated format to stderr. When this option is passed, these per-TU profiles are instead stored as JSON. If the prefix is not an absolute path, it is considered to be relative to the directory from where you have run :program:`clang-tidy`. All `.` and `..` patterns in the path are collapsed, and symlinks are resolved. Example: Let's suppose you have a source file named `example.cpp`, located in `/source` directory. * If you specify `-store-check-profile=/tmp`, then the profile will be saved to `/tmp/<timestamp>-example.cpp.json` * If you run :program:`clang-tidy` from within `/foo` directory, and specify `-store-check-profile=.`, then the profile will still be saved to `/foo/<timestamp>-example.cpp.json` Reviewers: alexfh, sbenza, george.karpenkov, NoQ, aaron.ballman Reviewed By: alexfh, george.karpenkov, aaron.ballman Subscribers: Quuxplusone, JonasToth, aaron.ballman, llvm-commits, rja, Eugene.Zelenko, xazax.hun, mgrang, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D46602 llvm-svn: 334101
* [clang-tidy] Remove AnalyzeTemporaryDtors option.Alexander Kornienko2018-05-031-6/+0
| | | | | | | | Remove the `AnalyzeTemporaryDtors` option, since the corresponding `cfg-temporary-dtors` option of the Static Analyzer defaults to `true` since r326461. llvm-svn: 331456
* [clang-tidy] Customize FileCheck prefix in check_clang-tidy.pyZinovy Nis2018-04-211-0/+21
| | | | | | | | | | | | | | | | | | | The patch introduces a new command line option '-check-suffix' for check_clang_tidy.py to allow multiple %check_clang_tidy% in a single test file. Sample: // RUN: %check_clang_tidy -check-suffix=FLAG-1 %s misc-unused-using-decls %t -- -- <options-set-1> // RUN: %check_clang_tidy -check-suffix=FLAG-2 %s misc-unused-using-decls %t -- -- <options-set-2> ... +// CHECK-MESSAGES-FLAG-1: :[[@LINE-4]]:10: warning: using decl 'B' is unused [misc-unused-using-decls] +// CHECK-MESSAGES-FLAG-2: :[[@LINE-7]]:10: warning: using decl 'A' is unused [misc-unused-using-decls] +// CHECK-FIXES-FLAG-1-NOT: using a::A;$ +// CHECK-FIXES-FLAG-2-NOT: using a::B;$ Differential Revision: https://reviews.llvm.org/D45776 llvm-svn: 330511
* [clang-tidy] Add Zircon module to clang-tidyJulie Hockett2018-03-141-0/+1
| | | | | | | | | | Adding a Zircon module to clang-tidy for checks specific to the Zircon kernel, and adding a checker to fuchsia-zx (for zircon) to flag instances where specific objects are temporarily created. Differential Revision: https://reviews.llvm.org/D44346 llvm-svn: 327590
* [clang-tidy] Add "portability" module and rename readability-simd-intrinsics ↵Fangrui Song2018-03-071-0/+2
| | | | | | | | | | | | to portability-simd-intrinsics Reviewers: alexfh Subscribers: klimek, nemanjai, mgorny, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D44173 llvm-svn: 326909
* Add support for NOLINT and NOLINTNEXTLINE comments mentioning specific check ↵Aaron Ballman2017-12-141-0/+50
| | | | | | | | | | names. Supports a comma-separated list of check names to be disabled on the given line. Also supports * as a wildcard to disable all lint diagnostic messages on that line. Patch by Anton (xgsa). llvm-svn: 320713
* Add a new clang-tidy module for Fuchsia as an umbrella to diagnose issues ↵Aaron Ballman2017-11-281-0/+1
| | | | | | | | with the Fuschia and Zircon coding guidelines (https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md). Adds the first of such checkers, which detects when default arguments are declared in a function declaration or when default arguments are used at call sites. Patch by Julie Hockett llvm-svn: 319225
* [clang-tidy ObjC] [1/3] New module `objc` for Objective-C checksHaojian Wu2017-10-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is part 1 of 3 of a series of changes to improve Objective-C linting in clang-tidy. This introduces a new clang-tidy module, `objc`, specifically for Objective-C / Objective-C++ checks. The module is currently empty; D39142 adds the first check. Test Plan: `ninja check-clang-tools` Patch by Ben Hamilton! Reviewers: hokein, alexfh Reviewed By: hokein Subscribers: Wizard, mgorny Differential Revision: https://reviews.llvm.org/D39188 llvm-svn: 316643
* [clang-tidy] Add bugprone-suspicious-memset-usage checkGabor Horvath2017-07-141-0/+1
| | | | | | | | | | | | | | | | | | Created new module bugprone and placed the check in that. Finds memset() calls with potential mistakes in their arguments. Replaces and extends the existing google-runtime-memset-zero-length check. Cases covered: * Fill value is a character '0'. Integer 0 might have been intended. * Fill value is out of char range and gets truncated. * Byte count is zero. Potentially swapped with the fill value argument. Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D32700 llvm-svn: 308020
* [clang-tidy][Part1] Add a new module Android and three new checks.Yan Wang2017-06-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: A common source of security bugs is code that opens a file descriptors without using the O_CLOEXEC flag. (Without that flag, an opened sensitive file would remain open across a fork+exec to a lower-privileged SELinux domain, leaking that sensitive data.). Add a new Android module and one checks in clang-tidy. -- open(), openat(), and open64() should include O_CLOEXEC in their flags argument. [android-file-open-flag] Links to part2 and part3: https://reviews.llvm.org/D33745 https://reviews.llvm.org/D33747 Reviewers: chh, alexfh, aaron.ballman, hokein Reviewed By: alexfh, hokein Subscribers: jbcoe, joerg, malcolm.parsons, Eugene.Zelenko, srhines, mgorny, xazax.hun, cfe-commits, krytarowski Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33304 llvm-svn: 306165
* [Documentation] Mention hicpp check group in Clang-tidy main document.Eugene Zelenko2017-05-251-2/+3
| | | | llvm-svn: 303884
* [clang-tidy] Update docs and help messageAlexander Kornienko2017-04-061-4/+4
| | | | llvm-svn: 299651
* [clang-tidy] Format code around applied fixesAlexander Kornienko2017-03-031-2/+18
| | | | | | | | | | | | | | | | Summary: Add -format option (disabled by default for now) to trigger formatting of replacements. Reviewers: ioeric Reviewed By: ioeric Subscribers: kimgr, malcolm.parsons, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D30564 llvm-svn: 296864
* Adds the commandline need to run clang-tidy tests.David L. Jones2017-02-101-0/+6
| | | | | | | | Patch by Jorge Gorbe (lethalantidote) Differential Revision: https://reviews.llvm.org/D29737 llvm-svn: 294689
* [Clang-tidy documentation] Consistency (fix-it); 80 characters per line.Eugene Zelenko2017-01-261-2/+2
| | | | llvm-svn: 293234
* Extend documentation of how to test clang-tidy checks.James Dennett2017-01-021-1/+20
| | | | | | | | | | | | | | | Summary: The documentation assumed expertise with FileCheck; many clang-tidy check authors may not have significant exposure to FileCheck, and so it's worth spending a few more words here to spell things out. Reviewers: alexfh Subscribers: cfe-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D28189 llvm-svn: 290838
* Remove trailing whitespace in docs and clang-tidy sources.Alexander Kornienko2016-12-131-14/+14
| | | | llvm-svn: 289547
* [clang-tidy] Make format style customizableJonas Devlieghere2016-11-301-0/+3
| | | | | | | | | | | | | | Summary: I came across an outstanding FIXME to make the format style customizable. Inspired by the include fixer, I added an new option `-style` to configure the fallback style in case no clang-format configuration file is found. The default remains "llvm". Reviewers: Prazek, aaron.ballman, hokein, alexfh Subscribers: cfe-commits, malcolm.parsons Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D27142 llvm-svn: 288258
* [docs] Remove doubled spacesMalcolm Parsons2016-11-171-2/+2
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: nemanjai, cfe-commits Differential Revision: https://reviews.llvm.org/D26798 llvm-svn: 287226
* [clang-tidy docs] Minor formatting changes.Alexander Kornienko2016-11-091-12/+13
| | | | llvm-svn: 286404
* [clang-tidy docs] Recommend using add_new_check.py moreAlexander Kornienko2016-11-091-34/+48
| | | | llvm-svn: 286390
* Remove mentions of clang-analyzer-alphaAlexander Kornienko2016-11-081-2/+2
| | | | llvm-svn: 286257
* [clang-tidy] Add doc for `explain-config` option.Haojian Wu2016-09-221-0/+4
| | | | llvm-svn: 282158
* [clang-tidy docs] Fix build errors on Sphinx 1.4.5Alexander Kornienko2016-08-181-3/+3
| | | | llvm-svn: 279049
* [Documentation] Remove duplicated checks groups descriptions from ↵Eugene Zelenko2016-08-171-23/+9
| | | | | | | | clang-tidy/index.rst. Differential revision: https://reviews.llvm.org/D23596 llvm-svn: 279006
* [Documentation] Improve checks groups descriptions in clang-tidy/index.rstEugene Zelenko2016-08-151-18/+17
| | | | | | | | Use table to avoid tautology. List all existing checks groups. Use alphabetical order. Differential revision: https://reviews.llvm.org/D23471 llvm-svn: 278686
* [Documentation] Fix grammar mistakes in docs/clang-tidy/index.rst spotted by ↵Eugene Zelenko2016-08-101-1/+1
| | | | | | Alexander Kornienko. llvm-svn: 278255
* [Documentation] Fix spelling mistakes in docs/clang-tidy/index.rst.Eugene Zelenko2016-08-101-5/+5
| | | | llvm-svn: 278198
* Add boost-use-to-stringPiotr Padlewski2016-04-291-0/+2
| | | | | | http://reviews.llvm.org/D18136 llvm-svn: 268079
* [clang-tidy] Minor change in the docAlexander Kornienko2016-02-261-1/+1
| | | | llvm-svn: 261998
* [clang-tidy] Updated docs on testing clang-tidy checks.Alexander Kornienko2016-02-231-2/+20
| | | | llvm-svn: 261622
* [clang-tidy] Describe modules, link to LLVM development docs, other minor ↵Alexander Kornienko2016-02-201-11/+46
| | | | | | updates llvm-svn: 261431
OpenPOWER on IntegriCloud