Skip to content

Commit

Permalink
Fix python formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tstellar committed Jan 20, 2024
1 parent cd37e90 commit 8ab4b7d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions llvm/utils/git/code-format-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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())

Expand Down Expand Up @@ -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())

Expand All @@ -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)

Expand Down

0 comments on commit 8ab4b7d

Please sign in to comment.