[libcxx-commits] [libcxx] [libcxxabi] [libc++abi][NFC] Add a clang-tidy config (PR #207324)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 10 07:31:04 PDT 2026


https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/207324

>From 147404d546d8b6e8df053826ef894cb74d17d7ad Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Fri, 3 Jul 2026 07:19:18 +0200
Subject: [PATCH] [libc++abi][NFC] Add a clang-tidy config

---
 libcxx/test/libcxx/clang_tidy.sh.py |  5 +--
 libcxxabi/.clang-tidy               | 55 +++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 2 deletions(-)
 create mode 100644 libcxxabi/.clang-tidy

diff --git a/libcxx/test/libcxx/clang_tidy.sh.py b/libcxx/test/libcxx/clang_tidy.sh.py
index 630428564597d..71205866cacb8 100644
--- a/libcxx/test/libcxx/clang_tidy.sh.py
+++ b/libcxx/test/libcxx/clang_tidy.sh.py
@@ -11,5 +11,6 @@
 # RUN: %{python} %{libcxx-dir}/../clang-tools-extra/clang-tidy/tool/run-clang-tidy.py   \
 # RUN:      -clang-tidy-binary %{clang-tidy}                                            \
 # RUN:      -warnings-as-errors "*"                                                     \
-# RUN:      -source-filter=".*libcxx/src.*"                                             \
-# RUN:      -quiet -p %{bin-dir}/..
+# RUN:      -source-filter=".*libcxx(|abi)/src.*"                                       \
+# RUN:      -quiet -p %{bin-dir}/..                                                     \
+# RUN:      -header-filter ^$
diff --git a/libcxxabi/.clang-tidy b/libcxxabi/.clang-tidy
new file mode 100644
index 0000000000000..159436c442b36
--- /dev/null
+++ b/libcxxabi/.clang-tidy
@@ -0,0 +1,55 @@
+Checks: >
+  bugprone-copy-constructor-init,
+  bugprone-dangling-handle,
+  bugprone-infinite-loop,
+  bugprone-stringview-nullptr,
+  bugprone-use-after-move,
+
+  misc-definitions-in-headers,
+  misc-misplaced-const,
+  misc-non-copyable-objects,
+  misc-uniqueptr-reset-release,
+
+  modernize-loop-convert,
+  modernize-redundant-void-arg,
+  modernize-use-override,
+
+  readability-duplicate-include,
+  readability-function-cognitive-complexity,
+  readability-function-size,
+  readability-misplaced-array-index,
+  readability-redundant-control-flow,
+  readability-redundant-function-ptr-dereference,
+  readability-redundant-preprocessor,
+  readability-simplify-boolean-expr,
+  readability-simplify-subscript-expr,
+  readability-uniqueptr-delete-release,
+
+CheckOptions:
+  - key:   readability-function-cognitive-complexity.Threshold
+    value: 143 # TODO: bring that number down
+  - key:   readability-function-size.LineThreshold
+    value: 268 # TODO: bring that number down
+  - key:   readability-identifier-naming.GetConfigPerFile
+    value: false
+  - key:   readability-identifier-naming.ParameterCase
+    value: lower_case
+  - key:   readability-identifier-naming.PrivateMemberCase
+    value: lower_case
+  - key:   readability-identifier-naming.PrivateMemberSuffix
+    value: _
+  - key:   readability-identifier-naming.LocalVariableCase
+    value: lower_case
+  - key:   readability-identifier-naming.TemplateParameterCase
+    value: CamelCase
+  - key:   readability-identifier-naming.ValueTemplateParameterCase
+    value: CamelCase
+  - key:   readability-identifier-naming.ValueTemplateParameterIgnoredRegexp
+    value: (__[a-z_]|_[A-Z]).* # TODO: Converge on a single style for value template parameters
+
+# TODO: Enable these checks
+# modernize-use-equals-delete,
+# modernize-use-nullptr,
+# readability-identifier-naming,
+# llvm-include-order,
+# llvm-namespace-comment,



More information about the libcxx-commits mailing list