Skip to content

Commit 9cb8d42

Browse files
style: Adjust Markdown headings for structure and conciseness
This commit refines the Markdown heading structure in the output of `scripts/gha/get_pr_review_comments.py` for improved readability and document hierarchy. Changes include: - The main output title "Review Comments" is now an H1 heading. - Each comment's attribution line (user, ID) is now an H2 heading. - Section headings within each comment, "Context" (formerly "Diff Hunk Context") and "Comment" (formerly "Comment Body"), are now H3 headings. These changes make the script's output more organized and easier to navigate when rendered as Markdown.
1 parent 77d1ed2 commit 9cb8d42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/gha/get_pr_review_comments.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def main():
113113
return
114114

115115
latest_created_at_obj = None
116-
print("\n--- Review Comments ---")
116+
print("# Review Comments\n")
117117
for comment in comments:
118118
created_at_str = comment.get("created_at")
119119

@@ -171,15 +171,15 @@ def main():
171171
comment_id = comment.get("id")
172172
in_reply_to_id = comment.get("in_reply_to_id")
173173

174-
print(f"### Comment by: **{user}** (ID: `{comment_id}`){f' (In Reply To: `{in_reply_to_id}`)' if in_reply_to_id else ''}\n")
174+
print(f"## Comment by: **{user}** (ID: `{comment_id}`){f' (In Reply To: `{in_reply_to_id}`)' if in_reply_to_id else ''}\n")
175175
if created_at_str:
176176
print(f"* **Timestamp**: `{created_at_str}`")
177177
print(f"* **Status**: `{status_text}`")
178178
print(f"* **File**: `{path}`")
179179
print(f"* **Line**: `{line_to_display}`") # Label changed from "Line in File Diff"
180180
print(f"* **URL**: <{html_url}>\n")
181181

182-
print("#### Diff Hunk Context:")
182+
print("### Context:")
183183
print("```") # Start of Markdown code block
184184
if diff_hunk and diff_hunk.strip():
185185
hunk_lines = diff_hunk.split('\n')
@@ -194,7 +194,7 @@ def main():
194194
print("(No diff hunk available for this comment)")
195195
print("```") # End of Markdown code block
196196

197-
print("#### Comment Body:")
197+
print("### Comment:")
198198
print(body)
199199
print("\n---")
200200

0 commit comments

Comments
 (0)