aboutsummaryrefslogtreecommitdiff
path: root/clang-tidy/NixClangTidyChecks.cc
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-03-17 19:54:58 -0700
committerJade Lovelace <lix@jade.fyi>2024-03-18 16:10:29 -0700
commit6b0020749d4b1711b669ba68fe74474f8241f084 (patch)
tree2dc3b3c61350187d299b689571653fd1ca35e131 /clang-tidy/NixClangTidyChecks.cc
parent61e21b25576f7f3491f6a837bf59d8b44c6897a0 (diff)
clang-tidy check infrastructure
This brings in infrastructure for developing new custom clang-tidy lints and refactors for Lix. Change-Id: I3df5f5855712ab4f97d4e84d771e5e818f81f881
Diffstat (limited to 'clang-tidy/NixClangTidyChecks.cc')
-rw-r--r--clang-tidy/NixClangTidyChecks.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang-tidy/NixClangTidyChecks.cc b/clang-tidy/NixClangTidyChecks.cc
new file mode 100644
index 000000000..8f0309107
--- /dev/null
+++ b/clang-tidy/NixClangTidyChecks.cc
@@ -0,0 +1,17 @@
+#include <clang-tidy/ClangTidyModule.h>
+#include <clang-tidy/ClangTidyModuleRegistry.h>
+#include "HasPrefixSuffix.hh"
+
+namespace nix::clang_tidy {
+using namespace clang;
+using namespace clang::tidy;
+
+class NixClangTidyChecks : public ClangTidyModule {
+ public:
+ void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
+ CheckFactories.registerCheck<HasPrefixSuffixCheck>("nix-hasprefixsuffix");
+ }
+};
+
+static ClangTidyModuleRegistry::Add<NixClangTidyChecks> X("nix-module", "Adds nix specific checks");
+};