aboutsummaryrefslogtreecommitdiff
path: root/clang-tidy/FixIncludes.hh
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-03-29 20:26:38 -0700
committerjade <lix@jade.fyi>2024-04-06 04:40:19 +0000
commit43cf487c256395e03f2e10f1f66b3933f201a4e8 (patch)
tree7cd40af4daf8f3c40f50596bbaeb00f5bbe43676 /clang-tidy/FixIncludes.hh
parent194a1b91af6d8848e4cc0dfbdcc153ee2dbed140 (diff)
Create clang-tidy check to rename all our includes
It is a little bit scuffed, but it seems to produce correct results. We can run it at a later date when we want to explode every in-flight commit in existence and then need to filter-branch them. Fixes: https://git.lix.systems/lix-project/lix/issues/188 Change-Id: Id97e4651f78804a941d941df02c7c1b21ce453b6
Diffstat (limited to 'clang-tidy/FixIncludes.hh')
-rw-r--r--clang-tidy/FixIncludes.hh21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang-tidy/FixIncludes.hh b/clang-tidy/FixIncludes.hh
new file mode 100644
index 000000000..ea890cd39
--- /dev/null
+++ b/clang-tidy/FixIncludes.hh
@@ -0,0 +1,21 @@
+#pragma once
+///@file
+
+#include <clang-tidy/ClangTidyCheck.h>
+#include <clang/ASTMatchers/ASTMatchFinder.h>
+#include <llvm/ADT/StringRef.h>
+
+namespace nix::clang_tidy {
+
+using namespace clang;
+using namespace clang::tidy;
+
+class FixIncludesCheck : public ClangTidyCheck {
+ public:
+ FixIncludesCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override;
+};
+
+};