To avoid patches committed with incorrect email address, use the EmailAddressCheck class on the author email too.
Example: $ python BaseTools/Scripts/PatchCheck.py 1a04951309f Checking git commit: 1a04951309f The 'Author' email address is not valid: * The email address cannot contain a space: /o=Intel/ou=External \ (FYDIBOHF25SPDLT)/cn=Recipients/cn=fe425ca7e5f4401abed22b904fe5d964 Cc: Liming Gao <liming....@intel.com> Cc: Jordan Justen <jordan.l.jus...@intel.com> Signed-off-by: Philippe Mathieu-Daude <phi...@redhat.com> --- BaseTools/Scripts/PatchCheck.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index a0ff5ec0038a..f0e661bfd6e3 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -450,6 +450,9 @@ class CheckOnePatch: self.patch = patch self.find_patch_pieces() + email_check = EmailAddressCheck(self.author_email, 'Author') + email_ok = email_check.ok + msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg) msg_ok = msg_check.ok @@ -458,7 +461,7 @@ class CheckOnePatch: diff_check = GitDiffCheck(self.diff) diff_ok = diff_check.ok - self.ok = msg_ok and diff_ok + self.ok = email_ok and msg_ok and diff_ok if Verbose.level == Verbose.ONELINE: if self.ok: @@ -536,6 +539,8 @@ class CheckOnePatch: self.commit_subject = self.commit_subject.replace('\n', '') self.commit_subject = self.subject_prefix_re.sub('', self.commit_subject, 1) + self.author_email = pmail['from'] + class CheckGitCommits: """Reads patches from git based on the specified git revision range. -- 2.21.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52661): https://edk2.groups.io/g/devel/message/52661 Mute This Topic: https://groups.io/mt/69381402/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-