Module.cxx 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include <clang-tidy/ClangTidyModule.h>
  4. #include <clang-tidy/ClangTidyModuleRegistry.h>
  5. #include "OstringstreamUseCmstrcatCheck.h"
  6. #include "UseBespokeEnumClassCheck.h"
  7. #include "UseCmstrlenCheck.h"
  8. #include "UseCmsysFstreamCheck.h"
  9. namespace clang {
  10. namespace tidy {
  11. namespace cmake {
  12. class CMakeClangTidyModule : public ClangTidyModule
  13. {
  14. public:
  15. void addCheckFactories(ClangTidyCheckFactories& CheckFactories) override
  16. {
  17. CheckFactories.registerCheck<UseCmstrlenCheck>("cmake-use-cmstrlen");
  18. CheckFactories.registerCheck<UseCmsysFstreamCheck>(
  19. "cmake-use-cmsys-fstream");
  20. CheckFactories.registerCheck<UseBespokeEnumClassCheck>(
  21. "cmake-use-bespoke-enum-class");
  22. CheckFactories.registerCheck<OstringstreamUseCmstrcatCheck>(
  23. "cmake-ostringstream-use-cmstrcat");
  24. }
  25. };
  26. static ClangTidyModuleRegistry::Add<CMakeClangTidyModule> X(
  27. "cmake-clang-tidy", "Adds lint checks for the CMake code base.");
  28. }
  29. }
  30. }