File tree Expand file tree Collapse file tree 11 files changed +26
-21
lines changed Expand file tree Collapse file tree 11 files changed +26
-21
lines changed Original file line number Diff line number Diff line change @@ -57,10 +57,9 @@ struct MissingIncludeInfo {
5757IncludeCleanerCheck::IncludeCleanerCheck (StringRef Name,
5858 ClangTidyContext *Context)
5959 : ClangTidyCheck(Name, Context),
60- IgnoreHeaders (utils::options::parseStringList(
61- Options.getLocalOrGlobal(" IgnoreHeaders" , " " ))),
62- DeduplicateFindings(
63- Options.getLocalOrGlobal(" DeduplicateFindings" , true )) {
60+ IgnoreHeaders (
61+ utils::options::parseStringList (Options.get(" IgnoreHeaders" , " " ))),
62+ DeduplicateFindings(Options.get(" DeduplicateFindings" , true )) {
6463 for (const auto &Header : IgnoreHeaders) {
6564 if (!llvm::Regex{Header}.isValid ())
6665 configurationDiag (" Invalid ignore headers regex '%0'" ) << Header;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class InconsistentDeclarationParameterNameCheck : public ClangTidyCheck {
2626 ClangTidyContext *Context)
2727 : ClangTidyCheck(Name, Context),
2828 IgnoreMacros (Options.getLocalOrGlobal(" IgnoreMacros" , true )),
29- Strict(Options.getLocalOrGlobal (" Strict" , false )) {}
29+ Strict(Options.get (" Strict" , false )) {}
3030
3131 void storeOptions (ClangTidyOptions::OptionMap &Opts) override ;
3232 void registerMatchers (ast_matchers::MatchFinder *Finder) override ;
Original file line number Diff line number Diff line change @@ -115,6 +115,10 @@ Improvements to clang-tidy
115115- Improved :program: `run-clang-tidy.py ` script. Fixed minor shutdown noise
116116 happening on certain platforms when interrupting the script.
117117
118+ - Removed :program: `clang-tidy `'s global options for most of checks. All options
119+ are changed to local options except `IncludeStyle `, `StrictMode ` and
120+ `IgnoreMacros `.
121+
118122New checks
119123^^^^^^^^^^
120124
Original file line number Diff line number Diff line change 11// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
2- // RUN: -config="{CheckOptions: {StrictMode: true}}" --
2+ // RUN: -config="{CheckOptions: {bugprone-argument-comment. StrictMode: true}}" --
33
44void f (int _with_underscores_);
55void g (int x_);
Original file line number Diff line number Diff line change 1- // RUN: %check_clang_tidy -check-suffix=STRICT %s cppcoreguidelines-pro-type-const-cast %t -- -config="{CheckOptions: {StrictMode: true}}"
1+ // RUN: %check_clang_tidy -check-suffix=STRICT %s cppcoreguidelines-pro-type-const-cast %t -- -config="{CheckOptions: {cppcoreguidelines-pro-type-const-cast. StrictMode: true}}"
22// RUN: %check_clang_tidy -check-suffix=NSTRICT %s cppcoreguidelines-pro-type-const-cast %t
33
44namespace Const {
Original file line number Diff line number Diff line change 11// RUN: %check_clang_tidy -check-suffixes=NSTRICT,STRICT %s cppcoreguidelines-pro-type-static-cast-downcast %t
2- // RUN: %check_clang_tidy -check-suffix=NSTRICT %s cppcoreguidelines-pro-type-static-cast-downcast %t -- -config="{CheckOptions: {StrictMode: false}}"
2+ // RUN: %check_clang_tidy -check-suffix=NSTRICT %s cppcoreguidelines-pro-type-static-cast-downcast %t -- -config="{CheckOptions: {cppcoreguidelines-pro-type-static-cast-downcast. StrictMode: false}}"
33
44class Base {
55};
Original file line number Diff line number Diff line change 11// RUN: %check_clang_tidy %s misc-unused-parameters %t -- \
2- // RUN: -config="{CheckOptions: {StrictMode: true}}" --
2+ // RUN: -config="{CheckOptions: {misc-unused-parameters. StrictMode: true}}" --
33
44// Warn on empty function bodies in StrictMode.
55namespace strict_mode {
Original file line number Diff line number Diff line change 11// RUN: %check_clang_tidy \
22// RUN: -std=c++20 %s modernize-use-std-format %t -- \
3- // RUN: -config="{CheckOptions: {StrictMode: true}}" \
3+ // RUN: -config="{CheckOptions: {modernize-use-std-format. StrictMode: true}}" \
44// RUN: -- -isystem %clang_tidy_headers \
55// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
66// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
77// RUN: %check_clang_tidy \
88// RUN: -std=c++20 %s modernize-use-std-format %t -- \
9- // RUN: -config="{CheckOptions: {StrictMode: false}}" \
9+ // RUN: -config="{CheckOptions: {modernize-use-std-format. StrictMode: false}}" \
1010// RUN: -- -isystem %clang_tidy_headers \
1111// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
1212// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
Original file line number Diff line number Diff line change 11// RUN: %check_clang_tidy \
22// RUN: -std=c++23 %s modernize-use-std-print %t -- \
3- // RUN: -config="{CheckOptions: {StrictMode: true}}" \
3+ // RUN: -config="{CheckOptions: {modernize-use-std-print. StrictMode: true}}" \
44// RUN: -- -isystem %clang_tidy_headers
55// RUN: %check_clang_tidy \
66// RUN: -std=c++23 %s modernize-use-std-print %t -- \
7- // RUN: -config="{CheckOptions: {StrictMode: false}}" \
7+ // RUN: -config="{CheckOptions: {modernize-use-std-print. StrictMode: false}}" \
88// RUN: -- -isystem %clang_tidy_headers
99
1010#include < cstdio>
Original file line number Diff line number Diff line change 11// RUN: %check_clang_tidy -check-suffixes=,STRICT \
22// RUN: -std=c++23 %s modernize-use-std-print %t -- \
3- // RUN: -config="{CheckOptions: {StrictMode: true}}" \
3+ // RUN: -config="{CheckOptions: {modernize-use-std-print. StrictMode: true}}" \
44// RUN: -- -isystem %clang_tidy_headers -fexceptions \
55// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
66// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
77// RUN: %check_clang_tidy -check-suffixes=,NOTSTRICT \
88// RUN: -std=c++23 %s modernize-use-std-print %t -- \
9- // RUN: -config="{CheckOptions: {StrictMode: false}}" \
9+ // RUN: -config="{CheckOptions: {modernize-use-std-print. StrictMode: false}}" \
1010// RUN: -- -isystem %clang_tidy_headers -fexceptions \
1111// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
1212// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
You can’t perform that action at this time.
0 commit comments