Skip to content

Conversation

@andrewkolos
Copy link
Contributor

@andrewkolos andrewkolos commented May 21, 2024

Fixes #149386. Fixes #106150.

The stocks test app includes Dart files containing localized messages generated by package:flutter_localizations. However, these files appear to have become out of date. Running pub get in the project will regenerate these files and generate a diff, which can be annoying when working on the repo.

This PR generates the files. It also updates the templates for these files to be compliant with flutter/flutter repo lint rules, including noop_primitive_operations and use_super_parameters. It also adds // ignore_for_file: type=lint to these files to disable linting for these files. This avoids issues like #106150 and this.

Pre-launch Checklist

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

@andrewkolos andrewkolos marked this pull request as ready for review May 21, 2024 05:49
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 21, 2024
@andrewkolos andrewkolos force-pushed the update-generated-localization-files branch from d98ea7d to 633bc02 Compare May 21, 2024 20:17
@github-actions github-actions bot removed the tool Affects the "flutter" command-line tool. See also t: labels. label May 21, 2024
@andrewkolos andrewkolos force-pushed the update-generated-localization-files branch from 633bc02 to 12bd344 Compare May 21, 2024 21:08
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 21, 2024
@andrewkolos andrewkolos force-pushed the update-generated-localization-files branch from 12bd344 to 5420640 Compare May 31, 2024 02:03
@andrewkolos
Copy link
Contributor Author

Quick link to output from failing Linux tool_tests_commands check. Of interest is:

01:31 +66 ~1: test/commands.shard/permeable/create_test.dart: can create a skeleton (list/detail) app
Expected: <0>
  Actual: <1>

... <stuff> ...

.dart_tool/flutter_gen/gen_l10n/app_localizations_en.dart:5:23: Error: The 'super-parameters' language feature is disabled for this library.
Try removing the package language version or setting the language version to 2.17 or higher.
  AppLocalizationsEn([super.locale = 'en']);
                      ^^^^^
.dart_tool/flutter_gen/gen_l10n/app_localizations_en.dart:5:3: Error: The superclass, 'AppLocalizations', has no unnamed constructor that takes no arguments.
  AppLocalizationsEn([super.locale = 'en']);
  ^^^^^^^^^^^^^^^^^^

A quick way to repro this issue locally is to checkout this PR branch, clean out any cached tool binaries, and then run flutter create hello_world -t skeleton --implementation-tests followed by flutter test.

It looks like during flutter gen-l10n we generate a "synthetic" package (in .dart_tool/flutter_gen) which contains a folder that contains the generated dart files. The pubspec we generate here is minimalist and doesn't specify a language constraint. Today, I learned that pubspec's aren't required to specify a minimum SDK version. Still, I would expect that, if no constraint is provided, it would be that of the SDK that is processing these dart files, and I'm pretty sure the dart binary I'm using on my machine is >=3.5.0 🤷.

Even if I modify my local branch of flutter to include a constraint in this generated pubspec, I still receive the same compilation error.

@andrewkolos andrewkolos force-pushed the update-generated-localization-files branch from 2dfbb5b to 30cbf53 Compare June 1, 2024 19:02
@andrewkolos andrewkolos force-pushed the update-generated-localization-files branch from 30cbf53 to 5fc5561 Compare June 1, 2024 19:09
@andrewkolos
Copy link
Contributor Author

I've updated this PR (including the description) to leave the code templates untouched except for a new // ignore_for_file: type=lint, which disables linting for these files.

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@andrewkolos andrewkolos added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 3, 2024
@auto-submit auto-submit bot merged commit be72479 into flutter:master Jun 3, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 3, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 3, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 3, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 3, 2024
hello-coder-xu pushed a commit to hello-coder-xu/flutter that referenced this pull request Jun 4, 2024
…pdate

* master: (168 commits)
  Fix the scrolling layout deviation of `CupertinoActionSheet` (flutter#149439)
  Roll Flutter Engine from 60a7bb2353b6 to a6aa5d826649 (2 revisions) (flutter#149627)
  Roll Flutter Engine from ea72558be758 to 60a7bb2353b6 (2 revisions) (flutter#149623)
  Place `flutter_gpu` in the package cache. (flutter#149299)
  Switch to triage-* labels for platform package triage (flutter#149614)
  Roll pub packages (flutter#149617)
  Fixes multi line textfield hint text gets ellipsized (flutter#148423)
  Support failures-only and silent reporters in `flutter test` (flutter#148739)
  [CupertinoActionSheet] Fix overflow of the overscroll section when the user scrolls far (flutter#149542)
  Fix InputDecorator.prefixIcon color when disabled (flutter#149595)
  Added filter callback on dropdown menu (flutter#143939)
  update generated localized message files in the stocks test app (flutter#148741)
  Add a simplified SimpleCascadingMenuApp example (flutter#149147)
  Reland "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149303)
  Move some benchmarks from MotoG4 to Mokey (flutter#149567)
  Roll Packages from d8e8e8c to 11e192a (2 revisions) (flutter#149596)
  Cleanup triage reports from docs/ (flutter#149545)
  Roll Flutter Engine from d81edf635a9f to ea72558be758 (1 revision) (flutter#149590)
  Roll Flutter Engine from b0f4d7459708 to d81edf635a9f (1 revision) (flutter#149468)
  Roll Flutter Engine from 40b868efcc46 to b0f4d7459708 (1 revision) (flutter#149467)
  ...
hello-coder-xu added a commit to hello-coder-xu/flutter that referenced this pull request Jun 6, 2024
…pdate

* master: (168 commits)
  Fix the scrolling layout deviation of `CupertinoActionSheet` (flutter#149439)
  Roll Flutter Engine from 60a7bb2353b6 to a6aa5d826649 (2 revisions) (flutter#149627)
  Roll Flutter Engine from ea72558be758 to 60a7bb2353b6 (2 revisions) (flutter#149623)
  Place `flutter_gpu` in the package cache. (flutter#149299)
  Switch to triage-* labels for platform package triage (flutter#149614)
  Roll pub packages (flutter#149617)
  Fixes multi line textfield hint text gets ellipsized (flutter#148423)
  Support failures-only and silent reporters in `flutter test` (flutter#148739)
  [CupertinoActionSheet] Fix overflow of the overscroll section when the user scrolls far (flutter#149542)
  Fix InputDecorator.prefixIcon color when disabled (flutter#149595)
  Added filter callback on dropdown menu (flutter#143939)
  update generated localized message files in the stocks test app (flutter#148741)
  Add a simplified SimpleCascadingMenuApp example (flutter#149147)
  Reland "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149303)
  Move some benchmarks from MotoG4 to Mokey (flutter#149567)
  Roll Packages from d8e8e8c to 11e192a (2 revisions) (flutter#149596)
  Cleanup triage reports from docs/ (flutter#149545)
  Roll Flutter Engine from d81edf635a9f to ea72558be758 (1 revision) (flutter#149590)
  Roll Flutter Engine from b0f4d7459708 to d81edf635a9f (1 revision) (flutter#149468)
  Roll Flutter Engine from 40b868efcc46 to b0f4d7459708 (1 revision) (flutter#149467)
  ...
hello-coder-xu added a commit to hello-coder-xu/flutter that referenced this pull request Jun 9, 2024
…pdate

* master: (181 commits)
  Fix the scrolling layout deviation of `CupertinoActionSheet` (flutter#149439)
  Roll Flutter Engine from 60a7bb2353b6 to a6aa5d826649 (2 revisions) (flutter#149627)
  Roll Flutter Engine from ea72558be758 to 60a7bb2353b6 (2 revisions) (flutter#149623)
  Place `flutter_gpu` in the package cache. (flutter#149299)
  Switch to triage-* labels for platform package triage (flutter#149614)
  Roll pub packages (flutter#149617)
  Fixes multi line textfield hint text gets ellipsized (flutter#148423)
  Support failures-only and silent reporters in `flutter test` (flutter#148739)
  [CupertinoActionSheet] Fix overflow of the overscroll section when the user scrolls far (flutter#149542)
  Fix InputDecorator.prefixIcon color when disabled (flutter#149595)
  Added filter callback on dropdown menu (flutter#143939)
  update generated localized message files in the stocks test app (flutter#148741)
  Add a simplified SimpleCascadingMenuApp example (flutter#149147)
  Reland "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149303)
  Move some benchmarks from MotoG4 to Mokey (flutter#149567)
  Roll Packages from d8e8e8c to 11e192a (2 revisions) (flutter#149596)
  Cleanup triage reports from docs/ (flutter#149545)
  Roll Flutter Engine from d81edf635a9f to ea72558be758 (1 revision) (flutter#149590)
  Roll Flutter Engine from b0f4d7459708 to d81edf635a9f (1 revision) (flutter#149468)
  Roll Flutter Engine from 40b868efcc46 to b0f4d7459708 (1 revision) (flutter#149467)
  ...
hello-coder-xu added a commit to hello-coder-xu/flutter that referenced this pull request Jun 11, 2024
* master: (181 commits)
  Fix the scrolling layout deviation of `CupertinoActionSheet` (flutter#149439)
  Roll Flutter Engine from 60a7bb2353b6 to a6aa5d826649 (2 revisions) (flutter#149627)
  Roll Flutter Engine from ea72558be758 to 60a7bb2353b6 (2 revisions) (flutter#149623)
  Place `flutter_gpu` in the package cache. (flutter#149299)
  Switch to triage-* labels for platform package triage (flutter#149614)
  Roll pub packages (flutter#149617)
  Fixes multi line textfield hint text gets ellipsized (flutter#148423)
  Support failures-only and silent reporters in `flutter test` (flutter#148739)
  [CupertinoActionSheet] Fix overflow of the overscroll section when the user scrolls far (flutter#149542)
  Fix InputDecorator.prefixIcon color when disabled (flutter#149595)
  Added filter callback on dropdown menu (flutter#143939)
  update generated localized message files in the stocks test app (flutter#148741)
  Add a simplified SimpleCascadingMenuApp example (flutter#149147)
  Reland "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149303)
  Move some benchmarks from MotoG4 to Mokey (flutter#149567)
  Roll Packages from d8e8e8c to 11e192a (2 revisions) (flutter#149596)
  Cleanup triage reports from docs/ (flutter#149545)
  Roll Flutter Engine from d81edf635a9f to ea72558be758 (1 revision) (flutter#149590)
  Roll Flutter Engine from b0f4d7459708 to d81edf635a9f (1 revision) (flutter#149468)
  Roll Flutter Engine from 40b868efcc46 to b0f4d7459708 (1 revision) (flutter#149467)
  ...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2024
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 tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The stocks benchmark app includes auto-generated files that are out-of-date [localization] generated code should use super parameters when applicable

2 participants