INNER CODE UNIT · Python

check_json

zhinkgit/embeddedskills · .github/maintenance/repo_checks.py:90

def check_json(root: Path) -> list[str]:
    errors: list[str] = []
    for path in matching_files(root, "*.json"):
        try:
            json.loads(path.read_text(encoding="utf-8"))
        except (json.JSONDecodeError, UnicodeDecodeError) as exc:
            errors.append(f"{path.relative_to(root)}: {exc}")
    return errors


def local_link_target(raw_target: str) -> str | None:
    target = raw_target.strip()
    if target.startswith("<") and ">" in target:
        target = target[1:target.index(">")]
    else:
        target = target.split(maxsplit=1)[0]

    parsed = urlsplit(target)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…