38class GoogleModule :
public ClangTidyModule {
40 void addCheckFactories(ClangTidyCheckFactories &CheckFactories)
override {
41 CheckFactories.registerCheck<build::ExplicitMakePairCheck>(
42 "google-build-explicit-make-pair");
43 CheckFactories.registerCheck<misc::AnonymousNamespaceInHeaderCheck>(
44 "google-build-namespaces");
45 CheckFactories.registerCheck<build::UsingNamespaceDirectiveCheck>(
46 "google-build-using-namespace");
47 CheckFactories.registerCheck<DefaultArgumentsCheck>(
48 "google-default-arguments");
49 CheckFactories.registerCheck<ExplicitConstructorCheck>(
50 "google-explicit-constructor");
51 CheckFactories.registerCheck<readability::GlobalNamesInHeadersCheck>(
52 "google-global-names-in-headers");
53 CheckFactories.registerCheck<objc::AvoidNSObjectNewCheck>(
54 "google-objc-avoid-nsobject-new");
55 CheckFactories.registerCheck<objc::AvoidThrowingObjCExceptionCheck>(
56 "google-objc-avoid-throwing-exception");
57 CheckFactories.registerCheck<objc::FunctionNamingCheck>(
58 "google-objc-function-naming");
59 CheckFactories.registerCheck<objc::GlobalVariableDeclarationCheck>(
60 "google-objc-global-variable-declaration");
61 CheckFactories.registerCheck<runtime::RuntimeFloatCheck>(
62 "google-runtime-float");
63 CheckFactories.registerCheck<runtime::IntegerTypesCheck>(
64 "google-runtime-int");
65 CheckFactories.registerCheck<runtime::OverloadedUnaryAndCheck>(
66 "google-runtime-operator");
68 .registerCheck<readability::AvoidUnderscoreInGoogletestNameCheck>(
69 "google-readability-avoid-underscore-in-googletest-name");
70 CheckFactories.registerCheck<modernize::AvoidCStyleCastCheck>(
71 "google-readability-casting");
72 CheckFactories.registerCheck<readability::TodoCommentCheck>(
73 "google-readability-todo");
75 .registerCheck<clang::tidy::readability::BracesAroundStatementsCheck>(
76 "google-readability-braces-around-statements");
77 CheckFactories.registerCheck<clang::tidy::readability::FunctionSizeCheck>(
78 "google-readability-function-size");
80 .registerCheck<clang::tidy::readability::NamespaceCommentCheck>(
81 "google-readability-namespace-comments");
82 CheckFactories.registerCheck<UpgradeGoogletestCaseCheck>(
83 "google-upgrade-googletest-case");
86 ClangTidyOptions getModuleOptions()
override {
87 ClangTidyOptions Options;
89 Opts[
"google-readability-braces-around-statements.ShortStatementLines"] =
91 Opts[
"google-readability-function-size.StatementThreshold"] =
"800";
92 Opts[
"google-readability-namespace-comments.ShortNamespaceLines"] =
"10";
93 Opts[
"google-readability-namespace-comments.SpacesBeforeComments"] =
"2";
101static ClangTidyModuleRegistry::Add<GoogleModule>
X(
"google-module",
102 "Adds Google lint checks.");
static ClangTidyModuleRegistry::Add< GoogleModule > X("google-module", "Adds Google lint checks.")
volatile int GoogleModuleAnchorSource
OptionMap CheckOptions
Key-value mapping used to store check-specific options.