INNER CODE UNIT · Python

match_patterns

SpaRcle-Studio/SREngine · CI/scripts/all_includes_generator.py:18

def match_patterns(path, patterns):
    path_str = str(path).replace(os.sep, '/')
    return any(fnmatch.fnmatch(path_str, pattern) for pattern in patterns)


TARGET_TOKENS = ("SR_CLASS", "SR_STRUCT", "SR_ENUM")

def collect_files(logger: logger_utils.Logger, context: codegen_context.CodegenContext):
    start = perf_counter()

    config_path = Path(context.config_dir) / 'codegen-mask.json'
    config = load_config(config_path)

    includes = config.get('scripts-include' if context.is_script else 'engine-include', [])
    excludes = config.get('scripts-exclude' if context.is_script else 'engine-exclude', [])

    includes = tuple(sparcle_utils.normalize_path(p) for p in includes)
    excludes = tuple(sparcle_utils.normalize_path(p) for p in excludes)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…