1//===--- MiscTidyModule.cpp - clang-tidy ----------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "../ClangTidy.h"
10#include "../ClangTidyModule.h"
11#include "../ClangTidyModuleRegistry.h"
12#include "ConfusableIdentifierCheck.h"
13#include "ConstCorrectnessCheck.h"
14#include "CoroutineHostileRAIICheck.h"
15#include "DefinitionsInHeadersCheck.h"
16#include "HeaderIncludeCycleCheck.h"
17#include "IncludeCleanerCheck.h"
18#include "MisleadingBidirectional.h"
19#include "MisleadingIdentifier.h"
20#include "MisplacedConstCheck.h"
21#include "NewDeleteOverloadsCheck.h"
22#include "NoRecursionCheck.h"
23#include "NonCopyableObjects.h"
24#include "NonPrivateMemberVariablesInClassesCheck.h"
25#include "RedundantExpressionCheck.h"
26#include "StaticAssertCheck.h"
27#include "ThrowByValueCatchByReferenceCheck.h"
28#include "UnconventionalAssignOperatorCheck.h"
29#include "UniqueptrResetReleaseCheck.h"
30#include "UnusedAliasDeclsCheck.h"
31#include "UnusedParametersCheck.h"
32#include "UnusedUsingDeclsCheck.h"
33#include "UseAnonymousNamespaceCheck.h"
34
35namespace clang::tidy {
36namespace misc {
37
38class MiscModule : public ClangTidyModule {
39public:
40 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
41 CheckFactories.registerCheck<ConfusableIdentifierCheck>(
42 CheckName: "misc-confusable-identifiers");
43 CheckFactories.registerCheck<ConstCorrectnessCheck>(
44 CheckName: "misc-const-correctness");
45 CheckFactories.registerCheck<CoroutineHostileRAIICheck>(
46 CheckName: "misc-coroutine-hostile-raii");
47 CheckFactories.registerCheck<DefinitionsInHeadersCheck>(
48 CheckName: "misc-definitions-in-headers");
49 CheckFactories.registerCheck<HeaderIncludeCycleCheck>(
50 CheckName: "misc-header-include-cycle");
51 CheckFactories.registerCheck<IncludeCleanerCheck>(CheckName: "misc-include-cleaner");
52 CheckFactories.registerCheck<MisleadingBidirectionalCheck>(
53 CheckName: "misc-misleading-bidirectional");
54 CheckFactories.registerCheck<MisleadingIdentifierCheck>(
55 CheckName: "misc-misleading-identifier");
56 CheckFactories.registerCheck<MisplacedConstCheck>(CheckName: "misc-misplaced-const");
57 CheckFactories.registerCheck<NewDeleteOverloadsCheck>(
58 CheckName: "misc-new-delete-overloads");
59 CheckFactories.registerCheck<NoRecursionCheck>(CheckName: "misc-no-recursion");
60 CheckFactories.registerCheck<NonCopyableObjectsCheck>(
61 CheckName: "misc-non-copyable-objects");
62 CheckFactories.registerCheck<NonPrivateMemberVariablesInClassesCheck>(
63 CheckName: "misc-non-private-member-variables-in-classes");
64 CheckFactories.registerCheck<RedundantExpressionCheck>(
65 CheckName: "misc-redundant-expression");
66 CheckFactories.registerCheck<StaticAssertCheck>(CheckName: "misc-static-assert");
67 CheckFactories.registerCheck<ThrowByValueCatchByReferenceCheck>(
68 CheckName: "misc-throw-by-value-catch-by-reference");
69 CheckFactories.registerCheck<UnconventionalAssignOperatorCheck>(
70 CheckName: "misc-unconventional-assign-operator");
71 CheckFactories.registerCheck<UniqueptrResetReleaseCheck>(
72 CheckName: "misc-uniqueptr-reset-release");
73 CheckFactories.registerCheck<UnusedAliasDeclsCheck>(
74 CheckName: "misc-unused-alias-decls");
75 CheckFactories.registerCheck<UnusedParametersCheck>(
76 CheckName: "misc-unused-parameters");
77 CheckFactories.registerCheck<UnusedUsingDeclsCheck>(
78 CheckName: "misc-unused-using-decls");
79 CheckFactories.registerCheck<UseAnonymousNamespaceCheck>(
80 CheckName: "misc-use-anonymous-namespace");
81 }
82};
83
84} // namespace misc
85
86// Register the MiscTidyModule using this statically initialized variable.
87static ClangTidyModuleRegistry::Add<misc::MiscModule>
88 X("misc-module", "Adds miscellaneous lint checks.");
89
90// This anchor is used to force the linker to link in the generated object file
91// and thus register the MiscModule.
92volatile int MiscModuleAnchorSource = 0;
93
94} // namespace clang::tidy
95

source code of clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp