PMFlow/scripts/operation_catalog_lint.py

26 lines
604 B
Python

#!/usr/bin/env python3
"""Operation Catalog lint."""
from __future__ import annotations
import json
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
BACKEND = ROOT / "backend"
if str(BACKEND) not in sys.path:
sys.path.insert(0, str(BACKEND))
from app.services.operation_catalog_service import operation_catalog_service # noqa: E402
def main() -> None:
report = operation_catalog_service.lint_catalog()
print(json.dumps(report, ensure_ascii=False, indent=2))
raise SystemExit(0 if bool(report.get("ok")) else 2)
if __name__ == "__main__":
main()