Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatos committed Apr 15, 2024
1 parent 342ca20 commit 5e0bc1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr-code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ jobs:
# explicitly in code-format-helper.py and not have to diff starting at
# the merge base.
run: |
echo "[]" > comments &&
echo "[]" > $PWD/comments &&
python ./External/code-format-helper/code-format-helper.py \
--repo "FEX-emu/FEX" \
--write-comment-to-file \
--write-comment-to-file $PWD/comments \
--issue-number $GITHUB_PR_NUMBER \
--start-rev $(git merge-base $START_REV $END_REV) \
--end-rev $END_REV \
Expand Down
10 changes: 5 additions & 5 deletions External/code-format-helper/code-format-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FormatArgs:
token: str = None
verbose: bool = True
issue_number: int = 0
write_comment_to_file: bool = False
write_comment_to_file: str = None

def __init__(self, args: argparse.Namespace = None) -> None:
if not args is None:
Expand All @@ -58,7 +58,7 @@ def __init__(self, args: argparse.Namespace = None) -> None:


class FormatHelper:
COMMENT_TAG = "<!--LLVM CODE FORMAT COMMENT: {fmt}-->"
COMMENT_TAG = "<!--CODE FORMAT COMMENT: {fmt}-->"
name: str
friendly_name: str
comment: dict = None
Expand Down Expand Up @@ -365,8 +365,8 @@ def hook_main():
)
parser.add_argument(
"--write-comment-to-file",
action="store_true",
help="Don't post comments on the PR, instead write the comments and metadata a file called 'comment'",
type=str,
help="Don't post comments on the PR, instead write the comments and metadata a file",
)

args = FormatArgs(parser.parse_args())
Expand All @@ -384,7 +384,7 @@ def hook_main():
comments.append(fmt.comment)

if len(comments):
with open("comments", "w") as f:
with open(args.write_comment_to_file, "w") as f:
import json

json.dump(comments, f)
Expand Down

0 comments on commit 5e0bc1f

Please sign in to comment.