Skip to content

Commit e9a6609

Browse files
committed
If INDUCE_FAILURE_IN_FORMATTER appears in file list, cause darker/clang-format failure
1 parent 2231568 commit e9a6609

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

llvm/utils/git/code-format-helper.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ def format_run(
148148
args.end_rev,
149149
"--",
150150
] + cpp_files
151+
152+
# For manual testing purposes...
153+
if "INDUCE_FAILURE_IN_FORMATTER" in " ".join(cpp_files):
154+
cf_cmd.insert(1, "--induce-failure")
155+
151156
print(f"Running: {' '.join(cf_cmd)}")
152157
self.cf_cmd = cf_cmd
153158
proc = subprocess.run(cf_cmd, capture_output=True)
@@ -192,6 +197,11 @@ def format_run(
192197
"-r",
193198
f"{args.start_rev}..{args.end_rev}",
194199
] + py_files
200+
201+
# For manual testing purposes...
202+
if "INDUCE_FAILURE_IN_FORMATTER" in " ".join(py_files):
203+
darker_cmd += ["--induce-failure"]
204+
195205
print(f"Running: {' '.join(darker_cmd)}")
196206
self.darker_cmd = darker_cmd
197207
proc = subprocess.run(darker_cmd, capture_output=True)

0 commit comments

Comments
 (0)