tidy_module.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. #include <contrib/libs/clang16/tools/extra/clang-tidy/ClangTidy.h>
  2. #include <contrib/libs/clang16/tools/extra/clang-tidy/ClangTidyModule.h>
  3. #include <contrib/libs/clang16/tools/extra/clang-tidy/ClangTidyModuleRegistry.h>
  4. #include "taxi_coroutine_unsafe_check.h"
  5. #include "taxi_dangling_config_ref_check.h"
  6. #include "ascii_compare_ignore_case_check.h"
  7. #include "usage_restriction_checks.h"
  8. using namespace clang::ast_matchers;
  9. namespace clang::tidy::arcadia {
  10. class ArcadiaModule: public ClangTidyModule {
  11. public:
  12. void addCheckFactories(ClangTidyCheckFactories& CheckFactories) override {
  13. CheckFactories.registerCheck<misc::TaxiCoroutineUnsafeCheck>(
  14. "arcadia-taxi-coroutine-unsafe");
  15. CheckFactories.registerCheck<misc::TaxiDanglingConfigRefCheck>(
  16. "arcadia-taxi-dangling-config-ref");
  17. // https://st.yandex-team.ru/IGNIETFERRO-1863
  18. CheckFactories.registerCheck<TypeidNameRestrictionCheck>(
  19. "arcadia-typeid-name-restriction");
  20. CheckFactories.registerCheck<AsciiCompareIgnoreCaseCheck>("arcadia-ascii-compare-ignorecase");
  21. }
  22. };
  23. // Register the ArcadiaTidyModule using this statically initialized variable.
  24. static ClangTidyModuleRegistry::Add<ArcadiaModule>
  25. X("arcadia-module", "Adds Arcadia specific lint checks.");
  26. }