summaryrefslogtreecommitdiffstats
path: root/BaseTools/Scripts
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daude <philmd@redhat.com>2020-01-09 18:55:44 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-01-10 04:06:42 +0000
commit8120390aabe6bc6a6ecb5c94a2865a9b55095f9b (patch)
tree525fffc52dc07ae3b61d02eaebf2736a8f9fd33f /BaseTools/Scripts
parent8f38b08b506c0ea602444a09eda2f5ef1099498a (diff)
downloadedk2-8120390aabe6bc6a6ecb5c94a2865a9b55095f9b.tar.gz
edk2-8120390aabe6bc6a6ecb5c94a2865a9b55095f9b.tar.bz2
edk2-8120390aabe6bc6a6ecb5c94a2865a9b55095f9b.zip
BaseTools/PatchCheck.py: Let EmailAddressCheck describe email checked
We are checking different emails from the signature list. We are going to check more. To be able to differency, add a description field, so the error reported is clearer. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Diffstat (limited to 'BaseTools/Scripts')
-rwxr-xr-xBaseTools/Scripts/PatchCheck.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 174d442aa7..58d0112544 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -26,18 +26,22 @@ class Verbose:
class EmailAddressCheck:
"""Checks an email address."""
- def __init__(self, email):
+ def __init__(self, email, description):
self.ok = True
if email is None:
self.error('Email address is missing!')
return
+ if description is None:
+ self.error('Email description is missing!')
+ return
+ self.description = "'" + description + "'"
self.check_email_address(email)
def error(self, *err):
if self.ok and Verbose.level > Verbose.ONELINE:
- print('The email address is not valid:')
+ print('The ' + self.description + ' email address is not valid:')
self.ok = False
if Verbose.level < Verbose.NORMAL:
return
@@ -174,7 +178,7 @@ class CommitMessageCheck:
if s[2] != ' ':
self.error("There should be a space after '" + sig + ":'")
- EmailAddressCheck(s[3])
+ EmailAddressCheck(s[3], sig)
return sigs