[llvm] 2b1c76c - [Github] Use three dot diff for darker in code format action (#74704)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 12:05:08 PST 2023


Author: Aiden Grossman
Date: 2023-12-07T12:05:04-08:00
New Revision: 2b1c76c7c4d62f4470fe1527bf239f380c19760a

URL: https://github.com/llvm/llvm-project/commit/2b1c76c7c4d62f4470fe1527bf239f380c19760a
DIFF: https://github.com/llvm/llvm-project/commit/2b1c76c7c4d62f4470fe1527bf239f380c19760a.diff

LOG: [Github] Use three dot diff for darker in code format action (#74704)

Using a two dot diff allows changes made in main after the merge base to
show up in the formatting diff. Using a three dot diff fixes this and
ensures that only changes made in the source branch (branch from the PR
author) will get passed along to the formatter.

Without this, issues like #73873 occur.

Added: 
    

Modified: 
    llvm/utils/git/code-format-helper.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/git/code-format-helper.py b/llvm/utils/git/code-format-helper.py
index 8876ba7a14debe..f89f060b3fe5e8 100644
--- a/llvm/utils/git/code-format-helper.py
+++ b/llvm/utils/git/code-format-helper.py
@@ -185,7 +185,7 @@ def format_run(
             "--check",
             "--
diff ",
             "-r",
-            f"{args.start_rev}..{args.end_rev}",
+            f"{args.start_rev}...{args.end_rev}",
         ] + py_files
         print(f"Running: {' '.join(darker_cmd)}")
         self.darker_cmd = darker_cmd


        


More information about the llvm-commits mailing list