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

Commit

Permalink
Add a char limit to the description
Browse files Browse the repository at this point in the history
  • Loading branch information
inacionery committed Jan 5, 2021
1 parent b245097 commit 87f4c4a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion git-pull-request/git-pull-request.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@
"enable-color": True,
# Sets the default comment to post when closing a pull request.
"close-default-comment": None,
# Limit the number of characters from the description of the pull
"description-char-limit": 500,
# Set the indent character(s) used to indent the description
"description-indent": " ",
# Set to true to remove the newlines from the description of the pull
Expand Down Expand Up @@ -1064,8 +1066,12 @@ def display_pull_request(pull_request):

pr_body = "\n".join(pr_body)

pr_body = strip_empty_lines(pr_body)

print strip_empty_lines(pr_body)
if (options["description-char-limit"] > 0) and (len(pr_body) > options["description-char-limit"]):
pr_body = pr_body[:options["description-char-limit"]] + '...'

print pr_body

print

Expand Down

0 comments on commit 87f4c4a

Please sign in to comment.