From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: devel@edk2.groups.io
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
Laszlo Ersek <lersek@redhat.com>,
Philippe Mathieu-Daude <philmd@redhat.com>,
Liming Gao <liming.gao@intel.com>,
Jordan Justen <jordan.l.justen@intel.com>
Subject: [PATCH v2 3/4] BaseTools/PatchCheck.py: Check the patch author email address
Date: Mon, 6 Jan 2020 11:35:27 +0100 [thread overview]
Message-ID: <20200106103528.5438-4-philmd@redhat.com> (raw)
In-Reply-To: <20200106103528.5438-1-philmd@redhat.com>
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.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@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.1
next prev parent reply other threads:[~2020-01-06 10:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-06 10:35 [PATCH v2 0/4] BaseTools/PatchCheck: Check committer/author email addresses Philippe Mathieu-Daudé
2020-01-06 10:35 ` [PATCH v2 1/4] BaseTools/PatchCheck.py: Extract email check code to EmailAddressCheck Philippe Mathieu-Daudé
2020-01-06 10:35 ` [PATCH v2 2/4] BaseTools/PatchCheck.py: Let EmailAddressCheck describe email checked Philippe Mathieu-Daudé
2020-01-06 10:35 ` Philippe Mathieu-Daudé [this message]
2020-01-06 10:35 ` [PATCH v2 4/4] BaseTools/PatchCheck.py: Check the committer email address Philippe Mathieu-Daudé
2020-01-09 9:50 ` [edk2-devel] [PATCH v2 0/4] BaseTools/PatchCheck: Check committer/author email addresses Bob Feng
2020-01-09 10:39 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200106103528.5438-4-philmd@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox