[libcxx] [llvm] [RFC][libc++] Reworks clang-tidy selection. (PR #81362)
Louis Dionne via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 13 09:00:57 PST 2024
================
@@ -7,6 +7,7 @@
# ===----------------------------------------------------------------------===##
from libcxx.test.dsl import *
+import libcxx.test.config as config
----------------
ldionne wrote:
I really like how cleaner the logic is after this patch, however I would really like to avoid threading this through the CMake. Ideally, the test suite would be the one to figure out the executable to use for clang-tidy. Something like this:
```diff
diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 89d9f22e9dc6..c6b32f6fae61 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -366,6 +366,16 @@ DEFAULT_PARAMETERS = [
default=f"{shlex.quote(sys.executable)} {shlex.quote(str(Path(__file__).resolve().parent.parent.parent / 'run.py'))}",
help="Custom executor to use instead of the configured default.",
actions=lambda executor: [AddSubstitution("%{executor}", executor)],
+ ),
+ Parameter(
+ name='clang-tidy-executable',
+ type=str,
+ default=_getSuitableClangTidy(),
+ help="TODO",
+ actions=lambda exe: [] if exe is None else [
+ AddSubstitution('%{clang-tidy}', exe),
+ AddFeature('has-clang-tidy')
+ ]
)
]
# fmt: on
```
https://github.com/llvm/llvm-project/pull/81362
More information about the llvm-commits
mailing list