- 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>
25 lines
731 B
Bash
Executable File
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."
|