INNER CODE UNIT · Python

regenerate_metadata

JetBrains/godot-support · godot-rd/godot_cpp_gen_main.py:108

def regenerate_metadata(metadata: dict[Path, str]) -> None:
    for path, content in metadata.items():
        path.write_text(content, encoding="utf-8")
        print(f"Regenerated {path}")


def check_metadata(metadata: dict[Path, str]) -> int:
    stale = []
    for path, expected in metadata.items():
        committed = path.read_text(encoding="utf-8") if path.is_file() else ""
        if committed == expected:
            continue
        stale.append(path.name)
        sys.stdout.writelines(difflib.unified_diff(
            committed.splitlines(keepends=True),
            expected.splitlines(keepends=True),
            fromfile=f"{path.name} (committed)",
            tofile=f"{path.name} (generated)",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…