chia7712 commented on code in PR #19242:
URL: https://github.com/apache/kafka/pull/19242#discussion_r2007419408
##########
.github/scripts/pr-format.py:
##########
@@ -132,6 +152,32 @@ def check(positive_assertion, ok_msg, err_msg):
check("Delete this text and replace" not in body, "PR template text not
present", "PR template text should be removed")
check("Committer Checklist" not in body, "PR template text not present",
"Old PR template text should be removed")
+ paragraph_iter = split_paragraphs(body)
+ new_paragraphs = []
+ for p, markdown in paragraph_iter:
+ if markdown:
+ # If a paragraph looks like it has markdown in it, wrap each line
separately.
+ new_lines = []
+ for line in p:
+ new_lines.append(textwrap.fill(line, width=72,
break_long_words=False, break_on_hyphens=False, replace_whitespace=False))
+ rewrapped_p = "\n".join(new_lines)
+ else:
+ rewrapped_p = textwrap.fill("".join(p), width=72,
break_long_words=False, break_on_hyphens=False, replace_whitespace=True)
+ new_paragraphs.append(rewrapped_p + "\n")
+ body = "\n".join(new_paragraphs)
+
+ if get_env("GITHUB_ACTIONS"):
+ with tempfile.NamedTemporaryFile() as fp:
+ fp.write(body.encode())
+ fp.flush()
+ cmd = f"gh pr edit {pr_number} --body-file {fp.name}"
Review Comment:
Given that we intend to utilize GitHub Actions for pull request description
reformatting, would it be feasible to extend its functionality to automatically
populate the reviewers list?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]