INNER CODE UNIT · Python

validate

dotnet/sdk · .github/scripts/check_vendored_files.py:108

def validate(entries: list[Entry]) -> int:
    errors: list[str] = []
    seen_ids: set[str] = set()
    for entry in entries:
        if not entry.id:
            errors.append("Entry missing id.")
            continue
        if entry.id in seen_ids:
            errors.append(f"Duplicate entry id: {entry.id}")
        seen_ids.add(entry.id)

        local = REPO_ROOT / entry.local_path
        if not local.is_file():
            errors.append(f"{entry.id}: local_path does not exist: {entry.local_path}")

        if not entry.sources:
            errors.append(f"{entry.id}: must declare at least one source.")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…