diff --git a/llvm/utils/git/code-format-helper.py b/llvm/utils/git/code-format-helper.py index c45bb4d935d47..db2d4c5c52273 100644 --- a/llvm/utils/git/code-format-helper.py +++ b/llvm/utils/git/code-format-helper.py @@ -148,6 +148,11 @@ def format_run( args.end_rev, "--", ] + cpp_files + + # For manual testing purposes... + if "INDUCE_FAILURE_IN_FORMATTER" in " ".join(cpp_files): + cf_cmd.insert(1, "--induce-failure") + print(f"Running: {' '.join(cf_cmd)}") self.cf_cmd = cf_cmd proc = subprocess.run(cf_cmd, capture_output=True) @@ -192,6 +197,11 @@ def format_run( "-r", f"{args.start_rev}..{args.end_rev}", ] + py_files + + # For manual testing purposes... + if "INDUCE_FAILURE_IN_FORMATTER" in " ".join(py_files): + darker_cmd += ["--induce-failure"] + print(f"Running: {' '.join(darker_cmd)}") self.darker_cmd = darker_cmd proc = subprocess.run(darker_cmd, capture_output=True) diff --git a/llvm/utils/git/test1.cpp b/llvm/utils/git/test1.cpp new file mode 100644 index 0000000000000..fc2ab24e7d5f4 --- /dev/null +++ b/llvm/utils/git/test1.cpp @@ -0,0 +1,4 @@ +int main() +{ + return 1 +2; +} \ No newline at end of file diff --git a/llvm/utils/git/test1.py b/llvm/utils/git/test1.py new file mode 100644 index 0000000000000..0e81f925a140c --- /dev/null +++ b/llvm/utils/git/test1.py @@ -0,0 +1,4 @@ + +def main(): + return \ + 1 +2 \ No newline at end of file