Per-line opt-out of typo check: Python port of b6837761815e1a8f6f475be4575824fc386a08dd

Signed-off-by: Yuto Takano <yuto.takano@arm.com>
This commit is contained in:
Yuto Takano 2021-08-05 20:17:07 +01:00
parent e503d61b99
commit c62b4084a2

View File

@ -173,6 +173,10 @@ class NameCheck(object):
for filename in files:
with open(filename, "r") as fp:
for line in fp:
# Ignore any names that are deliberately opted-out
if re.search(r"// *no-check-names", line):
continue
for name in re.finditer(r"\bMBED.+?_[A-Z0-9_]*", line):
MBED_names.append(Match(
filename,