summaryrefslogtreecommitdiff
path: root/Utilities/ClangTidyModule/Module.cxx
blob: c747cee0fb65e392ab06d150a53de8a4d402ea42 (plain)
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
34
35
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
#include <clang-tidy/ClangTidyModule.h>
#include <clang-tidy/ClangTidyModuleRegistry.h>

#include "OstringstreamUseCmstrcatCheck.h"
#include "UseBespokeEnumClassCheck.h"
#include "UseCmstrlenCheck.h"
#include "UseCmsysFstreamCheck.h"
#include "UsePragmaOnceCheck.h"

namespace clang {
namespace tidy {
namespace cmake {
class CMakeClangTidyModule : public ClangTidyModule
{
public:
  void addCheckFactories(ClangTidyCheckFactories& CheckFactories) override
  {
    CheckFactories.registerCheck<UseCmstrlenCheck>("cmake-use-cmstrlen");
    CheckFactories.registerCheck<UseCmsysFstreamCheck>(
      "cmake-use-cmsys-fstream");
    CheckFactories.registerCheck<UseBespokeEnumClassCheck>(
      "cmake-use-bespoke-enum-class");
    CheckFactories.registerCheck<OstringstreamUseCmstrcatCheck>(
      "cmake-ostringstream-use-cmstrcat");
    CheckFactories.registerCheck<UsePragmaOnceCheck>("cmake-use-pragma-once");
  }
};

static ClangTidyModuleRegistry::Add<CMakeClangTidyModule> X(
  "cmake-clang-tidy", "Adds lint checks for the CMake code base.");
}
}
}