Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Remove empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
inacionery authored and brianchandotcom committed Jan 5, 2021
1 parent af49628 commit 61cea55
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion git-pull-request/git-pull-request.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ def display_pull_request(pull_request):

pr_body = "\n".join(pr_body)

print pr_body
print strip_empty_lines(pr_body)

print

Expand Down Expand Up @@ -1924,6 +1924,15 @@ def post_comment(repo_name, pull_request_ID, comment):
github_json_request(url, params)


def strip_empty_lines(text):
lines = text.splitlines()
while lines and not lines[0].strip():
lines.pop(0)
while lines and not lines[-1].strip():
lines.pop()
return "\n".join(lines)


def update_branch(branch_name):
if in_work_dir():
raise UserWarning(
Expand Down

0 comments on commit 61cea55

Please sign in to comment.