[clang-tools-extra] [clang-tidy] Create a check for signed and unsigned integers comparison (PR #113144)
Julian Schmidt via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 31 16:53:53 PDT 2024
================
@@ -0,0 +1,46 @@
+//===--- QtTidyModule.cpp - clang-tidy ------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "../ClangTidy.h"
+#include "../ClangTidyModule.h"
+#include "../ClangTidyModuleRegistry.h"
+#include "../modernize/UseIntegerSignComparisonCheck.h"
+
+namespace clang::tidy {
+namespace qt {
+
+/// A module containing checks of the C++ Core Guidelines
+class QtClangTidyModule : public ClangTidyModule {
+public:
+ void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
+ CheckFactories.registerCheck<modernize::UseIntegerSignComparisonCheck>(
+ "qt-integer-sign-comparison");
+ }
+
+ ClangTidyOptions getModuleOptions() override {
+ ClangTidyOptions Options;
+ ClangTidyOptions::OptionMap &Opts = Options.CheckOptions;
+
+ Opts["qt-integer-sign-comparison.IncludeStyle"] = "llvm";
+ Opts["qt-integer-sign-comparison.IsQtApplication"] = "true";
+
+ return Options;
+ }
+};
+
+// Register the LLVMTidyModule using this statically initialized variable.
+static ClangTidyModuleRegistry::Add<QtClangTidyModule>
+ X("qt-module", "Adds checks for the Qt framework Guidelines.");
----------------
5chmidti wrote:
`Guidelines` was probably left over as well, right?
https://github.com/llvm/llvm-project/pull/113144
More information about the cfe-commits
mailing list