Running the documented setup from CONTRIBUTING.md on a clean checkout leaves the working tree dirty: dart run tool/generate_localization.dart rewrites assets/languages/strings_de.arb and assets/languages/strings_en.arb without their trailing newline.
Reproduction
git checkout staging && git status --short # clean
flutter pub get
dart run tool/generate_localization.dart
git status --short
# M assets/languages/strings_de.arb
# M assets/languages/strings_en.arb
The diff is the same in both files:
"youSell": "You sell"
-}
+}
\ No newline at end of file
Reproduced twice on a clean tree, so it is the generator writing the ARB files back, not an editor or a pre-commit hook.
Why it is worth fixing
The generator's job is lib/generated/i18n.dart (gitignored, CONTRIBUTING.md line 162) — rewriting the committed source ARB files is a side effect. Every contributor who follows the documented setup gets two modified files they did not touch, and the next git add -A silently commits the newline removal back and forth.
Suggested fix
Have the generator either leave the ARB files untouched, or write them back with a trailing newline so a re-run is a no-op.
Context
Found while reviewing #897 (the PR itself does not touch this — it only changes one golden test and its baseline). Pre-existing, not a merge blocker there.
Running the documented setup from
CONTRIBUTING.mdon a clean checkout leaves the working tree dirty:dart run tool/generate_localization.dartrewritesassets/languages/strings_de.arbandassets/languages/strings_en.arbwithout their trailing newline.Reproduction
The diff is the same in both files:
Reproduced twice on a clean tree, so it is the generator writing the ARB files back, not an editor or a pre-commit hook.
Why it is worth fixing
The generator's job is
lib/generated/i18n.dart(gitignored,CONTRIBUTING.mdline 162) — rewriting the committed source ARB files is a side effect. Every contributor who follows the documented setup gets two modified files they did not touch, and the nextgit add -Asilently commits the newline removal back and forth.Suggested fix
Have the generator either leave the ARB files untouched, or write them back with a trailing newline so a re-run is a no-op.
Context
Found while reviewing #897 (the PR itself does not touch this — it only changes one golden test and its baseline). Pre-existing, not a merge blocker there.