Change the data validation tests to take the directory instead of files

Instead of passing a million files, let's pass the directory and do a
pathlib glob instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2021-12-10 13:02:16 +10:00
parent 96d93ae387
commit bfadfc3c91
4 changed files with 12 additions and 9 deletions

View File

@@ -26,6 +26,7 @@
import argparse
import configparser
import pathlib
import re
@@ -220,8 +221,8 @@ def parse_data_file(path):
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Device data-file checker")
parser.add_argument('file', nargs='+')
parser.add_argument("directory")
args = parser.parse_args()
for path in args.file:
for path in pathlib.Path(args.directory).glob("*.device"):
validate_data_file_name(path)
parse_data_file(path)