[llvm] Reland pr code format updates (PR #71131)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 01:13:02 PDT 2023


boomanaiden154 wrote:

> I know you can fetch a patch for the pull request via the API. Would that help with any of the corner cases?

Potentially, but even a tool like https://github.com/llvm/llvm-project/blob/main/clang/tools/clang-format/clang-format-diff.py relies on having a checkout where the diff applies cleanly, which would require finding the merge base.

I was able to get this working by diffing merge commits, with the caveat that the job doesn't run if there's a merge conflict. This matches the behavior when using `pull_request`, but isn't ideal as we should still be able to check code formatting when there are merge conflicts. I don't think that would result in code landing without ever being checked by the action however (or at least make it exceedingly rare).

I'll run some experiments with iteratively fetching until we hit the merge base and see what the performance is like.

I think I'd push to land this diffing merge commits and not working with merge conflicts with iterative fetching/script modifications to enable running the action on the merge conflicts case as a follow up patch, but interested to hear what others think. This isn't super urgent as https://github.com/llvm/llvm-project/pull/70946 reduces the number of failures to only a couple per day  (n=1 day, didn't go through all of the past 24 hours).

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


More information about the llvm-commits mailing list