pw_presubmit: Allow long lines in blockquotes
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 <hepler@google.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
index 62bb41f..75623bb 100755
--- a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
+++ b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
@@ -866,11 +866,19 @@
_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: