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

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/70883 >From 646cabcf167facb63c78277b50ea62afbc61b3c0 Mon Sep 17 00:00:00 2001 From: Conrad Donahue Date: Tue, 31 Oct 2023 21:55:27 -0400 Subject: [PATCH 1/5] Add ability for clang-format-diff to exit with non-0 status

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

2023-11-08 Thread Owen Pan via cfe-commits
@@ -95,6 +95,12 @@ def main(): default="clang-format", help="location of binary to use for clang-format", ) +parser.add_argument( +"-non-zero-exit-code", +action="store_true", +default=False, +help="exit with a non-zero

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

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/70883 >From 646cabcf167facb63c78277b50ea62afbc61b3c0 Mon Sep 17 00:00:00 2001 From: Conrad Donahue Date: Tue, 31 Oct 2023 21:55:27 -0400 Subject: [PATCH 1/4] Add ability for clang-format-diff to exit with non-0 status

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

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/70883 >From 646cabcf167facb63c78277b50ea62afbc61b3c0 Mon Sep 17 00:00:00 2001 From: Conrad Donahue Date: Tue, 31 Oct 2023 21:55:27 -0400 Subject: [PATCH 1/3] Add ability for clang-format-diff to exit with non-0 status

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

2023-11-08 Thread Owen Pan via cfe-commits
@@ -325,6 +325,7 @@ output of a unified diff and reformats all contained lines with The name of the predefined style used as a fallback in case clang-format is invoked with-style=file, but can not find the .clang-formatfile

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

2023-11-07 Thread via cfe-commits
https://github.com/mydeveloperday approved this pull request. Let go without the option for now https://github.com/llvm/llvm-project/pull/70883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2023-11-01 Thread Owen Pan 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) owenca wrote: I was aware

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

2023-11-01 Thread Björn Schäpers 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) HazardyKnusperkeks wrote:

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

2023-10-31 Thread Owen Pan 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) owenca wrote:

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

2023-10-31 Thread Conrad Donahue via cfe-commits
https://github.com/conrad-donahue updated https://github.com/llvm/llvm-project/pull/70883 >From 646cabcf167facb63c78277b50ea62afbc61b3c0 Mon Sep 17 00:00:00 2001 From: Conrad Donahue Date: Tue, 31 Oct 2023 21:55:27 -0400 Subject: [PATCH 1/2] Add ability for clang-format-diff to exit with non-0

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

2023-10-31 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 2164a449dc7a9daf610b789ba0ec7d1eca7305ef..646cabcf167facb63c78277b50ea62afbc61b3c0

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

2023-10-31 Thread Conrad Donahue via cfe-commits
https://github.com/conrad-donahue created https://github.com/llvm/llvm-project/pull/70883 This patch adds the ability for the clang-format-diff script to exit with a non-zero status if it detects that formatting changes are necessary. This makes it easier to use clang-format-diff as part of a