From 23b9bd5cded2e0b168d38f35ef4374c866031c6e Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sat, 11 Jul 2026 17:23:42 +0200 Subject: [PATCH] Install Flutter in pre-commit CI so flutter-analyze can run The pre-commit workflow has been red on every run since 2026-07-04: it executes the flutter-analyze hook but never installed Flutter, so the hook failed command-not-found each time (Dart was never actually analyzed in CI). Add subosito/flutter-action pinned to 3.44.6 (matching the version the app is developed against, Dart SDK ^3.12.2) plus a `flutter pub get` step so `flutter analyze` resolves packages. The sibling flutter-test-coverage hook is pre-push-only and does not run in this default-stage CI job, so analyze is the only Flutter dependency here. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_018PMRRVVkeRyrSaaqueMZKG --- .github/workflows/pre-commit.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 98911e8..497d93d 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -14,6 +14,19 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.12" + # The flutter-analyze pre-commit hook shells out to `flutter analyze` in + # stronglift_replacement/workout_app. Pin to the version the app is + # developed against (Dart SDK ^3.12.2) so CI's analyzer matches local. + - uses: subosito/flutter-action@v2 + with: + flutter-version: "3.44.6" + channel: stable + cache: true - name: Install dependencies run: pip install -r requirements.txt + # analyze needs resolved packages (.dart_tool); the hook runs analyze + # only, so fetch deps here first. + - name: Resolve Flutter packages + run: flutter pub get + working-directory: stronglift_replacement/workout_app - uses: pre-commit/action@v3.0.1