diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index facdb1142..e41f775af 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -162,6 +162,8 @@ def main(): print("Validating SQF") + files_to_ignore_lower = [x.lower() for x in ["test_parse.sqf"]] + sqf_list = [] bad_count = 0 @@ -177,6 +179,7 @@ def main(): for root, dirnames, filenames in os.walk(rootDir + '/' + args.module): for filename in fnmatch.filter(filenames, '*.sqf'): + if filename.lower() in files_to_ignore_lower: continue sqf_list.append(os.path.join(root, filename)) for filename in sqf_list: diff --git a/tools/sqfvmChecker.py b/tools/sqfvmChecker.py index b8c652ed2..45144cdad 100644 --- a/tools/sqfvmChecker.py +++ b/tools/sqfvmChecker.py @@ -2,11 +2,12 @@ import sys import subprocess import concurrent.futures +import tomllib addon_base_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) files_to_ignore_lower = [ - x.lower() for x in ["initSettings.sqf", "initKeybinds.sqf", "XEH_PREP.sqf", "backwards_comp.sqf", "gui_createCategory.sqf"] + x.lower() for x in ["initSettings.sqf", "initKeybinds.sqf", "XEH_PREP.sqf", "backwards_comp.sqf", "gui_createCategory.sqf", "test_settings_comments.sqf", "test_settings_comments_eof.sqf", "test_settings_multiline.sqf", "test_settings_regular.sqf", "test_settings_unicode.sqf"] ] sqfvm_exe = os.path.join(addon_base_path, "sqfvm.exe") virtual_paths = [ @@ -25,22 +26,14 @@ def get_files_to_process(basePath): if file.lower() in files_to_ignore_lower: continue skipPreprocessing = False - addonTomlPath = os.path.join(root, "addon.toml") - if os.path.isfile(addonTomlPath): - with open(addonTomlPath, "r") as f: - tomlFile = f.read() - if "preprocess = false" in tomlFile: - print("'preprocess = false' not supported") - raise - skipPreprocessing = "[preprocess]\nenabled = false" in tomlFile - addonTomlPath = os.path.join(os.path.dirname(root), "addon.toml") - if os.path.isfile(addonTomlPath): - with open(addonTomlPath, "r") as f: - tomlFile = f.read() - if "preprocess = false" in tomlFile: - print("'preprocess = false' not supported") - raise - skipPreprocessing = "[preprocess]\nenabled = false" in tomlFile + for addonTomlPath in [os.path.join(root, "addon.toml"), os.path.join(os.path.dirname(root), "addon.toml")]: + if os.path.isfile(addonTomlPath): + with open(addonTomlPath, "rb") as f: + tomlFile = tomllib.load(f) + try: + skipPreprocessing = not tomlFile.get('rapify')['enabled'] + except: + pass if file == "config.cpp" and skipPreprocessing: continue # ignore configs with __has_include filePath = os.path.join(root, file)