- flake.nix: extract shared runtimeDeps and testDeps lists for packages.default (with pytestCheckHook) and devShells.default, and configure git core.hooksPath in shellHook - .githooks/pre-commit: run ruff check, pyright, pytest, and nix flake check before each commit
13 lines
282 B
Bash
Executable File
13 lines
282 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if command -v ruff >/dev/null 2>&1 && command -v pyright >/dev/null 2>&1 && command -v pytest >/dev/null 2>&1; then
|
|
ruff check .
|
|
pyright
|
|
pytest
|
|
else
|
|
nix develop --command bash -c "ruff check . && pyright && pytest"
|
|
fi
|
|
|
|
nix flake check
|