Update formatting of diff notes (closes #14)
This commit is contained in:
parent
7f4a439bbc
commit
0dc92bf643
1 changed files with 5 additions and 3 deletions
|
@ -51,17 +51,19 @@ class Comments(BaseCommand):
|
||||||
|
|
||||||
for file_path in comments[author]:
|
for file_path in comments[author]:
|
||||||
if file_path is not None:
|
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]:
|
for comment in comments[author][file_path]:
|
||||||
if comment["system"]:
|
if comment["system"]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if comment["type"] == "DiffNote":
|
if comment["type"] == "DiffNote":
|
||||||
body = comment["body"].replace(
|
body = comment["body"].replace(
|
||||||
"\n", "\n" + " " * (Comments.width + 2)
|
"\n", "\n" + " " * (len(str(comment["position"]["new_line"])) + 5)
|
||||||
)
|
)
|
||||||
|
|
||||||
print(
|
print(
|
||||||
f"""{f'L{comment["position"]["new_line"]}':>{Comments.width}}: {body}"""
|
f"""- L{comment["position"]["new_line"]}: {body}"""
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
print(f"""[{comment["created_at"]}]\n{comment["body"]}""")
|
print(f"""[{comment["created_at"]}]\n{comment["body"]}""")
|
||||||
|
|
Reference in a new issue