From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web11.7112.1578566978529192733 for ; Thu, 09 Jan 2020 02:49:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CBozaMdZ; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578566977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w9ed+gEoZWPdOCMIGLHMCfKIKmrw3i0dke9c+eZNAEM=; b=CBozaMdZqhjLD0EJijkdi5dPNlh7DVnWzg16zHdLHXvD1Is2s/+4BJ3I4iHoJb6cj2IdbB 3EWAHbCMIO73gXELYU6Ame72pBcpA9i+3vXfqeN6WTsoyXOnePJHuPZ3iUFpuh1jHwWF7E DdxU/DLUFgI+5jWj7kLk01ipX15jBGw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-9vQyjekgOta_anOh6SQj-Q-1; Thu, 09 Jan 2020 05:49:36 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5406A801E6C; Thu, 9 Jan 2020 10:49:35 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-107.brq.redhat.com [10.40.204.107]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C964060BE0; Thu, 9 Jan 2020 10:49:33 +0000 (UTC) From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= To: Liming Gao , Bob Feng , devel@edk2.groups.io Cc: Philippe Mathieu-Daude , Jordan Justen Subject: [PATCH v3 3/4] BaseTools/PatchCheck.py: Check the patch author email address Date: Thu, 9 Jan 2020 11:49:17 +0100 Message-Id: <20200109104918.29750-4-philmd@redhat.com> In-Reply-To: <20200109104918.29750-1-philmd@redhat.com> References: <20200109104918.29750-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: 9vQyjekgOta_anOh6SQj-Q-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=3DIntel/ou=3DExternal \ (FYDIBOHF25SPDLT)/cn=3DRecipients/cn=3Dfe425ca7e5f4401abed22b904fe5d964 Cc: Liming Gao Cc: Jordan Justen Reviewed-by: Bob Feng Signed-off-by: Philippe Mathieu-Daude --- 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 42b923cb927e..e7b3c3bae47a 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -451,6 +451,9 @@ class CheckOnePatch: self.patch =3D patch self.find_patch_pieces() =20 + email_check =3D EmailAddressCheck(self.author_email, 'Author') + email_ok =3D email_check.ok + msg_check =3D CommitMessageCheck(self.commit_subject, self.commit_= msg) msg_ok =3D msg_check.ok =20 @@ -459,7 +462,7 @@ class CheckOnePatch: diff_check =3D GitDiffCheck(self.diff) diff_ok =3D diff_check.ok =20 - self.ok =3D msg_ok and diff_ok + self.ok =3D email_ok and msg_ok and diff_ok =20 if Verbose.level =3D=3D Verbose.ONELINE: if self.ok: @@ -537,6 +540,8 @@ class CheckOnePatch: self.commit_subject =3D self.commit_subject.replace('\n', '') self.commit_subject =3D self.subject_prefix_re.sub('', self.commit= _subject, 1) =20 + self.author_email =3D pmail['from'] + class CheckGitCommits: """Reads patches from git based on the specified git revision range. =20 --=20 2.21.1