Files
sharedinbox/Taskfile.yml
T
Thomas GüttlerandClaude Sonnet 4.6 be56232f00 feat: linting + format automation + IMAP integration tests against Stalwart
- Add `format` task (fvm dart format .) and pre-commit dart-format hook
- Fix pre-commit task-check hook to use nix develop --command task
- Add CI format-check step (dart format --set-exit-if-changed .)
- Enable directives_ordering, curly_braces_in_flow_control_structures,
  discarded_futures, unnecessary_await_in_return, require_trailing_commas
- Apply 330 trailing-comma fixes (dart fix --apply) across all files
- Wrap intentional fire-and-forget futures with unawaited() to satisfy
  discarded_futures lint in account_sync_manager, email_repository_impl,
  and UI screens
- Add test/integration/email_repository_imap_test.dart: 8 tests against
  real Stalwart (sync, body fetch+cache, send, search, flag/move/delete)
- Remove 14 fake-IMAP unit tests migrated to Stalwart integration tests
- Fix flushPendingChanges move test: create Trash folder before IMAP MOVE
- Lower coverage gate 85%→80%: IMAP paths now tested by Stalwart (real),
  not counted in unit-test lcov
- Delete LINTING.md (plan fully executed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 18:08:09 +02:00

141 lines
4.4 KiB
YAML

version: "3"
silent: true
tasks:
default:
desc: Run all checks (analyze + unit tests + widget tests + integration, in parallel)
deps: [check]
_nix-check:
internal: true
run: once
preconditions:
- sh: test "${DIRENV_DIR#-}" = "{{.TASKFILE_DIR}}"
msg: "Not in nix dev shell. Run: nix develop"
_flutter-check:
internal: true
run: once
deps: [_nix-check]
cmds:
- cmd: fvm install --skip-pub-get
_pub-get:
internal: true
run: once
deps: [_flutter-check]
cmds:
- fvm flutter pub get --suppress-analytics
_linux-deps-check:
internal: true
run: once
preconditions:
- sh: command -v clang >/dev/null 2>&1
msg: "Linux desktop deps missing. Run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev"
- sh: pkg-config --exists gtk+-3.0 2>/dev/null
msg: "Linux desktop deps missing. Run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev"
install-hooks:
desc: Install pre-commit hooks (requires pre-commit; see .pre-commit-config.yaml)
cmds:
- pre-commit install
codegen:
desc: Generate Drift DB code (run after any schema change)
deps: [_nix-check, _pub-get]
cmds:
- fvm flutter pub run build_runner build --delete-conflicting-outputs
analyze:
desc: Static analysis (flutter analyze)
deps: [_nix-check, _pub-get]
cmds:
- scripts/run_analyze.sh
format:
desc: Format all Dart source files
deps: [_nix-check]
cmds:
- fvm dart format .
analyze-fix:
desc: Auto-fix lint issues with dart fix --apply
deps: [_nix-check]
cmds:
- fvm dart fix --apply
test:
desc: Unit tests + coverage gate (fails if any non-excluded lib/ file is missing)
deps: [_nix-check, _pub-get]
cmds:
- scripts/run_unit_tests.sh
test-widget:
desc: Widget tests — headless, no display or network required
deps: [_nix-check, _pub-get]
cmds:
- scripts/run_widget_tests.sh
test-flutter:
desc: Full Flutter test suite (unit + widget + integration)
deps: [_nix-check]
cmds:
- fvm flutter test
integration:
desc: Integration tests against a local Stalwart mail server
deps: [_flutter-check]
cmds:
- stalwart-dev/test.sh
build-linux:
desc: Build the Linux desktop app (debug)
deps: [_nix-check, _linux-deps-check, _pub-get]
cmds:
- fvm flutter build linux --debug --no-pub
_android-sdk-check:
internal: true
run: once
preconditions:
- sh: test -d "${ANDROID_HOME:-$HOME/Android/Sdk}"
msg: |
Android SDK not found. Install it with:
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O /tmp/cmdtools.zip
mkdir -p ~/Android/Sdk/cmdline-tools
unzip /tmp/cmdtools.zip -d ~/Android/Sdk/cmdline-tools
mv ~/Android/Sdk/cmdline-tools/cmdline-tools ~/Android/Sdk/cmdline-tools/latest
~/Android/Sdk/cmdline-tools/latest/bin/sdkmanager "platform-tools" "build-tools;34.0.0" "platforms;android-34"
- sh: ls "${ANDROID_HOME:-$HOME/Android/Sdk}/platforms/" 2>/dev/null | grep -qE '^android-([3-9][4-9]|[4-9][0-9]|[1-9][0-9]{2,})$'
msg: |
Android platform 34 or higher not found. Install it with:
${ANDROID_HOME:-$HOME/Android/Sdk}/cmdline-tools/latest/bin/sdkmanager "build-tools;34.0.0" "platforms;android-34"
build-android:
desc: Build a release APK (output in build/app/outputs/flutter-apk/)
deps: [_nix-check, _android-sdk-check, _pub-get]
cmds:
- ANDROID_HOME=${ANDROID_HOME:-$HOME/Android/Sdk} fvm flutter build apk --release --no-pub
deploy-android:
desc: Build release APK and upload via scp to $ANDROID_APK_SCP_USER@$ANDROID_APK_SCP_HOST:$ANDROID_APK_SCP_PATH
deps: [build-android]
dotenv: [".env"]
cmds:
- scripts/deploy_android.sh
run:
desc: Run the app on Linux desktop
deps: [_nix-check, _linux-deps-check, _pub-get]
cmds:
- fvm flutter run -d linux --no-pub
check-fast:
desc: Pre-commit checks — analyze + unit tests + widget tests (no build, no integration)
deps: [analyze, test, test-widget]
check:
desc: Full check suite — analyze + unit tests + widget tests + build-linux + integration in parallel
deps: [analyze, test, test-widget, build-linux, integration]