Commit 505b6eb1 by Manh Nguyen Committed by Commit Bot

Allow line formats to pass description body's line length check

1. Lines starting with 4 spaces will not be checked for line length 2. Lines with no space in it will not be checked for line length Bug: angleproject:4683 Change-Id: Ic648b8b1084762da208d89ee5fbff2b02b69cf12 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2230899Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Manh Nguyen <nguyenmh@google.com>
parent 0117ba26
...@@ -117,13 +117,16 @@ def _CheckCommitMessageFormatting(input_api, output_api): ...@@ -117,13 +117,16 @@ def _CheckCommitMessageFormatting(input_api, output_api):
# loop through description body # loop through description body
while len(commit_msg_lines) > 0: while len(commit_msg_lines) > 0:
if len(commit_msg_lines[0]) > description_linelength_limit: line = commit_msg_lines.pop(0)
# lines starting with 4 spaces or lines without space(urls) are exempt from length check
if line.startswith(" ") or " " not in line:
continue
if len(line) > description_linelength_limit:
errors.append( errors.append(
output_api.PresubmitError( output_api.PresubmitError(
"Please ensure that your description body is wrapped to " + "Please ensure that your description body is wrapped to " +
str(description_linelength_limit) + " characters or less.")) str(description_linelength_limit) + " characters or less."))
return errors return errors
commit_msg_lines.pop(0)
return errors return errors
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment