Some checks failed
Build & Push Docker / build (push) Has been cancelled
- Block model: nové volitelné pole 'url' (Optional[str]) - Frontend: URL input v modálu pro přidání/editaci bloku - PDF generátor: c.linkURL() – celý blok je klikatelný odkaz - sample.json: ukázkový blok s URL - index.html: dokumentace URL pole - .github/copilot-instructions.md: přidány Copilot instrukce
24 lines
678 B
Bash
Executable File
24 lines
678 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
# Pre-commit hook: run tests and prevent commit on failures.
|
|
# By default run fast tests (exclude integration). To include integration tests
|
|
# set RUN_INTEGRATION=1.
|
|
|
|
# Use venv pytest if available, otherwise fall back to system pytest
|
|
REPO_DIR="$(git rev-parse --show-toplevel)"
|
|
if [ -x "${REPO_DIR}/.venv/bin/pytest" ]; then
|
|
PYTEST="${REPO_DIR}/.venv/bin/pytest"
|
|
else
|
|
PYTEST="pytest"
|
|
fi
|
|
|
|
echo "Running pytest (fast) before commit..."
|
|
if [ "${RUN_INTEGRATION:-0}" = "1" ]; then
|
|
echo "RUN_INTEGRATION=1: including integration tests"
|
|
$PYTEST -q
|
|
else
|
|
$PYTEST -q -m "not integration"
|
|
fi
|
|
|
|
echo "Tests passed. Proceeding with commit."
|