1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Improve ease of specifying which files to look in (check_names)

- Instead of os.path.join, use glob patterns (supports Windows too)
- Instead of creating the lists beforehand (which adds messiness), pass glob
  expessions to functions and let them memoise it.
- Add support for excluding based on glob patterns, which isn't used now but
  could come in handy.

Signed-off-by: Yuto Takano <yuto.takano@arm.com>
This commit is contained in:
Yuto Takano
2021-08-09 14:48:53 +01:00
parent f005c3369a
commit 8e9a219310
2 changed files with 84 additions and 66 deletions

View File

@ -45,12 +45,10 @@ def main():
try:
name_check = NameCheck()
internal_headers = (
name_check.get_files("include/mbedtls/*_internal.h") +
name_check.get_files("library/*.h")
)
result = name_check.parse_identifiers(internal_headers)
result = name_check.parse_identifiers([
"include/mbedtls/*_internal.h",
"library/*.h"
])
identifiers = ["{}\n".format(match.name) for match in result]
with open("_identifiers", "w", encoding="utf-8") as f: