summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove \brief commands from doxygen comments.Dmitri Gribenko2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done [This is analogous to LLVM r331272 and CFE r331834] Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66578 llvm-svn: 369643
* 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
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-101-2/+2
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140
* [clang-tools-extra] Update uses of DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-151-4/+5
| | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM Differential Revision: https://reviews.llvm.org/D44976 llvm-svn: 332371
* Partially revert r331456: [clang-tidy] Remove AnalyzeTemporaryDtors option.Roman Lebedev2018-05-081-0/+2
| | | | | | | | | | | | | | | | | | | That broke every single .clang-tidy config out there which happened to specify AnalyzeTemporaryDtors option: YAML:5:24: error: unknown key 'AnalyzeTemporaryDtors' AnalyzeTemporaryDtors: false ^~~~~ Error parsing <...>/.clang-tidy: Invalid argument More so, that error isn't actually a error, the clang-tidy does not exit with $? != 0, it continues with the default config. Surely this breakage isn't the intended behavior. But if it is, feel free to revert this commit. llvm-svn: 331822
* [clang-tidy] Remove AnalyzeTemporaryDtors option.Alexander Kornienko2018-05-031-3/+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] Fix unused-variable warning.Haojian Wu2018-04-191-1/+2
| | | | llvm-svn: 330327
* [clang-tidy] Fix clang-tidy doesn't read .clangtidy configuration file.Haojian Wu2018-04-181-4/+12
| | | | | | | | | | | | | | Summary: Fix https://bugs.llvm.org/show_bug.cgi?id=34900. Reviewers: alexfh Reviewed By: alexfh Subscribers: JonasToth, klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D45697 llvm-svn: 330245
* Fix ODR violations due to abuse of LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTORRichard Smith2017-06-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | This is a short-term fix for PR33650 aimed to get the modules build bots green again. Remove all the places where we use the LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR macros to try to locally specialize a global template for a global type. That's not how C++ works. Instead, we now centrally define how to format vectors of fundamental types and of string (std::string and StringRef). We use flow formatting for the former cases, since that's the obvious right thing to do; in the latter case, it's less clear what the right choice is, but flow formatting is really bad for some cases (due to very long strings), so we pick block formatting. (Many of the cases that were using flow formatting for strings are improved by this change.) Other than the flow -> block formatting change for some vectors of strings, this should result in no functionality change. Differential Revision: https://reviews.llvm.org/D34907 Corresponding LLVM change is r306878. llvm-svn: 306879
* [clang-tidy] Add FormatStyle configuration option.Alexander Kornienko2017-04-061-0/+3
| | | | llvm-svn: 299649
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-2/+1
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* [clang-tidy] Merge ExtraArgs(Before) instead of overriding them.Alexander Kornienko2016-08-231-24/+30
| | | | | | Added proper tests. llvm-svn: 279519
* [clang-tidy] Pass absolute path to OptionsProvider::getOptions/getRawOptions.Haojian Wu2016-07-111-9/+0
| | | | | | | | | | | | | | | Summary: Although there is no guarantee of getOptions/getRawOptions receiving an absolute path, we try to make it if possible. So FileOptionProvider subclasses don't have to convert the path to an absolute path. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D22154 llvm-svn: 275051
* [ClangTidy] Add an 'explain-checks' option to diagnose where each checks ↵Haojian Wu2016-04-271-13/+61
| | | | | | | | | | | | comes from. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18694 llvm-svn: 267683
* Teach clang-tidy how to upgrade warnings into errors.Jonathan Roelofs2016-01-131-0/+8
| | | | | | | | | Similar in format to the `-checks=` argument, this new `-warnings-as-errors=` argument upgrades any warnings emitted by the former to errors. http://reviews.llvm.org/D15528 llvm-svn: 257642
* Add ExtraArgs and ExtraArgsBefore options to enable clang warnings via ↵Alexander Kornienko2015-11-091-0/+7
| | | | | | | | | | | | | | configuration files. Summary: This patch depends on http://reviews.llvm.org/D14191 Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D14192 llvm-svn: 252485
* [clang-tidy] Don't ignore default set of checks when a config file is found.Alexander Kornienko2015-02-051-4/+3
| | | | | | | | | | | | | | | | | | Summary: This makes clang-tidy merge the default set of checks with the one provided in the configuration file instead of just using the checks from the config file. This adds a way to modify the default set of checks while the previous behavior required to always define the set of checks completely. Reviewers: djasper Reviewed By: djasper Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D7434 llvm-svn: 228298
* [clang-tidy] Make ClangTidyOptionsProvider::getOptions return by value.Alexander Kornienko2015-01-201-1/+1
| | | | | | | Returning by reference limits possible implementations and doesn't bring any benefits as all callers make copies of the returned value anyway. llvm-svn: 226553
* [cleanup] Re-sort the #include lines with llvm/utils/sort_includes.pyChandler Carruth2015-01-141-2/+2
| | | | | | | No functionality changed, this is just a mechanical cleanup to keep the order of #include lines consistent across the project. llvm-svn: 225976
* Remove uses of StringMap::GetOrCreateValue in favor of stl-compatible API usageDavid Blaikie2014-11-191-2/+2
| | | | llvm-svn: 222305
* [clang-tidy] Don't print a message if there's no error.Alexander Kornienko2014-11-041-2/+3
| | | | llvm-svn: 221272
* [clang-tidy] Added -system-headers option.Alexander Kornienko2014-10-281-0/+3
| | | | | | | Added -system-headers option to allow display of warnings from system headers. This is needed for testing libcxx, for example. llvm-svn: 220826
* [clang-tidy] Add support for custom configuration file names/formats.Alexander Kornienko2014-10-201-34/+51
| | | | | | | | | | | | | | Summary: We're using different clang-tidy frontends (command-line, batch analysis jobs, code review integration), some of which are limited in the choice of configuration format. In order to avoid duplication of configuration information, we need to support the same configuration format in the command-line tool. This patch adds an extension point to make this possible without rewriting FileOptionsProvider. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5821 llvm-svn: 220199
* [clang-tidy] Default options in modules.Alexander Kornienko2014-10-161-0/+14
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch allows modules to specify default options for the checks defined in them. This way a sufficiently configurable check can be registered in multiple modules with different default options. E.g. the SpacesBeforeComments option may be set to 1 for the "llvm-namespace-comments" check and to 2 for the "google-readability-namespace-comment" check without modifying or extending the check code. This patch also registers the google-readability-braces-around-statements check with suitable defaults. Reviewers: djasper Reviewed By: djasper Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D5798 llvm-svn: 219923
* Provide user name in ClangTidyOptions.Alexander Kornienko2014-09-241-10/+20
| | | | | | | | | | | | | | | | | | | 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
* Drop superfluous semicolon. GCC's -pedantic warns about this.Benjamin Kramer2014-09-231-1/+1
| | | | llvm-svn: 218310
* Implemented clang-tidy-check-specific options.Alexander Kornienko2014-09-121-0/+32
| | | | | | | | | | | | | | | | | Summary: Each check can implement readOptions and storeOptions methods to read and store custom options. Each check's options are stored in a local namespace to avoid name collisions and provide some sort of context to the user. Reviewers: bkramer, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5296 llvm-svn: 217661
* Try to make VS 2012 happy after r217155Hans Wennborg2014-09-041-3/+4
| | | | | | | | | | | | | | | | It was failing with: C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\llvm\include\llvm/Support/ErrorOr.h(102) : error C3861: 'make_error_code': identifier not found C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\clang-tools-extra\clang-tidy\ClangTidyOptions.cpp(153) : see reference to function template instantiation 'llvm::ErrorOr<T>::ErrorOr<std::errc::errc>(E,void *)' being compiled with [ T=clang::tidy::ClangTidyOptions, E=std::errc::errc ] llvm-svn: 217201
* Implemented clang-tidy configurability via .clang-tidy files.Alexander Kornienko2014-09-041-2/+125
| | | | | | | | | | | | | | | | | Summary: This adds a support for the .clang-tidy file reading using FileOptionsProvider, -dump-config option, and changes tests to not depend on default checks set. Reviewers: klimek, bkramer, djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5186 llvm-svn: 217155
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-4/+4
| | | | llvm-svn: 210776
* Allow per-file clang-tidy options.Alexander Kornienko2014-06-051-1/+17
| | | | | | | | | | | | | | | | | | Summary: This patch makes it possible for clang-tidy clients to provide different options for different translation units. The option, which doesn't make sense to be file-dependent, was moved to a separate ClangTidyGlobalOptions struct. Added parsing of ClangTidyOptions. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3979 llvm-svn: 210260
* Add clang-tidy -line-filter option to filter findings by line ranges.Alexander Kornienko2014-05-221-0/+64
Summary: This is going to be used for a clang-tidy-diff script to display warnings in changed lines only. The option uses JSON, as its value is not intended to be entered manually. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3873 llvm-svn: 209450
OpenPOWER on IntegriCloud