papermario/tools/compare_shapes.py
lshamis ae66312d8c
Add Python linter to github actions (#1100)
* Add Python linter to github actions

* wip

* Add back splat_ext

* Format files

* C++ -> C

* format 2 files

* split workflow into separate file, line length 120, fix excludes

* -l 120 in ci

* update black locally and apply formatting changes

* pyproject.toject

---------

Co-authored-by: Ethan Roseman <ethteck@gmail.com>
2023-07-30 02:03:17 +09:00

27 lines
727 B
Python
Executable File

#!/usr/bin/env python3
import filecmp
import os
from pathlib import Path
total = 0
matching = 0
for root, dirs, files in os.walk("assets/us/mapfs/geom"):
for file in files:
if file.endswith("_shape.bin"):
total += 1
shape_file = os.path.join(root, file)
built_data_file = Path("ver/us/build") / shape_file.replace("_shape.bin", "_shape_data.bin")
if filecmp.cmp(shape_file, built_data_file, shallow=False):
matching += 1
else:
if total - matching == 10:
print("...")
if total - matching < 10:
print(file, "X")
print()
print(f"{matching} of {total} files match")