From 8ab4b7de76ecbab5c464ac35f49d0440ebbdcec8 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 19 Jan 2024 22:43:38 -0800 Subject: [PATCH] Fix python formatting --- llvm/utils/git/code-format-helper.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/llvm/utils/git/code-format-helper.py b/llvm/utils/git/code-format-helper.py index f96c9da586dfcc..536c76daa7df79 100755 --- a/llvm/utils/git/code-format-helper.py +++ b/llvm/utils/git/code-format-helper.py @@ -124,12 +124,9 @@ def update_pr(self, comment_text: str, args: FormatArgs, create_new: bool) -> No existing_comment = self.find_comment(pr) if args.write_comment_to_file: - self.comment = { - 'number' : pr.number, - 'body' : comment_text - } + self.comment = {'number' : pr.number, 'body' : comment_text} if existing_comment: - self.comment['id'] = existing_comment.id + self.comment['id'] = existing_comment.id return if existing_comment: @@ -323,7 +320,7 @@ def hook_main(): if not fmt.run(args.changed_files, args): failed_fmts.append(fmt.name) if fmt.comment: - comments.append(fmt.comment) + comments.append(fmt.comment) else: print(f"Couldn't find {fmt.name}, can't check " + fmt.friendly_name.lower()) @@ -366,8 +363,8 @@ def hook_main(): ) parser.add_argument( "--write-comment-to-file", - action='store_true', - help="Don't create a comments on the PR, instead write the comments and metadata a file called 'comment'" ) + action="store_true", + help="Don't create a comments on the PR, instead write the comments and metadata a file called 'comment'") args = FormatArgs(parser.parse_args()) @@ -384,7 +381,7 @@ def hook_main(): comments.append(fmt.comment) if len(comments): - with open('comments', 'w') as f: + with open("comments", "w") as f: import json json.dump(comments, f)