conventions/scripts/cli/run
Natalie 59656b5b93 feat(conventions): apiVersion+semver versioning, run lint:yaml CLI, rename infra_manifest
Add document apiVersion (conventions/v1) + per-convention semver + updated date to
the schema and all seed conventions; manifest files carry their own apiVersion
(infra/v1). New ./run (symlink -> scripts/cli/run) with lint:yaml validating every
programming_*/<name>.yaml against the schema (name==filename, scope==dir). Rename
infra-manifest.yaml -> infra_manifest.yaml for name match. 4/4 valid.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 08:36:10 -04:00

30 lines
862 B
Bash
Executable file

#!/usr/bin/env bash
# @conventions task runner. Invoke via the repo-root `run` symlink (-> scripts/cli/run).
# ./run lint:yaml validate all conventions against convention.yaml.schema
# ./run help
set -euo pipefail
# Resolve repo root regardless of where `run` is invoked from or that it's a symlink.
self="${BASH_SOURCE[0]}"
self="$(python3 -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$self")"
REPO="$(cd "$(dirname "$self")/../.." && pwd)"
cd "$REPO"
cmd="${1:-help}"
case "$cmd" in
lint:yaml)
exec python3 scripts/cli/lint_yaml.py
;;
help | -h | --help)
cat <<'EOF'
@conventions — task runner
run lint:yaml validate every programming_*/<name>.yaml against convention.yaml.schema
run help this message
EOF
;;
*)
echo "unknown command: $cmd" >&2
echo "try: run help" >&2
exit 2
;;
esac