mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
8f38b08b50
commit
8120390aab
|
@ -26,18 +26,22 @@ class Verbose:
|
||||||
class EmailAddressCheck:
|
class EmailAddressCheck:
|
||||||
"""Checks an email address."""
|
"""Checks an email address."""
|
||||||
|
|
||||||
def __init__(self, email):
|
def __init__(self, email, description):
|
||||||
self.ok = True
|
self.ok = True
|
||||||
|
|
||||||
if email is None:
|
if email is None:
|
||||||
self.error('Email address is missing!')
|
self.error('Email address is missing!')
|
||||||
return
|
return
|
||||||
|
if description is None:
|
||||||
|
self.error('Email description is missing!')
|
||||||
|
return
|
||||||
|
|
||||||
|
self.description = "'" + description + "'"
|
||||||
self.check_email_address(email)
|
self.check_email_address(email)
|
||||||
|
|
||||||
def error(self, *err):
|
def error(self, *err):
|
||||||
if self.ok and Verbose.level > Verbose.ONELINE:
|
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
|
self.ok = False
|
||||||
if Verbose.level < Verbose.NORMAL:
|
if Verbose.level < Verbose.NORMAL:
|
||||||
return
|
return
|
||||||
|
@ -174,7 +178,7 @@ class CommitMessageCheck:
|
||||||
if s[2] != ' ':
|
if s[2] != ' ':
|
||||||
self.error("There should be a space after '" + sig + ":'")
|
self.error("There should be a space after '" + sig + ":'")
|
||||||
|
|
||||||
EmailAddressCheck(s[3])
|
EmailAddressCheck(s[3], sig)
|
||||||
|
|
||||||
return sigs
|
return sigs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue