aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-10-27 08:47:25 -0700
committerIan Lance Taylor <iant@golang.org>2021-10-27 08:47:25 -0700
commita6d3012b274f38b20e2a57162106f625746af6c6 (patch)
tree09ff8b13eb8ff7594c27dc8812efbf696dc97484 /contrib
parentcd2fd5facb5e1882d3f338ed456ae9536f7c0593 (diff)
parent99b1021d21e5812ed01221d8fca8e8a32488a934 (diff)
downloadgcc-a6d3012b274f38b20e2a57162106f625746af6c6.zip
gcc-a6d3012b274f38b20e2a57162106f625746af6c6.tar.gz
gcc-a6d3012b274f38b20e2a57162106f625746af6c6.tar.bz2
Merge from trunk revision 99b1021d21e5812ed01221d8fca8e8a32488a934.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog10
-rwxr-xr-xcontrib/gcc-changelog/git_commit.py15
-rwxr-xr-xcontrib/gcc-changelog/test_email.py1
3 files changed, 19 insertions, 7 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 156a61b..d36e6f1 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,13 @@
+2021-10-20 H.J. Lu <hjl.tools@gmail.com>
+
+ * gcc-changelog/git_commit.py (ignored_prefixes): Add libffi/.
+
+2021-10-18 Martin Liska <mliska@suse.cz>
+
+ * gcc-changelog/git_commit.py: Update location of
+ 'bad parentheses wrapping'.
+ * gcc-changelog/test_email.py: Test it.
+
2021-10-02 Martin Liska <mliska@suse.cz>
* filter-clang-warnings.py: Filter out -Wtautological-compare
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index f26dc3b..60377b6 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -134,6 +134,7 @@ ignored_prefixes = {
'gcc/go/gofrontend/',
'gcc/testsuite/gdc.test/',
'gcc/testsuite/go.test/test/',
+ 'libffi/',
'libgo/',
'libphobos/libdruntime/',
'libphobos/src/',
@@ -217,7 +218,7 @@ class ChangeLogEntry:
self.lines = []
self.files = []
self.file_patterns = []
- self.opened_parentheses = 0
+ self.parentheses_stack = []
def parse_file_names(self):
# Whether the content currently processed is between a star prefix the
@@ -551,7 +552,7 @@ class GitCommit:
m = star_prefix_regex.match(line)
if m:
if (len(m.group('spaces')) != 1 and
- last_entry.opened_parentheses == 0):
+ not last_entry.parentheses_stack):
msg = 'one space should follow asterisk'
self.errors.append(Error(msg, line))
else:
@@ -576,13 +577,13 @@ class GitCommit:
def process_parentheses(self, last_entry, line):
for c in line:
if c == '(':
- last_entry.opened_parentheses += 1
+ last_entry.parentheses_stack.append(line)
elif c == ')':
- if last_entry.opened_parentheses == 0:
+ if not last_entry.parentheses_stack:
msg = 'bad wrapping of parenthesis'
self.errors.append(Error(msg, line))
else:
- last_entry.opened_parentheses -= 1
+ del last_entry.parentheses_stack[-1]
def parse_file_names(self):
for entry in self.changelog_entries:
@@ -608,9 +609,9 @@ class GitCommit:
def check_for_broken_parentheses(self):
for entry in self.changelog_entries:
- if entry.opened_parentheses != 0:
+ if entry.parentheses_stack:
msg = 'bad parentheses wrapping'
- self.errors.append(Error(msg, entry.lines[0]))
+ self.errors.append(Error(msg, entry.parentheses_stack[-1]))
def get_file_changelog_location(self, changelog_file):
for file in self.info.modified_files:
diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py
index dae7c27..a4796db 100755
--- a/contrib/gcc-changelog/test_email.py
+++ b/contrib/gcc-changelog/test_email.py
@@ -415,6 +415,7 @@ class TestGccChangelog(unittest.TestCase):
def test_multiline_bad_parentheses(self):
email = self.from_patch_glob('0002-Wrong-macro-changelog.patch')
assert email.errors[0].message == 'bad parentheses wrapping'
+ assert email.errors[0].line == ' * config/i386/i386.md (*fix_trunc<mode>_i387_1,'
def test_changelog_removal(self):
email = self.from_patch_glob('0001-ChangeLog-removal.patch')