Skip to content

Commit 915de1a

Browse files
authored
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.
1 parent be9f72c commit 915de1a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/test/Format/lit.local.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import platform
23
import lit.formats
34

@@ -27,3 +28,8 @@ config.suffixes = [
2728
# python implementation does, so use that for cross platform compatibility
2829
if platform.system() == "AIX":
2930
config.test_format = lit.formats.ShTest()
31+
32+
# Create an empty .clang-format-ignore file so that tests don't get messed
33+
# up if one exists higher in the tree
34+
with open(".clang-format-ignore", 'w'):
35+
pass

0 commit comments

Comments
 (0)