1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Fix further pylint issues picked up by Travis CI

Signed-off-by: Yuto Takano <yuto.takano@arm.com>
This commit is contained in:
Yuto Takano
2021-08-07 00:40:29 +01:00
parent a083d15edd
commit 12a7ecda5a

View File

@ -386,13 +386,13 @@ class NameCheck():
# Match names of typedef instances, after closing bracket. # Match names of typedef instances, after closing bracket.
r"}? *(\w+)[;[].*") r"}? *(\w+)[;[].*")
exclusion_lines = re.compile(r"^(" exclusion_lines = re.compile(r"^("
r"extern +\"C\"|" r"extern +\"C\"|"
r"(typedef +)?(struct|union|enum)( *{)?$|" r"(typedef +)?(struct|union|enum)( *{)?$|"
r"} *;?$|" r"} *;?$|"
r"$|" r"$|"
r"//|" r"//|"
r"#" r"#"
r")") r")")
self.log.debug("Looking for identifiers in {} files".format(len(header_files))) self.log.debug("Looking for identifiers in {} files".format(len(header_files)))
@ -524,7 +524,7 @@ class NameCheck():
""" """
nm_undefined_regex = re.compile(r"^\S+: +U |^$|^\S+:$") nm_undefined_regex = re.compile(r"^\S+: +U |^$|^\S+:$")
nm_valid_regex = re.compile(r"^\S+( [0-9A-Fa-f]+)* . _*(?P<symbol>\w+)") nm_valid_regex = re.compile(r"^\S+( [0-9A-Fa-f]+)* . _*(?P<symbol>\w+)")
nm_exclusions = ("FStar", "Hacl") exclusions = ("FStar", "Hacl")
symbols = [] symbols = []
@ -542,8 +542,7 @@ class NameCheck():
for line in nm_output.splitlines(): for line in nm_output.splitlines():
if not nm_undefined_regex.match(line): if not nm_undefined_regex.match(line):
symbol = nm_valid_regex.match(line) symbol = nm_valid_regex.match(line)
if (symbol and not symbol.group("symbol").startswith( if (symbol and not symbol.group("symbol").startswith(exclusions)):
nm_exclusions)):
symbols.append(symbol.group("symbol")) symbols.append(symbol.group("symbol"))
else: else:
self.log.error(line) self.log.error(line)