Skip to content

Commit

Permalink
adding try except
Browse files Browse the repository at this point in the history
  • Loading branch information
EcZachly committed Jun 20, 2024
1 parent f83b503 commit 97688b0
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/generate_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,17 @@ def main(files_to_process: list):

for filename in files_to_process:
logger.info("processing:" +filename)
with open(filename, 'r') as file:
content = file.read()
print(content)
prompt = f"Make sure this file {filename} with this content: {content} follows all the right naming and python conventions. Make any call outs you see!"
comment = get_feedback(filename, system_prompt, prompt)
if GIT_TOKEN and GIT_REPO and pr_number:
post_github_comment(GIT_TOKEN, GIT_REPO, pr_number, comment, filename)
try:
with open(filename, 'r') as file:
content = file.read()
print(content)
prompt = f"Make sure this file {filename} with this content: {content} follows all the right naming and python conventions. Make any call outs you see!"
comment = get_feedback(filename, system_prompt, prompt)
if GIT_TOKEN and GIT_REPO and pr_number:
post_github_comment(GIT_TOKEN, GIT_REPO, pr_number, comment, filename)
except Exception as e:
print(e)


if __name__ == "__main__":
pr_number = int(sys.argv[1])
Expand Down

0 comments on commit 97688b0

Please sign in to comment.