https://github.com/HerrCai0907 updated 
https://github.com/llvm/llvm-project/pull/141410

>From ac614ac46750b19d2810d838112ba8b01388f577 Mon Sep 17 00:00:00 2001
From: Congcong Cai <congcongcai0...@163.com>
Date: Sun, 25 May 2025 23:30:24 +0800
Subject: [PATCH 1/2] [NFC][clangd][test] add clang-tidy config to ensure test
 cases sandbox

Under previous test setup, the test result will be influenced by clang-tidy 
file in parent folder (between llvm-projects root and build folder). It is 
inconventient and leads some confusion.
This PR wants to ensure sandbox to avoid outside's clang-tidy influenece test 
result.
---
 .../clangd/test/Inputs/path-mappings/server/.clang-tidy        | 1 +
 clang-tools-extra/clangd/test/system-include-extractor.test    | 3 +++
 2 files changed, 4 insertions(+)
 create mode 100644 
clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy

diff --git 
a/clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy 
b/clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy
new file mode 100644
index 0000000000000..1f16f2a33b3ce
--- /dev/null
+++ b/clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy
@@ -0,0 +1 @@
+InheritParentConfig: false
\ No newline at end of file
diff --git a/clang-tools-extra/clangd/test/system-include-extractor.test 
b/clang-tools-extra/clangd/test/system-include-extractor.test
index 4ccc093671324..372b4a1a0fef5 100644
--- a/clang-tools-extra/clangd/test/system-include-extractor.test
+++ b/clang-tools-extra/clangd/test/system-include-extractor.test
@@ -32,6 +32,9 @@
 # RUN: echo 'printf "End of search list.\r\n" >&2' >> %t.dir/bin/my_driver.sh
 # RUN: chmod +x %t.dir/bin/my_driver.sh
 
+# Create fake clang-tidy config to ensure sandbox
+# RUN: echo 'InheritParentConfig: false' >> %t.dir/.clang-tidy
+
 # Create header files my/dir/a.h and my/dir2/b.h
 # RUN: mkdir -p %t.dir/my/dir
 # RUN: touch %t.dir/my/dir/a.h

>From 42c5e71e8db3116acf7c4e04a16b0ab7398b39b9 Mon Sep 17 00:00:00 2001
From: Congcong Cai <congcongcai0...@163.com>
Date: Mon, 26 May 2025 22:38:23 +0800
Subject: [PATCH 2/2] disable clang-tidy

---
 .../clangd/test/Inputs/path-mappings/server/.clang-tidy    | 1 -
 clang-tools-extra/clangd/test/path-mappings.test           | 2 +-
 .../clangd/test/system-include-extractor.test              | 7 ++-----
 3 files changed, 3 insertions(+), 7 deletions(-)
 delete mode 100644 
clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy

diff --git 
a/clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy 
b/clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy
deleted file mode 100644
index 1f16f2a33b3ce..0000000000000
--- a/clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy
+++ /dev/null
@@ -1 +0,0 @@
-InheritParentConfig: false
\ No newline at end of file
diff --git a/clang-tools-extra/clangd/test/path-mappings.test 
b/clang-tools-extra/clangd/test/path-mappings.test
index c566905c22eba..6b85c27be519d 100644
--- a/clang-tools-extra/clangd/test/path-mappings.test
+++ b/clang-tools-extra/clangd/test/path-mappings.test
@@ -2,7 +2,7 @@
 # RUN: rm -rf %t
 # RUN: cp -r %S/Inputs/path-mappings %t
 #
-# RUN: clangd --path-mappings 'C:\client=%t/server' -lit-test < %s | FileCheck 
-strict-whitespace %s
+# RUN: clangd --clang-tidy=false --path-mappings 'C:\client=%t/server' 
-lit-test < %s | FileCheck -strict-whitespace %s
 
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
 ---
 {
diff --git a/clang-tools-extra/clangd/test/system-include-extractor.test 
b/clang-tools-extra/clangd/test/system-include-extractor.test
index 372b4a1a0fef5..83a8c28bf7d56 100644
--- a/clang-tools-extra/clangd/test/system-include-extractor.test
+++ b/clang-tools-extra/clangd/test/system-include-extractor.test
@@ -32,9 +32,6 @@
 # RUN: echo 'printf "End of search list.\r\n" >&2' >> %t.dir/bin/my_driver.sh
 # RUN: chmod +x %t.dir/bin/my_driver.sh
 
-# Create fake clang-tidy config to ensure sandbox
-# RUN: echo 'InheritParentConfig: false' >> %t.dir/.clang-tidy
-
 # Create header files my/dir/a.h and my/dir2/b.h
 # RUN: mkdir -p %t.dir/my/dir
 # RUN: touch %t.dir/my/dir/a.h
@@ -55,7 +52,7 @@
 # Bless the mock driver we've just created so that clangd can execute it.
 # Note: include clangd's stderr in the FileCheck input with "2>&1" so that we
 # can match output lines like "ASTWorker building file"
-# RUN: clangd -lit-test -query-driver="**.test,**.sh" < %t.test 2>&1 | 
FileCheck -strict-whitespace %t.test
+# RUN: clangd --clang-tidy=false -lit-test -query-driver="**.test,**.sh" < 
%t.test 2>&1 | FileCheck -strict-whitespace %t.test
 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{}}
 ---
 {
@@ -91,4 +88,4 @@
 
 # Run clangd a second time, to make sure it picks up the driver name from the 
config file
 # Note, we need to pass -enable-config because -lit-test otherwise disables it
-# RUN: clangd -lit-test -enable-config -query-driver="**.test,**.sh" < %t.test 
2>&1 | FileCheck -strict-whitespace %t.test
+# RUN: clangd --clang-tidy=false -lit-test -enable-config 
-query-driver="**.test,**.sh" < %t.test 2>&1 | FileCheck -strict-whitespace 
%t.test

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to