Skip to content

Dev#21

Open
agis09 wants to merge 36 commits intomainfrom
dev
Open

Dev#21
agis09 wants to merge 36 commits intomainfrom
dev

Conversation

@agis09
Copy link
Copy Markdown
Owner

@agis09 agis09 commented Jun 2, 2024

No description provided.

Comment thread run_gemini.py
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=True,
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not handle the case when the git diff command returns an error. It checks if stderr is not empty but does not raise an error. The code should raise an error if stderr is not empty.

Comment thread create_pr_comments.py
try:
comment = json.loads(line)
if not all(key in comment for key in ["body", "path", "line", "side"]):
raise ValueError("Invalid format: Required key does not exist.")
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code could be improved by using a dedicated error handling block instead of the general exception block.

Comment thread .github/workflows/ci.yml
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.x'
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is unnecessarily complex. You could simplify it by using the poetry add command directly instead of installing poetry separately.

Comment thread create_pr_comments.py
for comment in review_comments:

try:
comment_data = create_pull_request_comment(
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not handle the case when the get_review function returns an error. It should handle the case when the function returns an empty string.

Comment thread create_pr_comments.py
try:
comment_data = create_pull_request_comment(
pr_repository,
pr_number,
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not handle the case when the parse_comments function returns an empty list. It should handle the case when the function returns an empty list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant