Files
sharedinbox/hooks/pre-commit
T
Thomas GüttlerandClaude Sonnet 4.6 818f66c738 Fix dart→flutter in CI; add pre-commit hook and install-hooks task
- ci.yml: dart run/dart test → flutter pub run/flutter test (all 3 jobs)
- hooks/pre-commit: runs flutter analyze + flutter test before every commit
- Taskfile: add install-hooks task (copies hooks/pre-commit → .git/hooks/)
- LATER.md: remove resolved items (enough_mail fork, pre-commit, GH CI)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 09:55:15 +02:00

19 lines
498 B
Bash
Executable File

#!/usr/bin/env bash
# Runs fast checks before every commit.
# Install with: task install-hooks
set -euo pipefail
# Only run if flutter is in PATH (i.e. inside the nix dev shell).
if ! command -v flutter >/dev/null 2>&1; then
echo "pre-commit: flutter not in PATH — skipping (run inside nix develop)"
exit 0
fi
echo "pre-commit: flutter analyze..."
flutter analyze --fatal-infos
echo "pre-commit: unit tests..."
flutter test test/unit/ --coverage
echo "pre-commit: all checks passed."