Skip to content

[NFC][clangd][test] add clang-tidy config to ensure test cases sandbox #141410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HerrCai0907
Copy link
Contributor

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.

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.
@llvmbot
Copy link
Member

llvmbot commented May 25, 2025

@llvm/pr-subscribers-clangd

@llvm/pr-subscribers-clang-tools-extra

Author: Congcong Cai (HerrCai0907)

Changes

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.


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

2 Files Affected:

  • (added) clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy (+1)
  • (modified) clang-tools-extra/clangd/test/system-include-extractor.test (+3)
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants