Skip to content

ci: enforce dart format - #10

Merged
agustinkassis merged 2 commits into
mainfrom
claude/ci-dart-format
Oct 26, 2026
Merged

agustinkassis merged 2 commits into
mainfrom
claude/ci-dart-format

Conversation

@agustinkassis

Copy link
Copy Markdown
Member

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, between flutter pub get and flutter analyze.

To make that pass, lib/domain/ticket/gift.dart is formatted. Two spots, no behaviour change: the explicitId ternary in fromJson rewraps, and the single-statement if in get detail gets 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

if (quantityLabel != null && quantityLabel!.isNotEmpty) return quantityLabel!;

onto its own line, because the line is too long. That then trips curly_braces_in_flow_control_structures, which only tolerates a braceless if when the whole statement fits on one line — so the formatted file fails flutter analyze:

info • Statements in an if should be enclosed in a block • lib/domain/ticket/gift.dart:133:7

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 + test to format + 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 changed
  • flutter analyze — No issues found!
  • flutter test — 110 tests passed
  • actionlint — clean

🤖 Generated with Claude Code

agustinkassis and others added 2 commits October 23, 2026 18:20
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>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 763b691c-9f5f-47a5-aa8e-6cf427dd1741
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@agustinkassis
agustinkassis merged commit 6caabbf into main Oct 26, 2026
2 checks passed
@agustinkassis
agustinkassis deleted the claude/ci-dart-format branch October 26, 2026 13:55
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Add Carrot credits or activate Agent usage billing to use Autofix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant