Change formatting of comments
This commit is contained in:
parent
8e7648ce5a
commit
2d98660213
1 changed files with 11 additions and 1 deletions
|
@ -1,11 +1,16 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
|
||||
import json
|
||||
|
||||
|
||||
from commands.base import BaseCommand
|
||||
from gitlab import get_mrs_for_branch, get_comments
|
||||
|
||||
|
||||
class Comments(BaseCommand):
|
||||
width = 5
|
||||
|
||||
@staticmethod
|
||||
def sort_comments(comments):
|
||||
result = {}
|
||||
|
@ -32,7 +37,12 @@ class Comments(BaseCommand):
|
|||
continue
|
||||
|
||||
if comment["type"] == "DiffNote":
|
||||
print(f"""L{comment["position"]["new_line"]}: {comment["body"]}""")
|
||||
body = comment["body"].replace(
|
||||
"\n", "\n" + " " * (Comments.width + 2)
|
||||
)
|
||||
print(
|
||||
f"""{f'L{comment["position"]["new_line"]}':>{Comments.width}}: {body}"""
|
||||
)
|
||||
else:
|
||||
print(f"""[{comment["created_at"]}]\n{comment["body"]}""")
|
||||
print()
|
||||
|
|
Reference in a new issue