From 818f66c738abfe0091603e67b8307bf18bd0d3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCttler?= Date: Thu, 16 Apr 2026 09:55:15 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20dart=E2=86=92flutter=20in=20CI;=20add=20p?= =?UTF-8?q?re-commit=20hook=20and=20install-hooks=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .github/workflows/ci.yml | 8 ++++---- LATER.md | 10 +++++++--- Taskfile.yml | 7 +++++++ hooks/pre-commit | 18 ++++++++++++++++++ 4 files changed, 36 insertions(+), 7 deletions(-) create mode 100755 hooks/pre-commit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e03ba8e..02438c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,13 +23,13 @@ jobs: run: flutter pub get - name: Generate Drift code - run: dart run build_runner build --delete-conflicting-outputs + run: flutter pub run build_runner build --delete-conflicting-outputs - name: Analyze run: flutter analyze --fatal-infos - name: Unit tests - run: dart test test/unit/ + run: flutter test test/unit/ --coverage integration: name: Integration tests (Stalwart) @@ -55,7 +55,7 @@ jobs: run: | nix develop --command bash -c " flutter pub get && - dart run build_runner build --delete-conflicting-outputs && + flutter pub run build_runner build --delete-conflicting-outputs && stalwart-dev/test.sh " @@ -83,7 +83,7 @@ jobs: run: flutter pub get - name: Generate Drift code - run: dart run build_runner build --delete-conflicting-outputs + run: flutter pub run build_runner build --delete-conflicting-outputs - name: Build Linux release run: flutter build linux --release diff --git a/LATER.md b/LATER.md index 99aa719..051207a 100644 --- a/LATER.md +++ b/LATER.md @@ -1,5 +1,9 @@ -Can I publish my enough mail changes somehow. Maybe do a repo fork ? +# Later -Add pre-commit +Thread view (group by References / In-Reply-To) -Add GH CI +Search (IMAP SEARCH command) + +Attachment download + open + +Draft auto-save diff --git a/Taskfile.yml b/Taskfile.yml index ca2f501..dadcff4 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -12,6 +12,13 @@ tasks: - sh: test "${DIRENV_DIR#-}" = "{{.TASKFILE_DIR}}" msg: "Not in nix dev shell. Run: nix develop" + install-hooks: + desc: Install git hooks from hooks/ into .git/hooks/ + cmds: + - cp hooks/pre-commit .git/hooks/pre-commit + - chmod +x .git/hooks/pre-commit + - echo "Installed hooks/pre-commit → .git/hooks/pre-commit" + codegen: desc: Generate Drift DB code (run after any schema change) deps: [_nix-check] diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 0000000..aa65d9f --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,18 @@ +#!/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."