Skip to content

Commit 203e88f

Browse files
style: Adjust default context lines and Markdown spacing
This commit applies final readability adjustments to the output of `scripts/gha/get_pr_review_comments.py`: - The default value for the `--context-lines` argument has been changed from 10 to 0. This means the full diff hunk will be displayed by default, aligning with your feedback preferring more context initially unless otherwise specified. The help text for this argument has also been updated. - Markdown Spacing: - An additional newline is added after the main H1 title ("# Review Comments") for better separation. - A newline is added before the "### Context:" H3 subheading to separate it from the metadata list. - A newline is added before the "### Comment:" H3 subheading to separate it from the diff hunk block. These changes further refine the script's output for clarity and your experience.
1 parent 9cb8d42 commit 203e88f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/gha/get_pr_review_comments.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def main():
6666
parser.add_argument(
6767
"--context-lines",
6868
type=int,
69-
default=10,
69+
default=0,
7070
help="Number of context lines from the diff hunk. Use 0 for the full hunk. "
71-
"If > 0, shows the last N lines of the hunk. Default: 10."
71+
"If > 0, shows the last N lines of the hunk. Default: 0."
7272
)
7373
parser.add_argument(
7474
"--since",
@@ -113,7 +113,7 @@ def main():
113113
return
114114

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

@@ -179,7 +179,7 @@ def main():
179179
print(f"* **Line**: `{line_to_display}`") # Label changed from "Line in File Diff"
180180
print(f"* **URL**: <{html_url}>\n")
181181

182-
print("### Context:")
182+
print("\n### 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:")
197+
print("\n### Comment:")
198198
print(body)
199199
print("\n---")
200200

0 commit comments

Comments
 (0)