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

Philip Chimento via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 28 10:19:12 PDT 2024


================
@@ -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


More information about the cfe-commits mailing list