Development Workflow
Use local Git hooks to catch issues before pushing to GitHub CI.
Lefthook Setup
Install Lefthook and register hooks from the repository config:
# macOS
brew install lefthook
# Linux
# see https://lefthook.dev/installation/ for package-specific options
# from repository root
lefthook installHook Policy in This Repository
The repository ships a lefthook.yml policy with two levels:
pre-commit(fast):ruff format --checkon staged Python filesruff checkon staged Python filesgit diff --check --cachedfor whitespace/conflict-marker style issues
pre-push(strict, CI-oriented):uv run --extra lint ruff format --check .uv run --extra lint ruff check .uv run --extra test pytestuv run python scripts/check_pipeline.py --mode ci- docs build (runs only when docs-affecting files changed in the push range):
cd docs && CI=1 pnpm install --frozen-lockfile --prefer-offline --reporter=append-only && pnpm build
This setup mirrors the main CI jobs and reduces “works locally, fails in CI” cases.
Running Hooks Manually
lefthook run pre-commit
lefthook run pre-pushDocumentation Sync With Code
When code structure changes, update docs in the same PR. Use this quick loop:
- Detect stale path patterns in docs:
rg -n "src/hedgehog/stages/|structFilters/|dockingFilters/" docs/content modules/README.md | rg -v "rg -n "- Confirm current package layout:
find src/hedgehog -maxdepth 1 -type d | sort- Rebuild docs:
cd docs && CI=1 pnpm install --frozen-lockfile --prefer-offline --reporter=append-only && pnpm buildpnpm build runs a prebuild step that generates docs/content/api/index.mdx
from runtime introspection (scripts/generate_api_docs.py). That file may be
absent in a fresh checkout until the docs build runs. Do not edit the generated
API page manually.
- If CLI behavior changed, refresh
docs/content/cli.mdxfrom:uv run hedgehog --helpuv run hedge --helpuv run hedgehog run --helpuv run hedgehog setup --helpuv run hedgehog setup aizynthfinder --helpuv run hedgehog version
Temporary Skip (Use Sparingly)
You can skip a specific command once:
SKIP=docs-build git pushUse this only for exceptional cases; branch protection in GitHub should still require passing CI checks on pull requests.