mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-11-09 10:39:41 -06:00
interviews/ held StaffML and nothing else, so the directory now carries the product's name. Three names inside it repeated that prefix, and now line up with vault/, vault-cli/, and paper/: interviews/staffml/ -> staffml/app/ interviews/staffml-vault-worker/ -> staffml/vault-worker/ interviews/staffml-vault-types/ -> staffml/vault-types/ Every repository path moved with it: workflow paths: triggers and variable fallbacks, pre-commit hooks, .gitignore, contributor tooling, vault-cli path joins, the app's tsconfig mapping to the shared types, and the docs. Left alone on purpose: - the published /interviews/ redirect to /staffml/ and the gh-pages subsite lists that protect it; those are URLs, not repository paths - package and worker names (staffml-vault-worker, @staffml/vault-types) and the vitest job name, which branch protection may key on - question YAMLs and generated track JSON, which are content-addressed. Three questions carry an older corruption, "recall @interviews/vault/ questions/...", that predates this change - the applied D1 migration 0001 and the vault CHANGELOG, which are history codegen-hashes.txt is re-recorded; the three pinned artifacts changed only in path strings. vault-cli: 97 passed, codegen --check clean. interviewer.py's __main__ loader was one parent short and pointed at a corpus.json that never existed; it now resolves staffml/app/src/data/ corpus.json. tools/validate_playbook.py and generate_interview_flashcard.py still expect per-track directories that no longer exist; they point at the new root but remain dead. The GitHub repository variables STAFFML_ROOT, VAULT_DIR, and VAULT_CLI_DIR still name the old paths and must change when this reaches origin.
50 lines
1.5 KiB
Makefile
50 lines
1.5 KiB
Makefile
# Makefile for vault-cli — convenience wrappers over CLI and tests (B.2).
|
|
|
|
PKG_DIR := $(shell pwd)
|
|
# `git rev-parse --git-path hooks` works correctly in both regular clones
|
|
# and worktrees (where .git is a file pointing at the main repo's hooks dir).
|
|
HOOKS_DIR := $(shell git rev-parse --git-path hooks 2>/dev/null)
|
|
HOOK_SRC := $(PKG_DIR)/scripts/pre_commit_corpus_guard.py
|
|
HOOK_DST := $(HOOKS_DIR)/pre-commit
|
|
|
|
.PHONY: install test lint hooks hooks-uninstall help
|
|
|
|
help:
|
|
@echo "Targets:"
|
|
@echo " install pip install -e with dev extras"
|
|
@echo " test run pytest"
|
|
@echo " lint ruff check (mypy is non-blocking at Phase 0)"
|
|
@echo " hooks symlink pre-commit-corpus-guard into .git/hooks/"
|
|
@echo " hooks-uninstall remove the hook symlink"
|
|
|
|
install:
|
|
pip install -e ".[dev]"
|
|
|
|
test:
|
|
pytest tests/ -v
|
|
|
|
lint:
|
|
ruff check src tests
|
|
@mypy src || echo "[mypy] strict is non-blocking at Phase 0"
|
|
|
|
hooks:
|
|
@if [ -z "$(HOOKS_DIR)" ]; then \
|
|
echo "could not resolve git hooks dir; run make from a git checkout"; exit 1; \
|
|
fi
|
|
@mkdir -p "$(HOOKS_DIR)"
|
|
@if [ -e "$(HOOK_DST)" ] && [ ! -L "$(HOOK_DST)" ]; then \
|
|
echo "refusing to overwrite non-symlink at $(HOOK_DST); remove it first"; \
|
|
exit 1; \
|
|
fi
|
|
@ln -sf "$(HOOK_SRC)" "$(HOOK_DST)"
|
|
@chmod +x "$(HOOK_SRC)"
|
|
@echo "installed hook: $(HOOK_DST) -> $(HOOK_SRC)"
|
|
|
|
hooks-uninstall:
|
|
@if [ -L "$(HOOK_DST)" ]; then \
|
|
rm "$(HOOK_DST)"; \
|
|
echo "removed $(HOOK_DST)"; \
|
|
else \
|
|
echo "no symlink at $(HOOK_DST)"; \
|
|
fi
|