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

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 1 11:24:00 PDT 2023


================
@@ -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)
----------------
owenca wrote:

I was aware of that but doubt it woud break any valid use cases. In fact, we made similar fixes to git-clang-format without adding options. We can always revisit this if we get valid complaints.

https://github.com/llvm/llvm-project/pull/70883


More information about the cfe-commits mailing list