aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/ClangTidyModule.cpp
AgeCommit message (Collapse)AuthorFilesLines
2023-08-27[clang-tidy][NFC] Fix modernize-return-braced-init-list findingsPiotr Zegar1-3/+1
Fix issues found by clang-tidy in clang-tidy source directory.
2023-01-14[clang-tidy][NFC] Use C++17 nested namespaces in the clang-tidy folderCarlos Galvez1-4/+2
Fix applied by running: run-clang-tidy.py -checks=-*,modernize-concat-nested-namespaces Differential Revision: https://reviews.llvm.org/D141770
2023-01-12[clang-tidy][NFC] Make CheckFactories::CreateChecks* constNathan James1-2/+3
There's no reason for these methods to be non-const. Reviewed By: gribozavr2 Differential Revision: https://reviews.llvm.org/D138566
2022-05-06[clang-tidy][NFC] Add createChecks method that also checks for LangaugeOptionsNathan James1-0/+15
This method won't add a check if it isn't supported in the Contexts current LanguageOptions. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D124320
2020-07-30[clang-tidy][NFC] Use StringMap for ClangTidyCheckFactories::FacoryMapNathan James1-3/+3
Reviewed By: gribozavr2 Differential Revision: https://reviews.llvm.org/D84926
2020-06-29[clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header filesNathan James1-0/+1
Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D82661
2020-01-28Make llvm::StringRef to std::string conversions explicit.Benjamin Kramer1-1/+1
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here. This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies. This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2019-09-26Return results by value from ClangTidyCheckFactories::createChecksDmitri Gribenko1-3/+4
llvm-svn: 372979
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-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
2017-05-17Change getChecksFilter() interface to hide implementation details.Alexander Kornienko1-2/+1
llvm-svn: 303264
2016-06-15Apply performance-unnecessary-value-param to clang-tidy.Benjamin Kramer1-1/+1
With minor manual tweaks. No functionality change intended. llvm-svn: 272795
2014-10-16[clang-tidy] Default options in modules.Alexander Kornienko1-0/+4
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
2014-09-12Implemented clang-tidy-check-specific options.Alexander Kornienko1-8/+7
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
2014-09-10std::function-ize ClangTidyCheckFactories.Alexander Kornienko1-4/+4
Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5289 llvm-svn: 217492
2014-09-10Unique-ptrify ClangTidyCheckFactories. Add a more convenient alternative toAlexander Kornienko1-8/+3
addCheckFactory: registerCheck. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5288 llvm-svn: 217489
2014-08-06Rename ChecksFilter to GlobList, as there's nothing specific to checks in it.Alexander Kornienko1-3/+2
Summary: Rename ChecksFilter to GlobList, as there's nothing specific to checks in it. It's a rather generic way to represent sets of strings (or patterns), so it may be used for something else in ClangTidy. The new name would not look strange when used to filter other entities. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4806 llvm-svn: 214961
2014-06-05Allow per-file clang-tidy options.Alexander Kornienko1-2/+3
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
2014-03-20Post-filter clang-tidy diagnostic messages.Alexander Kornienko1-1/+1
Summary: This patch implements filtering of clang-tidy diagnostic messages by the check name, so that "clang-tidy -checks=^llvm-" won't output any clang warnings, for example. This is also helpful to run specific static-analyzer checks: static analyzer always needs core checks to be enabled, but the user may be interested only in the checks he asked for. This patch also exposes warning option names for built-in diagnostics. We need to have a namespace for these names to avoid collisions and to allow convenient filtering, so I prefix them with "-W". I'm not sure it's the best thing to do, and maybe "W" or "clang-diagnostic-" or something like this would be better. Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3121 llvm-svn: 204321
2014-03-06Use range-based for loops for better readability. No functional changes ↵Alexander Kornienko1-10/+7
intended. Reviewers: chandlerc Reviewed By: chandlerc CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2979 llvm-svn: 203101
2014-01-13Add the check name to the clang-tidy diagnostic output.Alexander Kornienko1-2/+5
Summary: Pass check names all the way from ClangTidyModule through ClangTidyCheck and ClangTidyContext to ClangTidyError, and output it in handleErrors. This allows to find mis-behaving check and disable it easily. Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2534 llvm-svn: 199094
2013-12-19Clang-tidy: added --disable-checks, --list-checks options.Alexander Kornienko1-14/+6
Summary: Allow disabling checks by regex. By default, disable alpha.* checks, that are not particularly good tested (e.g. IdempotentOperationChecker, see http://llvm-reviews.chandlerc.com/D2427). Fixed a bug, that would disable all analyzer checks, when using a regex more strict, than 'clang-analyzer-', for example --checks='clang-analyzer-deadcode-'. Added --list-checks to list all enabled checks. This is useful to test specific values in --checks/--disable-checks. Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2444 llvm-svn: 197717
2013-07-29Initial architecture for clang-tidy.Daniel Jasper1-0/+49
This is the first version of a possible clang-tidy architecture. The purpose of clang-tidy is to detect errors in adhering to common coding patterns, e.g. described in the LLVM Coding Standards. This is still heavily in flux. Review: http://llvm-reviews.chandlerc.com/D884 llvm-svn: 187345