Files
sharedinbox/scripts/check_mocks_fresh.sh
T
Thomas SharedInboxandClaude Sonnet 4.6 f2d24a8514 fix(ci): reduce noise in CI output (#128)
- Filter flutter pub get package-listing lines (^[+~><] ) in pubGetLayer
- Filter build_runner compilation-progress lines (^\[) in setup() and CheckMocks()
- Add -q to git commit in CheckMocks to suppress "460 files changed" stats
- Wrap flutter test in Coverage, TestBackend, TestIntegration, TestSyncReliability
  to show only the summary line on success and full output on failure
- Apply same build_runner filter to scripts/check_mocks_fresh.sh for local runs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 14:51:56 +02:00

25 lines
731 B
Bash
Executable File

#!/usr/bin/env bash
# Verify that all *.mocks.dart files are up to date.
# Re-runs build_runner and fails if any generated mock differs from what is committed.
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"
echo "check-mocks: regenerating..."
tmp=$(mktemp)
trap 'rm -f "$tmp"' EXIT
if fvm flutter pub run build_runner build --delete-conflicting-outputs >"$tmp" 2>&1; then
grep -vE '^\[' "$tmp" || true
else
cat "$tmp"
exit 1
fi
CHANGED=$(git diff --name-only -- '*.mocks.dart')
if [ -n "$CHANGED" ]; then
echo "ERROR: The following mock files are out of date:"
echo "$CHANGED"
echo "Run 'task codegen' and commit the regenerated mocks."
exit 1
fi
echo "check-mocks: all mock files are up to date."