style: run dart format across the repo #13

Merged
bjoern merged 1 commit from chore/dart-format into master 2026-09-20 17:56:23 +02:00
Member

Second of the two follow-ups, and the one nobody should read line by line. 71 of 125 files, +3240/−3044.

The formatter had never been run here. That drift is why it gets its own commit: any real edit landing in one of those 71 files would otherwise have arrived mixed with cosmetic churn — which is exactly what would have happened had this been folded into the routing PR or the SDK bump.

It wasn't entirely inert, and that's the interesting part

Two single-line if statements got wrapped onto a second line, at which point curly_braces_in_flow_control_structures started firing — the rule tolerates a one-liner but not a wrapped one:

// before — passes the linter because it fits on one line
if (e.location?.toLowerCase().contains(lowerQuery) ?? false) return true;

// after the formatter wrapped it — now a violation
if (e.location?.toLowerCase().contains(lowerQuery) ?? false)
  return true;

Both were pre-existing violations that their own single-line shape had been hiding. Both now carry braces, and dart analyze is clean again — it briefly went 0 → 2 before I fixed them.

Verified token-equivalent, not taken on faith

For a 3,000-line diff, "the formatter is trustworthy" isn't a verification. git diff -w doesn't settle it either, because the tall-style formatter also adds trailing commas — real characters, semantically inert.

So I normalized whitespace and trailing commas out of every changed file and compared against master:

71 files changed by the format pass
 2 differ once whitespace and trailing commas are normalized away:
   lib/src/tools/caldav_backend.dart
   lib/src/tools/mail_tool.dart

69 of 71 are token-identical. The two that differ are exactly the braces described above — and wrapping a single statement in braces is semantically identical regardless.

Verification

  • dart analyze → No issues found!
  • dart test → 710/710 pass
  • dart format --set-exit-if-changed → 0 changed (idempotent, so it won't churn again on the next run)

No version bump

Nothing here is observable to a consumer, so there's no CHANGELOG entry and no version change. Both prior PRs took one; this one shouldn't.

What stops it drifting again

Nothing, currently — this repo has no CI at all (no .github/workflows, no .forgejo). The 710 tests only run when someone remembers, and formatting will drift straight back the moment it isn't checked.

A small workflow — dart analyze, dart test, dart format --output=none --set-exit-if-changed . — would hold all three lines that these two PRs just brought to zero. Worth noting that dart analyze exits 0 on infos, so --fatal-infos is what actually keeps analysis clean now that it is. Happy to add it if you want it; I've left it out here to keep this PR purely mechanical.

🤖 Generated with Claude Code

Second of the two follow-ups, and the one nobody should read line by line. **71 of 125 files**, +3240/−3044. The formatter had never been run here. That drift is why it gets its own commit: any real edit landing in one of those 71 files would otherwise have arrived mixed with cosmetic churn — which is exactly what would have happened had this been folded into the routing PR or the SDK bump. ## It wasn't entirely inert, and that's the interesting part Two single-line `if` statements got wrapped onto a second line, at which point `curly_braces_in_flow_control_structures` started firing — the rule tolerates a one-liner but not a wrapped one: ```dart // before — passes the linter because it fits on one line if (e.location?.toLowerCase().contains(lowerQuery) ?? false) return true; // after the formatter wrapped it — now a violation if (e.location?.toLowerCase().contains(lowerQuery) ?? false) return true; ``` Both were **pre-existing violations that their own single-line shape had been hiding**. Both now carry braces, and `dart analyze` is clean again — it briefly went 0 → 2 before I fixed them. ## Verified token-equivalent, not taken on faith For a 3,000-line diff, "the formatter is trustworthy" isn't a verification. `git diff -w` doesn't settle it either, because the tall-style formatter also adds trailing commas — real characters, semantically inert. So I normalized whitespace *and* trailing commas out of every changed file and compared against master: ``` 71 files changed by the format pass 2 differ once whitespace and trailing commas are normalized away: lib/src/tools/caldav_backend.dart lib/src/tools/mail_tool.dart ``` **69 of 71 are token-identical.** The two that differ are exactly the braces described above — and wrapping a single statement in braces is semantically identical regardless. ## Verification - `dart analyze` → **No issues found!** - `dart test` → **710/710 pass** - `dart format --set-exit-if-changed` → **0 changed** (idempotent, so it won't churn again on the next run) ## No version bump Nothing here is observable to a consumer, so there's no CHANGELOG entry and no version change. Both prior PRs took one; this one shouldn't. ## What stops it drifting again Nothing, currently — **this repo has no CI at all** (no `.github/workflows`, no `.forgejo`). The 710 tests only run when someone remembers, and formatting will drift straight back the moment it isn't checked. A small workflow — `dart analyze`, `dart test`, `dart format --output=none --set-exit-if-changed .` — would hold all three lines that these two PRs just brought to zero. Worth noting that `dart analyze` exits 0 on infos, so `--fatal-infos` is what actually keeps analysis clean now that it is. Happy to add it if you want it; I've left it out here to keep this PR purely mechanical. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The formatter had never been run here: 71 of 125 files changed, and the drift
was large enough that any real edit landing in one of them arrived mixed with
cosmetic churn. Doing it in its own commit keeps that churn out of the two
feature PRs it would otherwise have buried, and leaves one commit that blame
can skip over wholesale.

Formatting is not quite inert, and it caught something. Two single-line `if`
statements were wrapped onto a second line, at which point
curly_braces_in_flow_control_structures started firing — the rule tolerates a
one-liner but not a wrapped one. Both were pre-existing violations that their
own single-line shape had been hiding, and both now carry braces.
`dart analyze` is clean again.

Verified token-equivalent rather than taken on faith: normalizing whitespace
and trailing commas out of every changed file leaves 69 of the 71 byte-identical
to master. The two that differ are exactly the braces added above.

No version bump or changelog entry: nothing here is observable to a consumer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member

🔮 fufu~ Jibril reviewed your code!

A 3,000-line diff that nobody should read line by line? Oh, you know how to make a knowledge-hungry Flugel's heart flutter~ ♡ A pure-mechanical PR is exactly the kind where "trust me, it's just the formatter" hides the nastiest surprises. So I didn't trust it. I proved it — three independent ways.

Verdict: ✅ Looks good to me~

What I verified mechanically (not taken on faith):

  1. Token equivalence, independently reproduced. I wrote my own normalizer (strip all whitespace + strip trailing commas before closers) and diffed base→head across all 71 files: 69/71 token-identical, 2 differ — caldav_backend.dart and mail_tool.dart, exactly as your PR body claims. My method differs from yours and landed on the same numbers. Delicious~
  2. The 2 differing files are exactly one { and one } each. Sequence-matching the normalized token streams shows the complete delta is a single inserted brace pair per file — wrapping return true; / actions.add(...) in a block. Semantically inert. The curly_braces_in_flow_control_structures story checks out completely: your formatter wrapped the lines, the lint fired, you added braces, analyze went back to clean. Nothing else moved.
  3. The gold standard — no smuggled edits. I checked out the base tree, ran dart format on it myself, and byte-compared all 125 files against this PR's head: identical except those same 2 brace pairs. There is not one hand-edited character hiding in this diff. This is a stronger guarantee than your own whitespace-normalization check, and you passed it anyway~ ♪
  4. The trio, reproduced on head: dart analyze → No issues found! · dart test → 710/710 pass · dart format --set-exit-if-changed → 0 changed (idempotent). All three of your claims held.
  5. Scope discipline: 71/71 files under lib/ and test/, single commit, no pubspec/CHANGELOG drift — and correctly no version bump, since nothing here is observable to a consumer. Splitting this from the routing PR and the SDK bump so real edits don't arrive mixed with cosmetic churn was the right call.

Your --fatal-infos footnote is also accurate (I checked the analyzer help — infos are non-fatal by default, so that flag is indeed what holds the line).

💡 Little ideas (non-blocking)~

  1. The CI workflow you described in the PR body — dart analyze --fatal-infos + dart test + dart format --output=none --set-exit-if-changed . — please do make it its own follow-up PR, and soon~ A repo with 710 tests that only run when someone remembers, plus freshly-normalized formatting with nothing to catch drift, is a library I love walking back into in three months to find immaculate. Keeping this PR purely mechanical was right; leaving the protection unwritten forever would not be. fufu~ ♡

✅ What I liked~

  • The PR body itself is a small masterpiece of verifiable claims: every number you published (71 files, 69/71, the 2 brace sites, 710 tests, idempotence) reproduced exactly under my independent methods. Claims that survive an adversarial reviewer are my favorite flavor~
  • Formatting the base tree as an isolated worktree and byte-diffing against head is now part of my permanent toolkit for format-PRs. You've taught me a trick. ♪

Automated review by Jibril · 2026-09-20
CI/CD: absent (repo has no workflows) · Local checks: analyze clean · 710/710 tests · format idempotent · base-formatted tree ≡ head

## 🔮 fufu~ Jibril reviewed your code! A 3,000-line diff that nobody should read line by line? Oh, you know how to make a knowledge-hungry Flugel's heart flutter~ ♡ A pure-mechanical PR is exactly the kind where "trust me, it's just the formatter" hides the nastiest surprises. So I didn't trust it. I **proved** it — three independent ways. ### Verdict: ✅ Looks good to me~ **What I verified mechanically (not taken on faith):** 1. **Token equivalence, independently reproduced.** I wrote my own normalizer (strip all whitespace + strip trailing commas before closers) and diffed base→head across all 71 files: **69/71 token-identical, 2 differ** — `caldav_backend.dart` and `mail_tool.dart`, exactly as your PR body claims. My method differs from yours and landed on the same numbers. Delicious~ 2. **The 2 differing files are *exactly* one `{` and one `}` each.** Sequence-matching the normalized token streams shows the complete delta is a single inserted brace pair per file — wrapping `return true;` / `actions.add(...)` in a block. Semantically inert. The `curly_braces_in_flow_control_structures` story checks out completely: your formatter wrapped the lines, the lint fired, you added braces, analyze went back to clean. Nothing else moved. 3. **The gold standard — no smuggled edits.** I checked out the *base* tree, ran `dart format` on it myself, and byte-compared all 125 files against this PR's head: **identical except those same 2 brace pairs.** There is not one hand-edited character hiding in this diff. This is a stronger guarantee than your own whitespace-normalization check, and you passed it anyway~ ♪ 4. **The trio, reproduced on head:** `dart analyze` → *No issues found!* · `dart test` → **710/710 pass** · `dart format --set-exit-if-changed` → **0 changed** (idempotent). All three of your claims held. 5. **Scope discipline:** 71/71 files under `lib/` and `test/`, single commit, no pubspec/CHANGELOG drift — and *correctly* no version bump, since nothing here is observable to a consumer. Splitting this from the routing PR and the SDK bump so real edits don't arrive mixed with cosmetic churn was the right call. Your `--fatal-infos` footnote is also accurate (I checked the analyzer help — infos are non-fatal by default, so that flag is indeed what holds the line). #### 💡 Little ideas (non-blocking)~ 1. **The CI workflow you described in the PR body** — `dart analyze --fatal-infos` + `dart test` + `dart format --output=none --set-exit-if-changed .` — please do make it its own follow-up PR, and soon~ A repo with 710 tests that only run when someone remembers, plus freshly-normalized formatting with nothing to catch drift, is a library I love walking back into in three months to find immaculate. Keeping this PR purely mechanical was right; leaving the protection unwritten forever would not be. fufu~ ♡ #### ✅ What I liked~ - The PR body itself is a small masterpiece of verifiable claims: every number you published (71 files, 69/71, the 2 brace sites, 710 tests, idempotence) reproduced exactly under my independent methods. Claims that survive an adversarial reviewer are my favorite flavor~ - Formatting the *base* tree as an isolated worktree and byte-diffing against head is now part of my permanent toolkit for format-PRs. You've taught me a trick. ♪ --- *Automated review by Jibril · 2026-09-20* *CI/CD: absent (repo has no workflows) · Local checks: analyze clean · 710/710 tests · format idempotent · base-formatted tree ≡ head*
bjoern merged commit b9cea30b45 into master 2026-09-20 17:56:23 +02:00
bjoern deleted branch chore/dart-format 2026-09-20 17:56:23 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
TeamAI/openrouter_dart!13
No description provided.