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.
This commit is contained in:
Tobias Burnus 2020-11-04 10:35:54 +01:00
parent c4f6330722
commit 619039de36
3 changed files with 70 additions and 2 deletions

View File

@ -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))

View File

@ -370,3 +370,13 @@ class TestGccChangelog(unittest.TestCase):
email = self.from_patch_glob('0001-tree-optimization-97633-fix')
assert len(email.errors) == 1
assert email.errors[0].message == 'empty group "()" found'
def test_emptry_entry_desc(self):
email = self.from_patch_glob('0001-c-Set-CALL_FROM_NEW_OR')
assert len(email.errors) == 1
assert email.errors[0].message == 'missing description of a change'
def test_emptry_entry_desc_2(self):
email = self.from_patch_glob('0001-lto-fix-LTO-debug')
assert not email.errors
assert len(email.changelog_entries) == 1

View File

@ -3235,4 +3235,59 @@ index 5d69a98c2a9..714e50697bd 100644
--
2.7.4
=== 0001-c-Set-CALL_FROM_NEW_OR_DELETE_P-on-more-calls.patch ===
From 4f4ced28826ece7b7b76649522ee2a9601a63b90 Mon Sep 17 00:00:00 2001
From: Jason Merrill <jason@redhat.com>
Date: Fri, 2 Oct 2020 09:00:49 +0200
Subject: [PATCH] c++: Set CALL_FROM_NEW_OR_DELETE_P on more calls.
We were failing to set the flag on a delete call in a new expression, in a
deleting destructor, and in a coroutine. Fixed by setting it in the
function that builds the call.
2020-10-02 Jason Merril <jason@redhat.com>
gcc/cp/ChangeLog:
* init.c (build_new_1, build_vec_delete_1, build_delete): Not here.
(build_delete):
---
gcc/cp/init.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index e84e985492d..00fff3f7327 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -3436,1 +3435,0 @@ build_new_1 (vec<tree, va_gc> **placement, tree type, tree nelts,
-
--
2.25.1
=== 0001-lto-fix-LTO-debug-sections-copying.patch ===
From 190c04ba36d9c6c3dce41f12012aa97c6d7f22f5 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Mon, 5 Oct 2020 18:03:08 +0200
Subject: [PATCH] lto: fix LTO debug sections copying.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
libiberty/ChangeLog:
PR lto/97290
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
Use sh_link of a .symtab_shndx section.
---
libiberty/simple-object-elf.c | 1 -
1 file changed, 0 insertions(+), 1 deletions(-)
diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c
index 7c9d492f6a4..37e73348cb7 100644
--- a/libiberty/simple-object-elf.c
+++ b/libiberty/simple-object-elf.c
@@ -1191,1 +1191,0 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
-
--
2.25.1