[llvm] [Py Reformat] Exclude `third-party` in `code-format-helper.py` (PR #83872)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 08:53:28 PST 2024


https://github.com/mtrofin created https://github.com/llvm/llvm-project/pull/83872

Follow-up from PR #83491. `Darker`'s configuration is ignored because of the way we invoke it - with an explicit list of files. We need to filter it in `code-format-helper.py`.

>From d6fe3b5cd84cf9d6e33ca23566ebeaa2ace9fe83 Mon Sep 17 00:00:00 2001
From: Mircea Trofin <mtrofin at google.com>
Date: Mon, 4 Mar 2024 08:51:15 -0800
Subject: [PATCH] [Py Reformat] Exclude `third-party` in
 `code-format-helper.py`

Follow-up from PR #83491. `Darker`'s configuration is ignored because of
the way we invoke it - with an explicit list of files. We need to filter
it in `code-format-helper.py`.
---
 llvm/utils/git/code-format-helper.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/utils/git/code-format-helper.py b/llvm/utils/git/code-format-helper.py
index 8a29a57d8d16bd..1113bf02570b94 100755
--- a/llvm/utils/git/code-format-helper.py
+++ b/llvm/utils/git/code-format-helper.py
@@ -125,6 +125,7 @@ def update_pr(self, comment_text: str, args: FormatArgs, create_new: bool) -> No
             pr.as_issue().create_comment(comment_text)
 
     def run(self, changed_files: List[str], args: FormatArgs) -> bool:
+        changed_files = [arg for arg in changed_files if "third-party" not in arg]
         diff = self.format_run(changed_files, args)
         should_update_gh = args.token is not None and args.repo is not None
 



More information about the llvm-commits mailing list