INNER CODE UNIT · Python

main

YutaSugimura/DeFi-Map · scripts/check_format.py:87

def main() -> int:
    readme = Path("README.md").read_text(encoding="utf-8").splitlines()

    chain_rows = [m for line in readme if (m := README_ROW_RE.match(line))]
    if not chain_rows:
        err("README.md: no chain table rows found")

    total = 0
    for m in chain_rows:
        path = Path(m.group("file"))
        if not path.is_file():
            err(f"README.md: linked file {path} does not exist")
            continue
        if m.group("type") not in CHAIN_TYPES:
            err(f"README.md: unknown Type {m.group('type')!r} for {path} (expected one of {sorted(CHAIN_TYPES)})")
        actual = check_chain_file(path)
        claimed = int(m.group("count"))
        if claimed != actual:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…