Repository navigation
chore(ci): actually enforce Dart formatting with the pinned SDK - #130
Merged
Merged
Conversation
PapyElGringo
force-pushed
the
chore/dart-format-ci
branch
2 times, most recently
from
October 13, 2026 21:52
0e2916c to
772d611
Compare
The "Flutter Format Dart Code" workflow never kept the tree formatted: it committed its formatting on the runner but had no `git push`, and it set up an unpinned Flutter (latest stable) rather than the project-pinned SDK, so its idea of the style could differ from `.flutter_sdk`. - Turn the job into a real gate: `dart format --output=none --set-exit-if-changed lib test` from `src/shell`, so drift fails CI instead of hiding in a discarded bot commit. - Read the Flutter pin from `Cargo.toml` `[package.metadata] flutter_version` and install exactly that SDK, so CI formats with the same formatter as the project pin. - Drop the unused checkout token now that nothing is pushed. - Format the whole shell (`lib`, `test`) with the pinned SDK so the new gate is green; whitespace only. - Document the command in AGENTS.md's verification loop.
PapyElGringo
force-pushed
the
chore/dart-format-ci
branch
from
October 13, 2026 21:57
772d611 to
af8cf25
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The existing "Flutter Format Dart Code" workflow did not actually keep the shell formatted, and it formatted with a different SDK than the project pin. This makes formatting a real, enforced gate. Rebased on top of the merged #129.
What was broken
git push, so the commit was discarded — despite the step being named "Commit and push formatted code".subosito/flutter-action@v2with no version installs the latest stable Flutter/Dart, not the project pin inCargo.toml([package.metadata] flutter_version). The formatter's output is version-dependent, so CI's style could drift from.flutter_sdk/bin/dart.Changes
dart format --output=none --set-exit-if-changed lib testfromsrc/shell— drift now fails the job.flutter_versionfromCargo.tomland install exactly that SDK, so CI formats with the same formatter as.flutter_sdk/bin/dartlocally.flutter pub get): the formatter derives its output from the package language version recorded in.dart_tool/package_config.json. Without it, CI falls back to a different default and reports drift on a already-clean tree (the first CI run failed exactly this way: 47 files "changed").lib,test); the previousdart format .also walked intobuild/.dart formatstep to the AGENTS.md verification loop.Formatting pass
The repo-wide reformat uses the pinned SDK (
.flutter_sdk, Flutter 3.47.7): 138 Dart files, whitespace only, 1199 insertions / 1420 deletions. The tree was in the pre-3.7 "short" style; it now matches the pinned formatter, which is what makes the new gate green and keeps future diffs free of incidental churn.Verification
dart format --output=none --set-exit-if-changed lib test→ exit 0 (0 files changed).flutter test— 448 passed..g.dart/.freezed.dartare ignored; a fresh CI checkout has none, so the gate only checks tracked sources).