← Files note Workspace|ROGNALIAARCHIVED FILE
skills/note-workspace-setup/scripts/validate_workspace.py
934 Bytes · Oct 3, 2026 · 06:35 UTC
#!/usr/bin/env python3
"""Validate a note Workspace without modifying it."""
from __future__ import annotations
import argparse
import json
from pathlib import Path
from typing import Optional
from workspace_common import validate_workspace
def _parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description="Validate a note Workspace.")
parser.add_argument("workspace", help="Path to the workspace")
return parser
def main(argv: Optional[list[str]] = None) -> int:
args = _parser().parse_args(argv)
workspace = Path(args.workspace).expanduser().resolve()
errors = validate_workspace(workspace)
result = {
"status": "pass" if not errors else "fail",
"workspace": str(workspace),
"errors": errors,
}
print(json.dumps(result, ensure_ascii=False, indent=2))
return 0 if not errors else 1
if __name__ == "__main__":
raise SystemExit(main())
SHA-256: 565ac613d20b7f22f99cfe7b9fdebcde529eee6e2c0c05b37618fae7c28674fc