Author: Devon Loehr
Date: 2025-04-18T08:43:00-07:00
New Revision: 915de1a5889c4dad1ec7b77ac5c41ebabc20a8ca

URL: 
https://github.com/llvm/llvm-project/commit/915de1a5889c4dad1ec7b77ac5c41ebabc20a8ca
DIFF: 
https://github.com/llvm/llvm-project/commit/915de1a5889c4dad1ec7b77ac5c41ebabc20a8ca.diff

LOG: Generate empty .clang-format-ignore before running tests (#136154)

Followup to #136022, this ensures formatting tests are run with an empty
`.clang-format-ignore` in their root directory, to prevent failures if
the file also exists higher in the tree.

Added: 
    

Modified: 
    clang/test/Format/lit.local.cfg

Removed: 
    


################################################################################
diff  --git a/clang/test/Format/lit.local.cfg b/clang/test/Format/lit.local.cfg
index b060c79226cbd..20e217664997b 100644
--- a/clang/test/Format/lit.local.cfg
+++ b/clang/test/Format/lit.local.cfg
@@ -1,3 +1,4 @@
+import os
 import platform
 import lit.formats
 
@@ -27,3 +28,8 @@ config.suffixes = [
 # python implementation does, so use that for cross platform compatibility
 if platform.system() == "AIX":
     config.test_format = lit.formats.ShTest()
+
+# Create an empty .clang-format-ignore file so that tests don't get messed
+# up if one exists higher in the tree
+with open(".clang-format-ignore", 'w'):
+    pass


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

Reply via email to