Skip to content

Commit

Permalink
Refactor argument name for clarity 🧹
Browse files Browse the repository at this point in the history
Renamed the argument `comment_on_commit` to `comment` in `main` function of `aicodebot_action.py` and `test_review.py` for better readability and simplicity. This change should make the code more intuitive to understand.
  • Loading branch information
TechNickAI committed Jul 20, 2023
1 parent 68741b9 commit c21d6b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions aicodebot_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import json, os, subprocess, sys


def main(comment_on_commit=True):
def main(comment=True):
"""Run the AICodeBot action"""
cli_runner = setup_cli()
review_status, review_comments = review_code(cli_runner)
Expand All @@ -17,7 +17,7 @@ def main(comment_on_commit=True):
else:
exit_status = 0

if comment_on_commit:
if comment:
comment_on_commit(review_status, review_comments)
sys.exit(exit_status)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def test_commit_review(tmp_path):
assert "aicodebot.yaml" in os.getenv("AICODEBOT_CONFIG_FILE")

# TODO: Mock the github client so we can test the comment on commit as well
aicodebot_action.main(comment_on_commit=False)
aicodebot_action.main(comment=False)

0 comments on commit c21d6b9

Please sign in to comment.