INNER CODE UNIT · Python
err
YutaSugimura/DeFi-Map · scripts/check_format.py:41
def err(msg: str) -> None:
errors.append(msg)
def split_row(line: str) -> list[str] | None:
if not (line.startswith("| ") and line.endswith(" |")):
return None
return line[2:-2].split(" | ")
def check_chain_file(path: Path) -> int:
lines = path.read_text(encoding="utf-8").splitlines()
if not lines or not lines[0].startswith("# DeFi on "):
err(f"{path}: first line must be a '# DeFi on ...' title")
section_indices: list[int] = []
rows = 0
current = None