[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 6 11:38:32 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 3b29a8a00809e868e3df7e687695670ff5077fbd ee10510d15e75da7fc75420fa33d00e97d6477a0 --extensions h,cpp -- clang-tools-extra/test/clang-tidy/checkers/bugprone/Inputs/unchecked-optional-access/gtest/gtest.h clang-tools-extra/test/clang-tidy/checkers/bugprone/unchecked-optional-access-ignore-googletest.cpp clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.h b/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.h
index 3e20fd1a1e..ec87e23fa7 100644
--- a/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.h
+++ b/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.h
@@ -11,10 +11,10 @@
 
 #include "../ClangTidyCheck.h"
 #include "../ClangTidyOptions.h"
-#include "clang/Basic/LLVM.h"
-#include "clang/Basic/LangOptions.h"
 #include "clang/ASTMatchers/ASTMatchFinder.h"
 #include "clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h"
+#include "clang/Basic/LLVM.h"
+#include "clang/Basic/LangOptions.h"
 
 namespace clang::tidy::bugprone {
 
@@ -40,8 +40,7 @@ public:
   void storeOptions(ClangTidyOptions::OptionMap &Opts) override {
     Options.store(Opts, "IgnoreSmartPointerDereference",
                   ModelOptions.IgnoreSmartPointerDereference);
-    Options.store(Opts, "IgnoreTestTUs",
-                  ignore_test_tus_);
+    Options.store(Opts, "IgnoreTestTUs", ignore_test_tus_);
   }
 
 private:

``````````

</details>


https://github.com/llvm/llvm-project/pull/115051


More information about the cfe-commits mailing list