[clang] [clang-format] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2024-07-28 Thread Philip Chimento via cfe-commits


@@ -185,6 +191,8 @@ def main():
 diff_string = "".join(diff)
 if len(diff_string) > 0:
 sys.stdout.write(diff_string)
+if args.non_zero_exit_code:
+sys.exit(1)

ptomato wrote:

A valid use case would be to distinguish errors in the clang-format-diff script 
(e.g., from executing it with incorrect arguments) from formatting changes.

https://github.com/llvm/llvm-project/pull/70883
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-format] Exit clang-format-diff only after all diffs are printed (PR #86776)

2024-07-28 Thread Philip Chimento via cfe-commits

ptomato wrote:

Could this be backported to clang-format 18.x? It's a really inconvenient 
regression.

https://github.com/llvm/llvm-project/pull/86776
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits