Change instances where options which are boolean are assigned the value 1|0 to use true|false instead.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D101721
ClangTidyOptions Options;
ClangTidyOptions::OptionMap &Opts = Options.CheckOptions;
Opts["cert-dcl16-c.NewSuffixes"] = "L;LL;LU;LLU";
- Opts["cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField"] = "0";
- Opts["cert-str34-c.DiagnoseSignedUnsignedCharComparisons"] = "0";
+ Opts["cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField"] = "false";
+ Opts["cert-str34-c.DiagnoseSignedUnsignedCharComparisons"] = "false";
return Options;
}
};
ClangTidyOptions::OptionMap &Opts = Options.CheckOptions;
Opts["cppcoreguidelines-non-private-member-variables-in-classes."
- "IgnoreClassesWithAllMemberVariablesBeingPublic"] = "1";
+ "IgnoreClassesWithAllMemberVariablesBeingPublic"] = "true";
Opts["cppcoreguidelines-explicit-virtual-functions."
- "IgnoreDestructors"] = "1";
+ "IgnoreDestructors"] = "true";
return Options;
}
ClangTidyOptions getModuleOptions() override {
ClangTidyOptions Options;
- Options.CheckOptions["llvm-qualified-auto.AddConstToQualified"] = "0";
- Options.CheckOptions["llvm-else-after-return.WarnOnUnfixable"] = "0";
+ Options.CheckOptions["llvm-qualified-auto.AddConstToQualified"] = "false";
+ Options.CheckOptions["llvm-else-after-return.WarnOnUnfixable"] = "false";
Options.CheckOptions["llvm-else-after-return.WarnOnConditionVariables"] =
- "0";
+ "false";
return Options;
}
};
// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
// RUN: -config="{CheckOptions: [ \
-// RUN: {key: bugprone-argument-comment.IgnoreSingleArgument, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentBoolLiterals, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentIntegerLiterals, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentFloatLiterals, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentStringLiterals, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentNullPtrs, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentCharacterLiterals, value: 1}]}" --
+// RUN: {key: bugprone-argument-comment.IgnoreSingleArgument, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentBoolLiterals, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentIntegerLiterals, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentFloatLiterals, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentStringLiterals, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentNullPtrs, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentCharacterLiterals, value: true}]}" --
struct A {
void foo(bool abc);
// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
// RUN: -config="{CheckOptions: [ \
-// RUN: {key: bugprone-argument-comment.CommentBoolLiterals, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentIntegerLiterals, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentFloatLiterals, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentStringLiterals, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentNullPtrs, value: 1}, \
-// RUN: {key: bugprone-argument-comment.CommentCharacterLiterals, value: 1}]}" --
+// RUN: {key: bugprone-argument-comment.CommentBoolLiterals, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentIntegerLiterals, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentFloatLiterals, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentStringLiterals, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentNullPtrs, value: true}, \
+// RUN: {key: bugprone-argument-comment.CommentCharacterLiterals, value: true}]}" --
struct A {
void foo(bool abc);
// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
-// RUN: -config="{CheckOptions: [{key: StrictMode, value: 1}]}" --
+// RUN: -config="{CheckOptions: [{key: StrictMode, value: true}]}" --
void f(int _with_underscores_);
void g(int x_);
-// RUN: %check_clang_tidy %s bugprone-assert-side-effect %t -- -config="{CheckOptions: [{key: bugprone-assert-side-effect.CheckFunctionCalls, value: 1}, {key: bugprone-assert-side-effect.AssertMacros, value: 'assert,assert2,my_assert,convoluted_assert,msvc_assert'}]}" -- -fexceptions
+// RUN: %check_clang_tidy %s bugprone-assert-side-effect %t -- -config="{CheckOptions: [{key: bugprone-assert-side-effect.CheckFunctionCalls, value: true}, {key: bugprone-assert-side-effect.AssertMacros, value: 'assert,assert2,my_assert,convoluted_assert,msvc_assert'}]}" -- -fexceptions
//===--- assert definition block ------------------------------------------===//
int abort() { return 0; }
// RUN: %check_clang_tidy -check-suffixes=ALL,C -std=c99 %s bugprone-implicit-widening-of-multiplication-result %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: 0} \
+// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
// RUN: ]}' -- -target x86_64-unknown-unknown -x c
// RUN: %check_clang_tidy -check-suffixes=ALL,C %s bugprone-implicit-widening-of-multiplication-result %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: 0} \
+// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
// RUN: ]}' -- -target x86_64-unknown-unknown -x c++
char *t0(char *base, int a, int b) {
// RUN: %check_clang_tidy -check-suffixes=ALL,C -std=c99 %s bugprone-implicit-widening-of-multiplication-result %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: 0} \
+// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
// RUN: ]}' -- -target x86_64-unknown-unknown -x c
// RUN: %check_clang_tidy -check-suffixes=ALL,C %s bugprone-implicit-widening-of-multiplication-result %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: 0} \
+// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
// RUN: ]}' -- -target x86_64-unknown-unknown -x c++
long t0(int a, int b) {
// RUN: %check_clang_tidy -check-suffixes=ALL,C -std=c99 %s bugprone-implicit-widening-of-multiplication-result %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: 0} \
+// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
// RUN: ]}' -- -target x86_64-unknown-unknown -x c
// RUN: %check_clang_tidy -check-suffixes=ALL,C %s bugprone-implicit-widening-of-multiplication-result %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: 0} \
+// RUN: {key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources, value: false} \
// RUN: ]}' -- -target x86_64-unknown-unknown -x c++
char *t0(char *base, int a, int b) {
-// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: [{key: bugprone-misplaced-widening-cast.CheckImplicitCasts, value: 0}]}" --
+// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: [{key: bugprone-misplaced-widening-cast.CheckImplicitCasts, value: false}]}" --
void func(long arg) {}
-// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: [{key: bugprone-misplaced-widening-cast.CheckImplicitCasts, value: 1}]}" --
+// RUN: %check_clang_tidy %s bugprone-misplaced-widening-cast %t -- -config="{CheckOptions: [{key: bugprone-misplaced-widening-cast.CheckImplicitCasts, value: true}]}" --
void func(long arg) {}
// RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \
// RUN: -config="{CheckOptions: \
// RUN: [{key: bugprone-not-null-terminated-result.WantToUseSafeFunctions, \
-// RUN: value: 1}]}" \
+// RUN: value: true}]}" \
// RUN: -- -std=c11 -I %S/Inputs/bugprone-not-null-terminated-result
#include "not-null-terminated-result-c.h"
// RUN: %check_clang_tidy %s bugprone-reserved-identifier %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: bugprone-reserved-identifier.Invert, value: 1}, \
+// RUN: {key: bugprone-reserved-identifier.Invert, value: true}, \
// RUN: {key: bugprone-reserved-identifier.AllowedIdentifiers, value: std;reference_wrapper;ref;cref;type;get}, \
// RUN: ]}' -- \
// RUN: -I%S/Inputs/bugprone-reserved-identifier \
-// RUN: %check_clang_tidy %s bugprone-sizeof-expression %t -- -config="{CheckOptions: [{key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression, value: 1}]}" --
+// RUN: %check_clang_tidy %s bugprone-sizeof-expression %t -- -config="{CheckOptions: [{key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression, value: true}]}" --
class C {
int size() { return sizeof(this); }
-// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: [{key: bugprone-suspicious-enum-usage.StrictMode, value: 1}]}" --
+// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: [{key: bugprone-suspicious-enum-usage.StrictMode, value: true}]}" --
enum A {
A = 1,
-// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: [{key: bugprone-suspicious-enum-usage.StrictMode, value: 0}]}" --
+// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: [{key: bugprone-suspicious-enum-usage.StrictMode, value: false}]}" --
enum Empty {
};
// RUN: %check_clang_tidy %s bugprone-suspicious-string-compare %t -- \
// RUN: -config='{CheckOptions: \
-// RUN: [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: 1}, \
-// RUN: {key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison, value: 1}]}' \
+// RUN: [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: true}, \
+// RUN: {key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison, value: true}]}' \
// RUN: -- -std=c99
static const char A[] = "abc";
// RUN: %check_clang_tidy %s bugprone-suspicious-string-compare %t -- \
// RUN: -config='{CheckOptions: \
-// RUN: [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: 1}, \
-// RUN: {key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison, value: 1}]}' \
+// RUN: [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: true}, \
+// RUN: {key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison, value: true}]}' \
// RUN: --
typedef __SIZE_TYPE__ size;
// RUN: %check_clang_tidy %s bugprone-unhandled-self-assignment %t -- \
// RUN: -config="{CheckOptions: \
// RUN: [{key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField, \
-// RUN: value: 0}]}"
+// RUN: value: false}]}"
// Classes with pointer field are still caught.
class PtrField {
// RUN: %check_clang_tidy %s cppcoreguidelines-macro-usage %t \
// RUN: -config='{CheckOptions: \
-// RUN: [{key: cppcoreguidelines-macro-usage.CheckCapsOnly, value: 1}]}' --
+// RUN: [{key: cppcoreguidelines-macro-usage.CheckCapsOnly, value: true}]}' --
#ifndef INCLUDE_GUARD
#define INCLUDE_GUARD
// RUN: %check_clang_tidy -check-suffixes=NORMAL %s cppcoreguidelines-macro-usage %t -- -- -D_ZZZ_IM_A_MACRO
-// RUN: %check_clang_tidy -check-suffixes=NORMAL %s cppcoreguidelines-macro-usage %t -- -config='{CheckOptions: [{key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros, value: 1}]}' -- -D_ZZZ_IM_A_MACRO
-// RUN: %check_clang_tidy -check-suffixes=NORMAL,CL %s cppcoreguidelines-macro-usage %t -- -config='{CheckOptions: [{key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros, value: 0}]}' -- -D_ZZZ_IM_A_MACRO
+// RUN: %check_clang_tidy -check-suffixes=NORMAL %s cppcoreguidelines-macro-usage %t -- -config='{CheckOptions: [{key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros, value: true}]}' -- -D_ZZZ_IM_A_MACRO
+// RUN: %check_clang_tidy -check-suffixes=NORMAL,CL %s cppcoreguidelines-macro-usage %t -- -config='{CheckOptions: [{key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros, value: false}]}' -- -D_ZZZ_IM_A_MACRO
// CHECK-MESSAGES-CL: warning: macro '_ZZZ_IM_A_MACRO' used to declare a constant; consider using a 'constexpr' constant
// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \
// RUN: -config="{CheckOptions: [ \
-// RUN: {key: "cppcoreguidelines-narrowing-conversions.PedanticMode", value: 1} \
+// RUN: {key: "cppcoreguidelines-narrowing-conversions.PedanticMode", value: true} \
// RUN: ]}" \
// RUN: -- -target x86_64-unknown-linux -fsigned-char
// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \
// RUN: -config="{CheckOptions: [ \
-// RUN: {key: "cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion", value: 0}, \
+// RUN: {key: "cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion", value: false}, \
// RUN: ]}" \
// RUN: -- -target x86_64-unknown-linux -fsigned-char
// RUN: %check_clang_tidy %s cppcoreguidelines-prefer-member-initializer,modernize-use-default-member-init %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: 1}]}"
+// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: true}]}"
class Simple1 {
int n;
-// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init %t -- -config="{CheckOptions: [{key: "cppcoreguidelines-pro-type-member-init.UseAssignment", value: 1}]}" -- -fsigned-char
+// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init %t -- -config="{CheckOptions: [{key: "cppcoreguidelines-pro-type-member-init.UseAssignment", value: true}]}" -- -fsigned-char
struct T {
int i;
-// RUN: %check_clang_tidy %s cppcoreguidelines-special-member-functions %t -- -config="{CheckOptions: [{key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted, value: 1}]}" --
+// RUN: %check_clang_tidy %s cppcoreguidelines-special-member-functions %t -- -config="{CheckOptions: [{key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted, value: true}]}" --
class DefinesEverything {
DefinesEverything(const DefinesEverything &);
-// RUN: %check_clang_tidy %s cppcoreguidelines-special-member-functions %t -- -config="{CheckOptions: [{key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions, value: 1}, {key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor, value: 1}]}" --
+// RUN: %check_clang_tidy %s cppcoreguidelines-special-member-functions %t -- -config="{CheckOptions: [{key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions, value: true}, {key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor, value: true}]}" --
class DefinesDestructor {
~DefinesDestructor();
// RUN: %check_clang_tidy %s hicpp-multiway-paths-covered %t \
// RUN: -config='{CheckOptions: \
-// RUN: [{key: hicpp-multiway-paths-covered.WarnOnMissingElse, value: 1}]}'\
+// RUN: [{key: hicpp-multiway-paths-covered.WarnOnMissingElse, value: true}]}'\
// RUN: --
enum OS { Mac,
// RUN: %check_clang_tidy %s hicpp-signed-bitwise %t -- \
-// RUN: -config="{CheckOptions: [{key: hicpp-signed-bitwise.IgnorePositiveIntegerLiterals, value: 1 }]}" \
+// RUN: -config="{CheckOptions: [{key: hicpp-signed-bitwise.IgnorePositiveIntegerLiterals, value: true }]}" \
// RUN: -- -std=c++11
void examples() {
// RUN: %check_clang_tidy -check-suffixes=PUBLIC,NONPRIVATE,PROTECTED %s misc-non-private-member-variables-in-classes %t
-// RUN: %check_clang_tidy -check-suffixes=PUBLIC,NONPRIVATE,PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: 0}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: 0}]}' --
-// RUN: %check_clang_tidy -check-suffixes=PUBLIC,PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: 0}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: 1}]}' --
+// RUN: %check_clang_tidy -check-suffixes=PUBLIC,NONPRIVATE,PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: false}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: false}]}' --
+// RUN: %check_clang_tidy -check-suffixes=PUBLIC,PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: false}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: true}]}' --
// RUN: %check_clang_tidy -check-suffixes=PUBLIC,PROTECTED %s cppcoreguidelines-non-private-member-variables-in-classes %t -- --
-// RUN: %check_clang_tidy -check-suffixes=PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: 1}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: 0}]}' --
-// RUN: %check_clang_tidy -check-suffixes=PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: 1}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: 1}]}' --
+// RUN: %check_clang_tidy -check-suffixes=PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: true}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: false}]}' --
+// RUN: %check_clang_tidy -check-suffixes=PROTECTED %s misc-non-private-member-variables-in-classes %t -- -config='{CheckOptions: [{key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: true}, {key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: true}]}' --
//----------------------------------------------------------------------------//
// RUN: %check_clang_tidy %s misc-unused-parameters %t -- \
-// RUN: -config="{CheckOptions: [{key: StrictMode, value: 1}]}" --
+// RUN: -config="{CheckOptions: [{key: StrictMode, value: true}]}" --
// Warn on empty function bodies in StrictMode.
namespace strict_mode {
// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-avoid-bind %t -- \
// RUN: -config="{CheckOptions: [ \
-// RUN: {key: modernize-avoid-bind.PermissiveParameterList, value: 1}]}" --
+// RUN: {key: modernize-avoid-bind.PermissiveParameterList, value: true}]}" --
namespace std {
inline namespace impl {
// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-make-unique %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-make-unique.IgnoreMacros, value: 0}]}" \
+// RUN: -config="{CheckOptions: [{key: modernize-make-unique.IgnoreMacros, value: false}]}" \
// RUN: -- -I %S/Inputs/modernize-smart-ptr
#include "unique_ptr.h"
-// RUN: %check_clang_tidy %s modernize-raw-string-literal %t -- -config='{CheckOptions: [{key: "modernize-raw-string-literal.DelimiterStem", value: "str"}, {key: modernize-raw-string-literal.ReplaceShorterLiterals, value: 1}]}'
+// RUN: %check_clang_tidy %s modernize-raw-string-literal %t -- -config='{CheckOptions: [{key: "modernize-raw-string-literal.DelimiterStem", value: "str"}, {key: modernize-raw-string-literal.ReplaceShorterLiterals, value: true}]}'
char const *const ContainsSentinel{"who\\ops)\""};
// CHECK-MESSAGES: :[[@LINE-1]]:36: warning: {{.*}} can be written as a raw string literal
-// RUN: %check_clang_tidy %s modernize-raw-string-literal %t -- -config="{CheckOptions: [{key: modernize-raw-string-literal.ReplaceShorterLiterals, value: 1}]}"
+// RUN: %check_clang_tidy %s modernize-raw-string-literal %t -- -config="{CheckOptions: [{key: modernize-raw-string-literal.ReplaceShorterLiterals, value: true}]}"
char const *const BackSlash("goink\\frob");
// CHECK-MESSAGES: :[[@LINE-1]]:29: warning: escaped string literal can be written as a raw string literal [modernize-raw-string-literal]
// RUN: %check_clang_tidy %s modernize-use-auto %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: '1'} , {key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" \
+// RUN: -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 'true'} , {key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" \
// RUN: -- -frtti
struct A {
-// RUN: %check_clang_tidy -check-suffix=0-0 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 0}, {key: modernize-use-auto.MinTypeNameLength, value: 0}]}" -- -frtti
-// RUN: %check_clang_tidy -check-suffix=0-8 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 0}, {key: modernize-use-auto.MinTypeNameLength, value: 8}]}" -- -frtti
-// RUN: %check_clang_tidy -check-suffix=1-0 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 1}, {key: modernize-use-auto.MinTypeNameLength, value: 0}]}" -- -frtti
-// RUN: %check_clang_tidy -check-suffix=1-8 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 1}, {key: modernize-use-auto.MinTypeNameLength, value: 8}]}" -- -frtti
+// RUN: %check_clang_tidy -check-suffix=0-0 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: false}, {key: modernize-use-auto.MinTypeNameLength, value: 0}]}" -- -frtti
+// RUN: %check_clang_tidy -check-suffix=0-8 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: false}, {key: modernize-use-auto.MinTypeNameLength, value: 8}]}" -- -frtti
+// RUN: %check_clang_tidy -check-suffix=1-0 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: true}, {key: modernize-use-auto.MinTypeNameLength, value: 0}]}" -- -frtti
+// RUN: %check_clang_tidy -check-suffix=1-8 %s modernize-use-auto %t -- -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: true}, {key: modernize-use-auto.MinTypeNameLength, value: 8}]}" -- -frtti
template <class T> extern T foo();
template <class T> struct P { explicit P(T t) : t_(t) {} T t_;};
// RUN: %check_clang_tidy %s modernize-use-auto %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: '1'}, {key: modernize-use-auto.MinTypeNameLength, value: '0'}]}"
+// RUN: -config="{CheckOptions: [{key: modernize-use-auto.RemoveStars, value: 'true'}, {key: modernize-use-auto.MinTypeNameLength, value: '0'}]}"
class MyType {};
// RUN: %check_clang_tidy %s modernize-use-bool-literals %t -- \
// RUN: -config="{CheckOptions: \
// RUN: [{key: modernize-use-bool-literals.IgnoreMacros, \
-// RUN: value: 1}]}"
+// RUN: value: true}]}"
bool IntToTrue = 1;
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: converting integer literal to bool, use bool literal instead [modernize-use-bool-literals]
// RUN: %check_clang_tidy %s modernize-use-bool-literals %t -- \
// RUN: -config="{CheckOptions: \
// RUN: [{key: modernize-use-bool-literals.IgnoreMacros, \
-// RUN: value: 0}]}"
+// RUN: value: false}]}"
bool IntToTrue = 1;
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: converting integer literal to bool, use bool literal instead [modernize-use-bool-literals]
// RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: 1}]}"
+// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: true}]}"
struct S {
};
// RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.IgnoreMacros, value: 0}]}"
+// RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.IgnoreMacros, value: false}]}"
#define MACRO() \
struct S { \
// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \
// RUN: -config="{CheckOptions: \
// RUN: [{key: modernize-use-emplace.IgnoreImplicitConstructors, \
-// RUN: value: 1}] \
+// RUN: value: true}] \
// RUN: }"
namespace std {
// RUN: %check_clang_tidy %s modernize-use-equals-default %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-equals-default.IgnoreMacros, value: 0}]}" \
+// RUN: -config="{CheckOptions: [{key: modernize-use-equals-default.IgnoreMacros, value: false}]}" \
// RUN: -- -fno-delayed-template-parsing -fexceptions
// Out of line definition.
// RUN: %check_clang_tidy %s modernize-use-equals-default %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-equals-default.IgnoreMacros, value: 0}]}"
+// RUN: -config="{CheckOptions: [{key: modernize-use-equals-default.IgnoreMacros, value: false}]}"
#define STRUCT_WITH_DEFAULT(_base, _type) \
struct _type { \
// RUN: %check_clang_tidy %s modernize-use-equals-delete %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-equals-delete.IgnoreMacros, value: 0}]}"
+// RUN: -config="{CheckOptions: [{key: modernize-use-equals-delete.IgnoreMacros, value: false}]}"
#define MACRO(type) void operator=(type const &)
class C {
// RUN: %check_clang_tidy -std=c++11,c++14 %s modernize-use-noexcept %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-noexcept.UseNoexceptFalse, value: 0}]}" \
+// RUN: -config="{CheckOptions: [{key: modernize-use-noexcept.UseNoexceptFalse, value: false}]}" \
// RUN: -- -fexceptions
// This test is not run in C++17 or later because dynamic exception
// specifications were removed in C++17.
// RUN: %check_clang_tidy %s modernize-use-override %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-override.AllowOverrideAndFinal, value: 1}]}"
+// RUN: -config="{CheckOptions: [{key: modernize-use-override.AllowOverrideAndFinal, value: true}]}"
struct Base {
virtual ~Base();
// RUN: %check_clang_tidy %s modernize-use-override %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-override.IgnoreDestructors, value: 1}]}"
+// RUN: -config="{CheckOptions: [{key: modernize-use-override.IgnoreDestructors, value: true}]}"
struct Base {
virtual ~Base();
// RUN: %check_clang_tidy %s modernize-use-using %t -- \
-// RUN: -config="{CheckOptions: [{key: modernize-use-using.IgnoreMacros, value: 0}]}"
+// RUN: -config="{CheckOptions: [{key: modernize-use-using.IgnoreMacros, value: false}]}"
#define CODE typedef int INT
// RUN: %check_clang_tidy %s performance-for-range-copy %t -- \
-// RUN: -config="{CheckOptions: [{key: "performance-for-range-copy.WarnOnAllAutoCopies", value: 1}]}"
+// RUN: -config="{CheckOptions: [{key: "performance-for-range-copy.WarnOnAllAutoCopies", value: true}]}"
template <typename T>
struct Iterator {
// RUN: %check_clang_tidy %s performance-inefficient-vector-operation %t -- \
// RUN: -format-style=llvm \
// RUN: -config='{CheckOptions: \
-// RUN: [{key: performance-inefficient-vector-operation.EnableProto, value: 1}]}'
+// RUN: [{key: performance-inefficient-vector-operation.EnableProto, value: true}]}'
namespace std {
// RUN: %check_clang_tidy %s performance-move-const-arg %t \
// RUN: -config='{CheckOptions: \
-// RUN: [{key: performance-move-const-arg.CheckTriviallyCopyableMove, value: 0}]}'
+// RUN: [{key: performance-move-const-arg.CheckTriviallyCopyableMove, value: false}]}'
namespace std {
// RUN: %check_clang_tidy %s performance-move-constructor-init,modernize-pass-by-value %t -- \
// RUN: -config='{CheckOptions: \
-// RUN: [{key: modernize-pass-by-value.ValuesOnly, value: 1}]}' \
+// RUN: [{key: modernize-pass-by-value.ValuesOnly, value: true}]}' \
// RUN: -- -isystem %S/Inputs/Headers
#include <s.h>
// RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s portability-simd-intrinsics %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: portability-simd-intrinsics.Suggest, value: 1} \
+// RUN: {key: portability-simd-intrinsics.Suggest, value: true} \
// RUN: ]}' -- -target ppc64le -maltivec
// RUN: %check_clang_tidy -std=c++20-or-later %s portability-simd-intrinsics -check-suffix=CXX20 %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: portability-simd-intrinsics.Suggest, value: 1} \
+// RUN: {key: portability-simd-intrinsics.Suggest, value: true} \
// RUN: ]}' -- -target ppc64le -maltivec
vector int vec_add(vector int, vector int);
// RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s portability-simd-intrinsics %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: portability-simd-intrinsics.Suggest, value: 1} \
+// RUN: {key: portability-simd-intrinsics.Suggest, value: true} \
// RUN: ]}' -- -target x86_64
// RUN: %check_clang_tidy -std=c++20-or-later %s portability-simd-intrinsics -check-suffix=CXX20 %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: portability-simd-intrinsics.Suggest, value: 1} \
+// RUN: {key: portability-simd-intrinsics.Suggest, value: true} \
// RUN: ]}' -- -target x86_64
typedef long long __m128i __attribute__((vector_size(16)));
// RUN: %check_clang_tidy %s readability-else-after-return %t -- \
// RUN: -config='{CheckOptions: [ \
-// RUN: {key: readability-else-after-return.WarnOnUnfixable, value: 0}, \
+// RUN: {key: readability-else-after-return.WarnOnUnfixable, value: false}, \
// RUN: ]}'
int h(int);
// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \
// RUN: -config='{CheckOptions: [ \
// RUN: {key: readability-identifier-naming.ParameterCase, value: CamelCase}, \
-// RUN: {key: readability-identifier-naming.IgnoreMainLikeFunctions, value: 1} \
+// RUN: {key: readability-identifier-naming.IgnoreMainLikeFunctions, value: true} \
// RUN: ]}'
int mainLike(int argc, char **argv);
// RUN: {key: readability-identifier-naming.MemberCase, value: CamelCase}, \
// RUN: {key: readability-identifier-naming.ParameterCase, value: CamelCase}, \
// RUN: {key: readability-identifier-naming.MethodCase, value: camelBack}, \
-// RUN: {key: readability-identifier-naming.AggressiveDependentMemberLookup, value: 1} \
+// RUN: {key: readability-identifier-naming.AggressiveDependentMemberLookup, value: true} \
// RUN: ]}' -- -fno-delayed-template-parsing
int set_up(int);
// RUN: {key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE}, \
// RUN: {key: readability-identifier-naming.TypeAliasCase, value: camel_Snake_Back}, \
// RUN: {key: readability-identifier-naming.TypeAliasSuffix, value: '_t'}, \
-// RUN: {key: readability-identifier-naming.IgnoreFailedSplit, value: 0}, \
+// RUN: {key: readability-identifier-naming.IgnoreFailedSplit, value: false}, \
// RUN: {key: readability-identifier-naming.GlobalPointerCase, value: CamelCase}, \
// RUN: {key: readability-identifier-naming.GlobalPointerSuffix, value: '_Ptr'}, \
// RUN: {key: readability-identifier-naming.GlobalConstantPointerCase, value: UPPER_CASE}, \
// RUN: %check_clang_tidy %s readability-implicit-bool-conversion %t \
// RUN: -config='{CheckOptions: \
-// RUN: [{key: readability-implicit-bool-conversion.AllowIntegerConditions, value: 1}, \
-// RUN: {key: readability-implicit-bool-conversion.AllowPointerConditions, value: 1}]}'
+// RUN: [{key: readability-implicit-bool-conversion.AllowIntegerConditions, value: true}, \
+// RUN: {key: readability-implicit-bool-conversion.AllowPointerConditions, value: true}]}'
template<typename T>
void functionTaking(T);
// RUN: %check_clang_tidy %s readability-inconsistent-declaration-parameter-name %t -- \
-// RUN: -config="{CheckOptions: [{key: readability-inconsistent-declaration-parameter-name.IgnoreMacros, value: 0}]}"
+// RUN: -config="{CheckOptions: [{key: readability-inconsistent-declaration-parameter-name.IgnoreMacros, value: false}]}"
#define MACRO() \
void f(int x)
// RUN: %check_clang_tidy %s readability-inconsistent-declaration-parameter-name %t -- \
-// RUN: -config="{CheckOptions: [{key: readability-inconsistent-declaration-parameter-name.Strict, value: 1}]}"
+// RUN: -config="{CheckOptions: [{key: readability-inconsistent-declaration-parameter-name.Strict, value: true}]}"
void inconsistentFunction(int a, int b, int c);
// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'inconsistentFunction' has 1 other declaration with different parameter names
// RUN: -config='{CheckOptions: \
// RUN: [{key: readability-magic-numbers.IgnoredIntegerValues, value: "0;1;2;10;100;"}, \
// RUN: {key: readability-magic-numbers.IgnoredFloatingPointValues, value: "3.14;2.71828;9.81;10000.0;101.0;0x1.2p3"}, \
-// RUN: {key: readability-magic-numbers.IgnoreBitFieldsWidths, value: 0}, \
-// RUN: {key: readability-magic-numbers.IgnorePowersOf2IntegerValues, value: 1}]}' \
+// RUN: {key: readability-magic-numbers.IgnoreBitFieldsWidths, value: false}, \
+// RUN: {key: readability-magic-numbers.IgnorePowersOf2IntegerValues, value: true}]}' \
// RUN: --
template <typename T, int V>
// RUN: %check_clang_tidy %s readability-redundant-access-specifiers %t -- \
-// RUN: -config="{CheckOptions: [{key: readability-redundant-access-specifiers.CheckFirstDeclaration, value: 1}]}" --
+// RUN: -config="{CheckOptions: [{key: readability-redundant-access-specifiers.CheckFirstDeclaration, value: true}]}" --
class FooPublic {
private: // comment-0
// RUN: %check_clang_tidy %s readability-redundant-declaration %t -- \
// RUN: -config="{CheckOptions: \
// RUN: [{key: readability-redundant-declaration.IgnoreMacros, \
-// RUN: value: 1}]}"
+// RUN: value: true}]}"
extern int Xyz;
extern int Xyz; // Xyz
// RUN: %check_clang_tidy %s readability-redundant-declaration %t -- \
// RUN: -config="{CheckOptions: \
// RUN: [{key: readability-redundant-declaration.IgnoreMacros, \
-// RUN: value: 0}]}"
+// RUN: value: false}]}"
//
// With -fms-compatibility and -DEXTERNINLINE, the extern inline shouldn't
// produce additional diagnostics, so same check suffix as before:
// RUN: %check_clang_tidy %s readability-redundant-declaration %t -- \
// RUN: -config="{CheckOptions: \
// RUN: [{key: readability-redundant-declaration.IgnoreMacros, \
-// RUN: value: 0}]}" -- -fms-compatibility -DEXTERNINLINE
+// RUN: value: false}]}" -- -fms-compatibility -DEXTERNINLINE
//
// With -fno-ms-compatibility, DEXTERNINLINE causes additional output.
// (The leading ',' means "default checks in addition to NOMSCOMPAT checks.)
// RUN: %s readability-redundant-declaration %t -- \
// RUN: -config="{CheckOptions: \
// RUN: [{key: readability-redundant-declaration.IgnoreMacros, \
-// RUN: value: 0}]}" -- -fno-ms-compatibility -DEXTERNINLINE
+// RUN: value: false}]}" -- -fno-ms-compatibility -DEXTERNINLINE
extern int Xyz;
extern int Xyz; // Xyz
// RUN: %check_clang_tidy %s readability-redundant-member-init %t \
// RUN: -config="{CheckOptions: \
// RUN: [{key: readability-redundant-member-init.IgnoreBaseInCopyConstructors, \
-// RUN: value: 1}] \
+// RUN: value: true}] \
// RUN: }"
struct S {
// RUN: %check_clang_tidy %s readability-redundant-smartptr-get %t -- \
-// RUN: -config="{CheckOptions: [{key: readability-redundant-smartptr-get.IgnoreMacros, value: 0}]}"
+// RUN: -config="{CheckOptions: [{key: readability-redundant-smartptr-get.IgnoreMacros, value: false}]}"
namespace std {
-// RUN: %check_clang_tidy %s readability-simplify-boolean-expr %t -- -config="{CheckOptions: [{key: "readability-simplify-boolean-expr.ChainedConditionalAssignment", value: 1}]}" --
+// RUN: %check_clang_tidy %s readability-simplify-boolean-expr %t -- -config="{CheckOptions: [{key: "readability-simplify-boolean-expr.ChainedConditionalAssignment", value: true}]}" --
void chained_conditional_compound_assignment(int i) {
bool b;
-// RUN: %check_clang_tidy %s readability-simplify-boolean-expr %t -- -config="{CheckOptions: [{key: "readability-simplify-boolean-expr.ChainedConditionalReturn", value: 1}]}" --
+// RUN: %check_clang_tidy %s readability-simplify-boolean-expr %t -- -config="{CheckOptions: [{key: "readability-simplify-boolean-expr.ChainedConditionalReturn", value: true}]}" --
bool chained_conditional_compound_return(int i) {
if (i < 0) {
// RUN: %check_clang_tidy %s readability-uppercase-literal-suffix %t -- \
-// RUN: -config="{CheckOptions: [{key: readability-uppercase-literal-suffix.IgnoreMacros, value: 0}]}" \
+// RUN: -config="{CheckOptions: [{key: readability-uppercase-literal-suffix.IgnoreMacros, value: false}]}" \
// RUN: -- -I %S
void macros() {
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-use-using.IgnoreMacros
- value: 1
+ value: true
- key: modernize-loop-convert.MaxCopySize
value: '20'
- key: llvm-qualified-auto.AddConstToQualified
- value: '1'
+ value: 'true'
- key: IgnoreMacros
- value: '0'
+ value: 'false'
// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init,hicpp-member-init,modernize-use-emplace,hicpp-use-emplace %t -- \
//// RUN: -config='{CheckOptions: [ \
-//// RUN: {key: cppcoreguidelines-pro-type-member-init.UseAssignment, value: 1}, \
+//// RUN: {key: cppcoreguidelines-pro-type-member-init.UseAssignment, value: true}, \
//// RUN: ]}'
class Foo {