Repository navigation
ci: enforce dart format - #10
Merged
Merged
Conversation
The tree now satisfies `dart format`, so the check goes into CI alongside analyze and test. Formatting lib/domain/ticket/gift.dart exposed a disagreement between the two tools: the formatter wraps the body of the single-statement `if` in `get detail` onto its own line, which then trips `curly_braces_in_flow_control_structures` (that lint only tolerates a braceless `if` when the whole statement fits on one line). Writing the braces satisfies both. Noted in the workflow so the next person does not have to rediscover it. No behaviour change — the rest of the diff is line-wrapping, and the 110 tests still pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The check appears in the PR list as its display name, so it should name all three steps before anything pins branch protection to it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Add Carrot credits or activate Agent usage billing to use Autofix |
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.
Follow-up to #9, which merged while this was being prepared — so it could not go on that PR as intended. Same work, new PR.
What changed
dart format --output=none --set-exit-if-changed .now runs in CI, betweenflutter pub getandflutter analyze.To make that pass,
lib/domain/ticket/gift.dartis formatted. Two spots, no behaviour change: theexplicitIdternary infromJsonrewraps, and the single-statementifinget detailgets braces.The braces are not cosmetic
Running the formatter on that file exposes a disagreement between the two tools. The formatter wraps the body of
onto its own line, because the line is too long. That then trips
curly_braces_in_flow_control_structures, which only tolerates a bracelessifwhen the whole statement fits on one line — so the formatted file failsflutter analyze:Writing the braces satisfies both tools. Without them this PR could not be green: format and analyze would take turns failing. There is a comment in the workflow recording this so it doesn't have to be rediscovered.
Also
The job's display name goes from
analyze + testtoformat + analyze + test, since that name is what shows up in the checks list and is what branch protection would get pinned to. Nothing is pinned to the old name yet — CI only landed in #9 — so now is the cheap moment to correct it.Verified locally
dart format --output=none --set-exit-if-changed .— clean, 0 of 61 files changedflutter analyze— No issues found!flutter test— 110 tests passedactionlint— clean🤖 Generated with Claude Code