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 {
57
57
IncludeCleanerCheck::IncludeCleanerCheck (StringRef Name,
58
58
ClangTidyContext *Context)
59
59
: 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 )) {
64
63
for (const auto &Header : IgnoreHeaders) {
65
64
if (!llvm::Regex{Header}.isValid ())
66
65
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 {
26
26
ClangTidyContext *Context)
27
27
: ClangTidyCheck(Name, Context),
28
28
IgnoreMacros (Options.getLocalOrGlobal(" IgnoreMacros" , true )),
29
- Strict(Options.getLocalOrGlobal (" Strict" , false )) {}
29
+ Strict(Options.get (" Strict" , false )) {}
30
30
31
31
void storeOptions (ClangTidyOptions::OptionMap &Opts) override ;
32
32
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
115
115
- Improved :program: `run-clang-tidy.py ` script. Fixed minor shutdown noise
116
116
happening on certain platforms when interrupting the script.
117
117
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
+
118
122
New checks
119
123
^^^^^^^^^^
120
124
Original file line number Diff line number Diff line change 1
1
// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
2
- // RUN: -config="{CheckOptions: {StrictMode: true}}" --
2
+ // RUN: -config="{CheckOptions: {bugprone-argument-comment. StrictMode: true}}" --
3
3
4
4
void f (int _with_underscores_);
5
5
void 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}}"
2
2
// RUN: %check_clang_tidy -check-suffix=NSTRICT %s cppcoreguidelines-pro-type-const-cast %t
3
3
4
4
namespace Const {
Original file line number Diff line number Diff line change 1
1
// 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}}"
3
3
4
4
class Base {
5
5
};
Original file line number Diff line number Diff line change 1
1
// RUN: %check_clang_tidy %s misc-unused-parameters %t -- \
2
- // RUN: -config="{CheckOptions: {StrictMode: true}}" --
2
+ // RUN: -config="{CheckOptions: {misc-unused-parameters. StrictMode: true}}" --
3
3
4
4
// Warn on empty function bodies in StrictMode.
5
5
namespace strict_mode {
Original file line number Diff line number Diff line change 1
1
// RUN: %check_clang_tidy \
2
2
// 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}}" \
4
4
// RUN: -- -isystem %clang_tidy_headers \
5
5
// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
6
6
// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
7
7
// RUN: %check_clang_tidy \
8
8
// 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}}" \
10
10
// RUN: -- -isystem %clang_tidy_headers \
11
11
// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
12
12
// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
Original file line number Diff line number Diff line change 1
1
// RUN: %check_clang_tidy \
2
2
// 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}}" \
4
4
// RUN: -- -isystem %clang_tidy_headers
5
5
// RUN: %check_clang_tidy \
6
6
// 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}}" \
8
8
// RUN: -- -isystem %clang_tidy_headers
9
9
10
10
#include < cstdio>
Original file line number Diff line number Diff line change 1
1
// RUN: %check_clang_tidy -check-suffixes=,STRICT \
2
2
// 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}}" \
4
4
// RUN: -- -isystem %clang_tidy_headers -fexceptions \
5
5
// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
6
6
// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
7
7
// RUN: %check_clang_tidy -check-suffixes=,NOTSTRICT \
8
8
// 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}}" \
10
10
// RUN: -- -isystem %clang_tidy_headers -fexceptions \
11
11
// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
12
12
// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
You can’t perform that action at this time.
0 commit comments