diff options
author | Martin Liska <mliska@suse.cz> | 2021-09-15 16:32:50 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-09-15 16:32:50 +0200 |
commit | e0fcdc46a2f1fefa0372f0ee81db780155ee365d (patch) | |
tree | 4f00d67518b963a4b21cf9c58591cfe93a494b27 /contrib/gcc-changelog/git_commit.py | |
parent | 26d4ba05b92d0082c7db8067021e9b3109400557 (diff) | |
download | gcc-e0fcdc46a2f1fefa0372f0ee81db780155ee365d.zip gcc-e0fcdc46a2f1fefa0372f0ee81db780155ee365d.tar.gz gcc-e0fcdc46a2f1fefa0372f0ee81db780155ee365d.tar.bz2 |
gcc-changelog: check git commit email address
contrib/ChangeLog:
* gcc-changelog/git_commit.py: Check commit email.
* gcc-changelog/test_email.py: Add new test.
* gcc-changelog/test_patches.txt: Likewise.
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 d1646bd..0373614 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -326,6 +326,8 @@ class GitCommit: if not self.info: return + self.check_commit_email() + # Extract PR numbers form the subject line # Match either [PRnnnn] / (PRnnnn) or PR component/nnnn if self.info.lines and not self.revert_commit: @@ -803,3 +805,11 @@ class GitCommit: print('Errors:') for error in self.errors: print(error) + + def check_commit_email(self): + # Parse 'Martin Liska <mliska@suse.cz>' + email = self.info.author.split(' ')[-1].strip('<>') + + # Verify that all characters are ASCII + if len(email) != len(email.encode()): + self.errors.append(Error(f'non-ASCII characters in git commit email address ({email})')) |