1 #include <llvm/ADT/StringRef.h>
2 
3 #include "AlmostNeverAutoCheck.h"
4 #include "AssertCheck.h"
5 #include "ClangTidyModule.h"
6 #include "ClangTidyModuleRegistry.h"
7 #include "CombineLocalsIntoPointCheck.h"
8 #include "DeterminismCheck.h"
9 #include "HeaderGuardCheck.h"
10 #include "JsonTranslationInputCheck.h"
11 #include "NoLongCheck.h"
12 #include "NoStaticGettextCheck.h"
13 #include "PointInitializationCheck.h"
14 #include "SimplifyPointConstructorsCheck.h"
15 #include "StaticDeclarationsCheck.h"
16 #include "StaticStringIdConstantsCheck.h"
17 #include "TestFilenameCheck.h"
18 #include "TestsMustRestoreGlobalStateCheck.h"
19 #include "TextStyleCheck.h"
20 #include "TranslatorCommentsCheck.h"
21 #include "UseLocalizedSortingCheck.h"
22 #include "UseNamedPointConstantsCheck.h"
23 #include "UsePointApisCheck.h"
24 #include "UsePointArithmeticCheck.h"
25 #include "XYCheck.h"
26 
27 namespace clang
28 {
29 namespace tidy
30 {
31 namespace cata
32 {
33 
34 class CataModule : public ClangTidyModule
35 {
36     public:
addCheckFactories(ClangTidyCheckFactories & CheckFactories)37         void addCheckFactories( ClangTidyCheckFactories &CheckFactories ) override {
38             CheckFactories.registerCheck<AlmostNeverAutoCheck>( "cata-almost-never-auto" );
39             CheckFactories.registerCheck<AssertCheck>( "cata-assert" );
40             CheckFactories.registerCheck<CombineLocalsIntoPointCheck>(
41                 "cata-combine-locals-into-point" );
42             CheckFactories.registerCheck<DeterminismCheck>( "cata-determinism" );
43             CheckFactories.registerCheck<CataHeaderGuardCheck>( "cata-header-guard" );
44             CheckFactories.registerCheck<JsonTranslationInputCheck>( "cata-json-translation-input" );
45             CheckFactories.registerCheck<NoLongCheck>( "cata-no-long" );
46             CheckFactories.registerCheck<NoStaticGettextCheck>( "cata-no-static-gettext" );
47             CheckFactories.registerCheck<PointInitializationCheck>( "cata-point-initialization" );
48             CheckFactories.registerCheck<SimplifyPointConstructorsCheck>(
49                 "cata-simplify-point-constructors" );
50             CheckFactories.registerCheck<StaticDeclarationsCheck>( "cata-static-declarations" );
51             CheckFactories.registerCheck<StaticStringIdConstantsCheck>(
52                 "cata-static-string_id-constants" );
53             CheckFactories.registerCheck<TestFilenameCheck>( "cata-test-filename" );
54             CheckFactories.registerCheck<TestsMustRestoreGlobalStateCheck>(
55                 "cata-tests-must-restore-global-state" );
56             CheckFactories.registerCheck<TextStyleCheck>( "cata-text-style" );
57             CheckFactories.registerCheck<TranslatorCommentsCheck>( "cata-translator-comments" );
58             CheckFactories.registerCheck<UseLocalizedSortingCheck>( "cata-use-localized-sorting" );
59             CheckFactories.registerCheck<UseNamedPointConstantsCheck>(
60                 "cata-use-named-point-constants" );
61             CheckFactories.registerCheck<UsePointApisCheck>( "cata-use-point-apis" );
62             CheckFactories.registerCheck<UsePointArithmeticCheck>( "cata-use-point-arithmetic" );
63             CheckFactories.registerCheck<XYCheck>( "cata-xy" );
64         }
65 };
66 
67 } // namespace cata
68 
69 // Register the MiscTidyModule using this statically initialized variable.
70 static ClangTidyModuleRegistry::Add<cata::CataModule>
71 X( "cata-module", "Adds Cataclysm-DDA checks." );
72 
73 } // namespace tidy
74 } // namespace clang
75