[libcxx-commits] [libcxx] [libc++] Run clang-tidy only once per header (PR #121436)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 2 08:31:22 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

<details>
<summary>Changes</summary>

There doesn't seem to be much of a reason to run clang-tidy twice per headers, and running it only once makes the test a few seconds faster.


---
Full diff: https://github.com/llvm/llvm-project/pull/121436.diff


2 Files Affected:

- (modified) libcxx/.clang-tidy (+2) 
- (modified) libcxx/test/libcxx/clang_tidy.gen.py (+1-2) 


``````````diff
diff --git a/libcxx/.clang-tidy b/libcxx/.clang-tidy
index f986e2100ca6b1..ebbfab03792651 100644
--- a/libcxx/.clang-tidy
+++ b/libcxx/.clang-tidy
@@ -5,6 +5,8 @@ Checks: >
   bugprone-stringview-nullptr,
   bugprone-use-after-move,
 
+  libcpp-*,
+
   llvm-include-order,
   llvm-namespace-comment,
 
diff --git a/libcxx/test/libcxx/clang_tidy.gen.py b/libcxx/test/libcxx/clang_tidy.gen.py
index 0db9c0d14b196e..06f277e901d335 100644
--- a/libcxx/test/libcxx/clang_tidy.gen.py
+++ b/libcxx/test/libcxx/clang_tidy.gen.py
@@ -33,8 +33,7 @@
 {lit_header_undeprecations.get(header, '')}
 
 // TODO: run clang-tidy with modules enabled once they are supported
-// RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --checks='-*,libcpp-*' --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- %{{compile_flags}} -fno-modules
-// RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy -- -Wweak-vtables %{{compile_flags}} -fno-modules
+// RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- -Wweak-vtables %{{compile_flags}} -fno-modules
 
 #include <{header}>
 """)

``````````

</details>


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


More information about the libcxx-commits mailing list