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" 13 #include "BracesAroundStatementsCheck.h" 14 #include "FunctionSize.h" 15 #include "RedundantSmartptrGet.h" 16 17 namespace clang { 18 namespace tidy { 19 namespace readability { 20 21 class ReadabilityModule : public ClangTidyModule { 22 public: 23 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { 24 CheckFactories.registerCheck<BracesAroundStatementsCheck>( 25 "readability-braces-around-statements"); 26 CheckFactories.registerCheck<FunctionSizeCheck>( 27 "readability-function-size"); 28 CheckFactories.registerCheck<RedundantSmartptrGet>( 29 "readability-redundant-smartptr-get"); 30 } 31 }; 32 33 } // namespace readability 34 35 // Register the MiscTidyModule using this statically initialized variable. 36 static ClangTidyModuleRegistry::Add<readability::ReadabilityModule> 37 X("readability-module", "Adds readability-related checks."); 38 39 // This anchor is used to force the linker to link in the generated object file 40 // and thus register the MiscModule. 41 volatile int ReadabilityModuleAnchorSource = 0; 42 43 } // namespace tidy 44 } // namespace clang 45