forked from osmocom/wireshark
Strip comment lines before validating format
Fixes the problem that a one line commit message followed by the default comment lines was rejected.
This commit is contained in:
parent
b86ec10ca4
commit
5fc88c671a
|
@ -21,6 +21,7 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
@ -109,7 +110,8 @@ def extract_subject(subject):
|
||||||
|
|
||||||
|
|
||||||
def verify_body(body):
|
def verify_body(body):
|
||||||
old_lines = body.splitlines(True)
|
bodynocomments = re.sub('^#.*$', '', body, flags=re.MULTILINE)
|
||||||
|
old_lines = bodynocomments.splitlines(True)
|
||||||
is_good = True
|
is_good = True
|
||||||
if len(old_lines) >= 2 and old_lines[1].strip():
|
if len(old_lines) >= 2 and old_lines[1].strip():
|
||||||
print('ERROR: missing blank line after the first subject line.')
|
print('ERROR: missing blank line after the first subject line.')
|
||||||
|
|
Loading…
Reference in New Issue