aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/clang_tidy/arcadia_checks/tidy_module.cpp
blob: add729d5fb11471ad1aa90315025244716514c79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <contrib/libs/clang16/tools/extra/clang-tidy/ClangTidy.h>
#include <contrib/libs/clang16/tools/extra/clang-tidy/ClangTidyModule.h>
#include <contrib/libs/clang16/tools/extra/clang-tidy/ClangTidyModuleRegistry.h>

#include "taxi_coroutine_unsafe_check.h"
#include "taxi_dangling_config_ref_check.h"

#include "ascii_compare_ignore_case_check.h"
#include "usage_restriction_checks.h"

using namespace clang::ast_matchers;

namespace clang::tidy::arcadia {
    class ArcadiaModule: public ClangTidyModule {
    public:
        void addCheckFactories(ClangTidyCheckFactories& CheckFactories) override {
            CheckFactories.registerCheck<misc::TaxiCoroutineUnsafeCheck>(
                "arcadia-taxi-coroutine-unsafe");
            CheckFactories.registerCheck<misc::TaxiDanglingConfigRefCheck>(
                "arcadia-taxi-dangling-config-ref");

            // https://st.yandex-team.ru/IGNIETFERRO-1863
            CheckFactories.registerCheck<TypeidNameRestrictionCheck>(
                "arcadia-typeid-name-restriction");
            CheckFactories.registerCheck<AsciiCompareIgnoreCaseCheck>("arcadia-ascii-compare-ignorecase");
        }
    };

    // Register the ArcadiaTidyModule using this statically initialized variable.
    static ClangTidyModuleRegistry::Add<ArcadiaModule>
        X("arcadia-module", "Adds Arcadia specific lint checks.");

}