Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[CP-beta]feat: Arbitrary format options for localizations generation (#102983) #168035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

flutteractionsbot
Copy link

@flutteractionsbot flutteractionsbot commented Apr 30, 2025

This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

Issue Link:

What is the link to the issue this cherry-pick is addressing?

#167982

Changelog Description:

Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples

N/A, bug fix to an unreleased feature.

Impact Description:

What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)

Complicates CI workflow for customers using i10n-gen

Workaround:

Is there a workaround for this issue?

Yes, having to manually format the code or add format: true to i10n.yaml.

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

Validation Steps:

What are the steps to validate that this fix works?

N/A

…102983) (flutter#167029)

Migration of Localization Generation [Option
1](https://docs.flutter.dev/release/breaking-changes/flutter-generate-i10n-source#migration-guide)
breaks `dart format . --set-exit-if-changed` checks (as commonly used in
pipelines), as the generated file does not comply the `dart format`
rules.

This PR:
- Formats the generated localization files by default
- In contrast to [this
comment](flutter#109171 (comment))
I don't see it as breaking as the files are generated dynamically on
every change and there's no need in migrating them. Also any tests
should not fail as either the format was done manually afterwards
anyways, or the formatting was not checked at all (in third party apps /
libraries) as the output had not a correct format in any use case of
checking via `dart format`.
- Add tests for `no-format`
- Add option to add arbitrary arguments to the `dart format` command to
allow customized formatting

Closes flutter#167982
Contributes to:
flutter#102983 (comment)

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Apr 30, 2025
@flutteractionsbot
Copy link
Author

@matanlurey please fill out the PR description above, afterwards the release team will review this request.

@flutter-dashboard
Copy link

This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter.

Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 30, 2025
@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 30, 2025
@auto-submit auto-submit bot merged commit 453dd71 into flutter:flutter-3.32-candidate.0 Apr 30, 2025
143 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App cp: review Cherry-picks in the review queue tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants