diff options
author | Martin Liska <mliska@suse.cz> | 2020-05-29 13:55:35 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2020-05-29 17:25:02 +0200 |
commit | b9ca913b6a886bfb72c03704cc3c9492ebdb562b (patch) | |
tree | 292fb2d8238039320da19cee1a6f369c25a46b38 /contrib/gcc-changelog/git_commit.py | |
parent | 5e54b01f2b5cc7fd7c3523563e2db751e0706ff6 (diff) | |
download | gcc-b9ca913b6a886bfb72c03704cc3c9492ebdb562b.zip gcc-b9ca913b6a886bfb72c03704cc3c9492ebdb562b.tar.gz gcc-b9ca913b6a886bfb72c03704cc3c9492ebdb562b.tar.bz2 |
Error for missing change description in git_commit.py.
contrib/ChangeLog:
* gcc-changelog/git_commit.py: Find empty change descriptions.
* gcc-changelog/test_email.py: New test.
* gcc-changelog/test_patches.txt: New patch that tests that.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
-rwxr-xr-x | contrib/gcc-changelog/git_commit.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index 084e83c..4f82b58 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -274,6 +274,7 @@ class GitCommit: self.parse_lines(all_are_ignored) if self.changes: self.parse_changelog() + self.check_for_empty_description() self.deduce_changelog_locations() if not self.errors: self.check_mentioned_files() @@ -440,6 +441,15 @@ class GitCommit: else: last_entry.lines.append(line) + 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 + (i == len(entry.lines) - 1 + or star_prefix_regex.match(entry.lines[i + 1]))): + msg = 'missing description of a change' + self.errors.append(Error(msg, line)) + def get_file_changelog_location(self, changelog_file): for file in self.modified_files: if file[0] == changelog_file: |