Skip to content

Commit e99f242

Browse files
committed
If INDUCE_FAILURE_IN_FORMATTER appears in file list, cause darker/clang-format failure
Also turn on --verbose for darker
1 parent 2231568 commit e99f242

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 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)
@@ -187,11 +192,17 @@ def format_run(
187192
return None
188193
darker_cmd = [
189194
"darker",
195+
"--verbose",
190196
"--check",
191197
"--diff",
192198
"-r",
193199
f"{args.start_rev}..{args.end_rev}",
194200
] + py_files
201+
202+
# For manual testing purposes...
203+
if "INDUCE_FAILURE_IN_FORMATTER" in " ".join(py_files):
204+
darker_cmd += ["--induce-failure"]
205+
195206
print(f"Running: {' '.join(darker_cmd)}")
196207
self.darker_cmd = darker_cmd
197208
proc = subprocess.run(darker_cmd, capture_output=True)

0 commit comments

Comments
 (0)