INNER CODE UNIT · Python

scan_file

uvwt/agentdock · core-skills/skill-authoring/run.py:201

def scan_file(source: Path, path: Path) -> list[dict[str, object]]:
    try:
        data = path.read_bytes()
    except OSError as exc:
        fail("READ_FAILED", "Unable to read Skill file", {"file": str(path), "reason": str(exc)})
    if len(data) > MAX_TEXT_BYTES:
        return [{
            "code": "TEXT_FILE_TOO_LARGE",
            "severity": "warning",
            "file": path.relative_to(source).as_posix(),
            "line": 1,
            "message": f"文本文件超过 {MAX_TEXT_BYTES} 字节,未执行内容检查。",
            "suggestion": "拆分或删除不必要的大文件后重新运行 lint。",
        }]
    try:
        content = data.decode("utf-8")
    except UnicodeDecodeError:
        return [{

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…