Files
Alex Verkhovsky fa1637ee40 build: move the Node toolchain into docs-site (#2834)
The root package.json, lockfile, .nvmrc, prettier ignore file and
.npmignore are gone. docs-site has its own package.json and lockfile
with the Astro, ESLint and Prettier dependencies, and its scripts run
relative to that directory. tools/quality.py, both workflows and the
docs all call npm inside docs-site.

stamp_release.py stamps only the 29 skill manifests now; the version
lives nowhere else on this branch. The tests for package stamping go
with it.
2026-09-05 18:11:37 -06:00

43 lines
1.3 KiB
Python

"""Run every check CI runs, in the same order.
Usage: uv run --frozen tools/quality.py
Requires `uv sync --frozen` and `npm ci` in docs-site/ to have run.
The Python side (ruff, rumdl, yamllint, yamlfix, JSON, validators, pytest) is
the pre-commit hook set over the whole tree. The docs-site side is that
directory's own npm scripts.
"""
from __future__ import annotations
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
SITE = ROOT / "docs-site"
STEPS: list[tuple[Path, list[str]]] = [
(ROOT, ["uv", "run", "--frozen", "pre-commit", "run", "--all-files", "--show-diff-on-failure"]),
(SITE, ["npm", "run", "lint"]),
(SITE, ["npm", "run", "format:check"]),
(SITE, ["npm", "run", "build"]),
(SITE, ["npm", "run", "validate-sidebar"]),
(SITE, ["npm", "test"]),
]
def main() -> int:
for cwd, step in STEPS:
where = "" if cwd == ROOT else f" (in {cwd.relative_to(ROOT)})"
print(f"\n${where} {' '.join(step)}", flush=True)
if subprocess.run(step, cwd=cwd).returncode != 0:
print(f"quality: failed at: {' '.join(step)}", file=sys.stderr)
return 1
print("\nquality: all checks passed")
return 0
if __name__ == "__main__":
sys.exit(main())