clang-tools  3.8.0
ReadabilityTidyModule.cpp
Go to the documentation of this file.
1 //===--- ReadabilityTidyModule.cpp - clang-tidy ---------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "../ClangTidy.h"
11 #include "../ClangTidyModule.h"
12 #include "../ClangTidyModuleRegistry.h"
15 #include "ElseAfterReturnCheck.h"
16 #include "FunctionSizeCheck.h"
17 #include "IdentifierNamingCheck.h"
18 #include "ImplicitBoolCastCheck.h"
20 #include "NamedParameterCheck.h"
25 
26 namespace clang {
27 namespace tidy {
28 namespace readability {
29 
31 public:
32  void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
34  "readability-braces-around-statements");
35  CheckFactories.registerCheck<ContainerSizeEmptyCheck>(
36  "readability-container-size-empty");
37  CheckFactories.registerCheck<ElseAfterReturnCheck>(
38  "readability-else-after-return");
39  CheckFactories.registerCheck<FunctionSizeCheck>(
40  "readability-function-size");
41  CheckFactories.registerCheck<IdentifierNamingCheck>(
42  "readability-identifier-naming");
43  CheckFactories.registerCheck<ImplicitBoolCastCheck>(
44  "readability-implicit-bool-cast");
46  "readability-inconsistent-declaration-parameter-name");
48  "readability-uniqueptr-delete-release");
50  "readability-named-parameter");
52  "readability-redundant-smartptr-get");
54  "readability-redundant-string-cstr");
56  "readability-simplify-boolean-expr");
57  }
58 };
59 
60 // Register the ReadabilityModule using this statically initialized variable.
61 static ClangTidyModuleRegistry::Add<ReadabilityModule>
62  X("readability-module", "Adds readability-related checks.");
63 
64 } // namespace readability
65 
66 // This anchor is used to force the linker to link in the generated object file
67 // and thus register the ReadabilityModule.
69 
70 } // namespace tidy
71 } // namespace clang
static ClangTidyModuleRegistry::Add< ReadabilityModule > X("readability-module","Adds readability-related checks.")
Flag statements of the form: delete <unique_ptr expr>="">.release() and replace them with: <unique_pt...
volatile int ReadabilityModuleAnchorSource
void registerCheck(StringRef CheckName)
Registers the CheckType with the name Name.
Looks for boolean expressions involving boolean constants and simplifies them to use the appropriate ...
Checks whether a call to the size() method can be replaced with a call to empty().
A collection of ClangTidyCheckFactory instances.
Flags the usages of else after return.
Checks for large functions based on various metrics.
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Find and remove redundant calls to smart pointer's .get() method.
Checks for use of implicit bool casts in expressions.
Checks for declarations of functions which differ in parameter names.
Find functions with unnamed arguments.
Finds unnecessary calls to std::string::c_str().
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module...
Checks that bodies of if statements and loops (for, range-for, do-while, and while) are inside braces...
Checks for identifiers naming style mismatch.