Skip to content

Commit

Permalink
pw_presubmit: Allow long lines in blockquotes
Browse files Browse the repository at this point in the history
Allow long lines in commit messages if they're in blockquotes.

Change-Id: Ic03ddf4399527afd455d2185b889b45b07a87575
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/125490
Reviewed-by: Wyatt Hepler <[email protected]>
Pigweed-Auto-Submit: Rob Mohr <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
  • Loading branch information
mohrr authored and CQ Bot Account committed Dec 27, 2022
1 parent abf3ab1 commit d5882c8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,11 +866,19 @@ def commit_message_format(_: PresubmitContext):
_LOG.warning('Ignoring Copybara import')
return

# Check that the lines are 72 characters or less, but skip any lines that
# might possibly have a URL, path, or metadata in them. Also skip any lines
# with non-ASCII characters.
# Check that the lines are 72 characters or less.
for i, line in enumerate(lines[2:], 3):
if any(c in line for c in ':/>') or not line.isascii():
# Skip any lines that might possibly have a URL, path, or metadata in
# them.
if any(c in line for c in ':/>'):
continue

# Skip any lines with non-ASCII characters.
if not line.isascii():
continue

# Skip any blockquoted lines.
if line.startswith(' '):
continue

if len(line) > 72:
Expand Down

0 comments on commit d5882c8

Please sign in to comment.