Skip to content

New clang-format-diff returns a non-zero status code when diffs exist leading apply-format to fail #33

@ynyyn

Description

@ynyyn

Starting from llvm/llvm-project#70883 (around LLVM version 18.1.0), the clang-format-diff script now will exit with a non-zero status code if it detects there has formatting changes.

And this change from LLVM clang-format will break the assuming in apply-format script, here at L329,

"${git_args[@]}" "$@" \
| "${format_diff_args[@]}" \
-p1 \
-style="$style" \
-iregex="$exclusions_regex"'.*\.(c|cpp|cxx|cc|h|hpp|m|mm|js|java)' \
> "$patch_dest" \
|| exit 1

which stops apply-format to apply the diff as format fix to the local or git-staged files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions