diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-11-04 10:35:54 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-11-04 10:35:54 +0100 |
commit | 619039de36a78164c67a2c62a425a444340d4a06 (patch) | |
tree | 27b7da119ef29a3d5c688b3bd14fc5d67094401e /contrib/gcc-changelog/git_commit.py | |
parent | c4f6330722a26b91d07c9497ebd81efd64acbdea (diff) | |
download | gcc-619039de36a78164c67a2c62a425a444340d4a06.zip gcc-619039de36a78164c67a2c62a425a444340d4a06.tar.gz gcc-619039de36a78164c67a2c62a425a444340d4a06.tar.bz2 |
gcc-changelog/git_commit.py: Check for missing description
Especially when using mklog.py, it is simply to forget to fill in
the entries after the '\t* file.c (section):' or '\t(section):'.
contrib/ChangeLog:
* gcc-changelog/git_commit.py (item_parenthesis_empty_regex,
item_parenthesis_regex): Add.
(check_for_empty_description): Use them.
* gcc-changelog/test_email.py (test_emptry_entry_desc,
test_emptry_entry_desc_2): Add.
* gcc-changelog/test_patches.txt: Add two testcases for it.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
-rwxr-xr-x | contrib/gcc-changelog/git_commit.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index 1d0860c..0008865 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -155,6 +155,8 @@ pr_regex = re.compile(r'\tPR (?P<component>[a-z+-]+\/)?([0-9]+)$') dr_regex = re.compile(r'\tDR ([0-9]+)$') star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)') end_of_location_regex = re.compile(r'[\[<(:]') +item_empty_regex = re.compile(r'\t(\* \S+ )?\(\S+\):\s*$') +item_parenthesis_regex = re.compile(r'\t(\*|\(\S+\):)') LINE_LIMIT = 100 TAB_WIDTH = 8 @@ -490,9 +492,10 @@ class GitCommit: def check_for_empty_description(self): for entry in self.changelog_entries: for i, line in enumerate(entry.lines): - if (star_prefix_regex.match(line) and line.endswith(':') and + if (item_empty_regex.match(line) and (i == len(entry.lines) - 1 - or star_prefix_regex.match(entry.lines[i + 1]))): + or not entry.lines[i+1].strip() + or item_parenthesis_regex.match(entry.lines[i+1]))): msg = 'missing description of a change' self.errors.append(Error(msg, line)) |