Skip to content

chore(tooling): generate_localization.dart leaves the ARB files without a trailing newline #902

Description

@marassteiner

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions