## Summary - Adds \`CheckFast\`, \`Analyze\`, \`FormatWrite\`, \`Codegen\`, and \`AnalyzeFix\` Dagger functions to \`ci/main.go\` - Updates \`format\`, \`codegen\`, \`analyze\`, \`analyze-fix\`, and \`check-fast\` Taskfile tasks to delegate to Dagger and export modified files back to the host (\`-o .\`) - Updates the \`dart-check\` pre-commit hook to run \`dagger call ... check-fast\` instead of \`scripts/pre_commit_check.sh\` These tasks no longer require a local Dart/Flutter SDK installation — Dagger pulls the toolchain image and runs everything in a container. ## New Dagger functions | Function | Returns | What it does | |---|---|---| | \`CheckFast(ctx)\` | \`string\` | Runs CheckHygiene, CheckLayers, Format, Analyze, CheckMocks, Coverage in parallel | | \`Analyze(ctx)\` | \`string\` | \`dart analyze --fatal-infos\` | | \`FormatWrite()\` | \`*dagger.Directory\` | \`dart format lib test\` — writes files, returns \`/src\` | | \`Codegen()\` | \`*dagger.Directory\` | \`flutter pub run build_runner build\` — returns \`/src\` with generated files | | \`AnalyzeFix()\` | \`*dagger.Directory\` | \`dart fix --apply\` — writes files, returns \`/src\` | ## Test plan - [ ] \`task format\` — runs Dagger, exports formatted files back to \`.\` - [ ] \`task codegen\` — runs Dagger, exports generated \`.g.dart\` files back to \`.\` - [ ] \`task analyze\` — runs Dagger, prints analysis output - [ ] \`task analyze-fix\` — runs Dagger, exports fixed files back to \`.\` - [ ] \`task check-fast\` — runs all fast checks in parallel via Dagger - [ ] Pre-commit hook triggers \`dagger call ... check-fast\` on commit Closes #417 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Thomas SharedInbox <sharedinbox@thomas-guettler.de> Co-authored-by: guettli <guettli@noreply.codeberg.org> Reviewed-on: https://codeberg.org/guettli/sharedinbox/pulls/418
This commit was merged in pull request #418.
This commit is contained in:
committed by
guettli
co-authored by
guettli
Thomas SharedInbox
parent
8718339b4e
commit
cca0e5d461
+11
-29
@@ -96,34 +96,19 @@ tasks:
|
||||
- scripts/silent_on_success.sh fvm flutter pub run build_runner build --delete-conflicting-outputs
|
||||
|
||||
codegen:
|
||||
desc: Generate Drift DB code (run after any schema change)
|
||||
deps: [_preflight, _pub-get]
|
||||
sources:
|
||||
- lib/**/*.dart
|
||||
- pubspec.yaml
|
||||
generates:
|
||||
- lib/**/*.g.dart
|
||||
desc: Generate Drift DB code via Dagger (exports generated files back to host)
|
||||
cmds:
|
||||
- fvm flutter pub run build_runner build --delete-conflicting-outputs
|
||||
- dagger call --progress=plain -q -m ci --source=. codegen -o .
|
||||
|
||||
analyze:
|
||||
desc: Static analysis (flutter analyze)
|
||||
deps: [_preflight, _codegen]
|
||||
sources:
|
||||
- lib/**/*.dart
|
||||
- test/**/*.dart
|
||||
- pubspec.yaml
|
||||
- analysis_options.yaml
|
||||
desc: Static analysis via Dagger (dart analyze --fatal-infos)
|
||||
cmds:
|
||||
- scripts/run_analyze.sh
|
||||
- dagger call --progress=plain -q -m ci --source=. analyze
|
||||
|
||||
format:
|
||||
desc: Format all Dart source files
|
||||
deps: [_preflight]
|
||||
sources:
|
||||
- "**/*.dart"
|
||||
desc: Format all Dart source files via Dagger (writes back to host)
|
||||
cmds:
|
||||
- fvm dart format lib test
|
||||
- dagger call --progress=plain -q -m ci --source=. format-write -o .
|
||||
|
||||
check-mocks:
|
||||
desc: Fail if any *.mocks.dart file is out of date (re-runs build_runner)
|
||||
@@ -136,13 +121,9 @@ tasks:
|
||||
- scripts/check_mocks_fresh.sh
|
||||
|
||||
analyze-fix:
|
||||
desc: Auto-fix lint issues with dart fix --apply
|
||||
deps: [_preflight]
|
||||
sources:
|
||||
- lib/**/*.dart
|
||||
- test/**/*.dart
|
||||
desc: Auto-fix lint issues via Dagger (dart fix --apply, writes back to host)
|
||||
cmds:
|
||||
- fvm dart fix --apply
|
||||
- dagger call --progress=plain -q -m ci --source=. analyze-fix -o .
|
||||
|
||||
test:
|
||||
desc: Unit tests + coverage gate (fails if any non-excluded lib/ file is missing)
|
||||
@@ -690,8 +671,9 @@ tasks:
|
||||
${SSH_USER}@${SSH_HOST}:public_html/
|
||||
|
||||
check-fast:
|
||||
desc: Pre-commit checks — analyze + unit+widget tests + coverage gate (no build, no integration)
|
||||
deps: [analyze, check-coverage, check-hygiene, check-layers, check-mocks]
|
||||
desc: Pre-commit checks via Dagger (format, analyze, mocks, coverage — no integration or backend)
|
||||
cmds:
|
||||
- dagger call --progress=plain -q -m ci --source=. check-fast
|
||||
|
||||
check-layers:
|
||||
desc: Enforce architecture — ui/ must not import data/ (only core/ interfaces allowed)
|
||||
|
||||
Reference in New Issue
Block a user