diff --git a/commands/comments.py b/commands/comments.py index 67c1aa3..101fcef 100644 --- a/commands/comments.py +++ b/commands/comments.py @@ -51,18 +51,20 @@ class Comments(BaseCommand): for file_path in comments[author]: if file_path is not None: - print(f"# `{file_path.split('/')[-1]}`") + filename = file_path.split("/")[-1] + print(f"\n`{filename}`\n{'-'*(len(filename) + 2)}") for comment in comments[author][file_path]: if comment["system"]: continue if comment["type"] == "DiffNote": body = comment["body"].replace( - "\n", "\n" + " " * (Comments.width + 2) - ) - print( - f"""{f'L{comment["position"]["new_line"]}':>{Comments.width}}: {body}""" + "\n", + "\n" + + " " * (len(str(comment["position"]["new_line"])) + 5), ) + + print(f"""- L{comment["position"]["new_line"]}: {body}""") else: print(f"""[{comment["created_at"]}]\n{comment["body"]}""") print(header) diff --git a/commands/merge_requests.py b/commands/merge_requests.py index fd7b3be..7fc2a7e 100644 --- a/commands/merge_requests.py +++ b/commands/merge_requests.py @@ -48,7 +48,7 @@ class MergeRequests(BaseGitCommand): mail = f"
\nMail\n\n
{submission.get_mail()}
" try: - self.gitlab.post_mr( + mr = self.gitlab.post_mr( source_branch=submission.branch, target_branch="master", title=f"[{submission.homework}{'-opravne' if submission.correction else ''}] {submission.login}", @@ -57,5 +57,8 @@ class MergeRequests(BaseGitCommand): remove_source_branch="true", assignee_ids=["1772"], ) + mr.comment( + body="Summary\n=======\n\n# TODO\n\nDiff notes\n==========\n\n# TODO\n\nCorrection (YYYY/MM/DD)\n=======================\n\n# TODO" + ) except: pass