Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[file_selector] Annotate all creation of XTypeGroup with // ignore: prefer_const_contructor #6463

Conversation

eugerossetto
Copy link
Contributor

Annotate all creation of XTypeGroup with // ignore: prefer_const_constructor to prepare this implementation for the const constructor of XTypeGroup.

#111906 [file_selector] XTypeGroup should be immutable

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this!

I see there are a couple of PRs for this, and that's just covering two packages so far; it's probably easiest for something that's rote like this (and thus easy to review) to make one large PR covering the entire plugin, rather than doing it per-package. Since it doesn't require publishing, there's no dependency issue the way there would be for API changes.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

Two small nits, but otherwise looks good!

@@ -15,6 +15,8 @@ class OpenImagePage extends StatelessWidget {

Future<void> _openImageFile(BuildContext context) async {
// #docregion SingleOpen
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
Copy link
Contributor

Choose a reason for hiding this comment

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

For the entries in #docregion sections, let's use ignore_for_file: at the top of the file instead to get them out of the README excerpts. That's generally not how we want to do ignores, but this will be very short-lived.

Copy link
Contributor

Choose a reason for hiding this comment

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

You've marked this as resolved, but did the opposite of what I requested. As I said, we don't want these TODOs in the README.

@@ -27,4 +27,3 @@ dev_dependencies:
sdk: flutter
mockito: ^5.1.0
pigeon: ^3.2.5

Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert this file so we don't have to do a version check override.

Copy link
Contributor

Choose a reason for hiding this comment

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

You've marked this as resolved, but didn't change anything.

@stuartmorgan-g stuartmorgan-g added the override: no changelog needed Override the check requiring CHANGELOG updates for most changes label Sep 23, 2022
@ditman
Copy link
Member

ditman commented Sep 23, 2022

Why not disable the lint, here, and then reenable + fix the affected files?

To me, that sounds like half of the effort of "ignoring everywhere" then "un-ignoring + fixing" everywhere.

There's a risk that non-const things might land in the meantime, but they'll eventually get fixed when the lint gets re-enabled. /cc @stuartmorgan?

@stuartmorgan-g
Copy link
Contributor

That's a really big hammer; I'd rather we avoid things that could introduce problems in unrelated packages.

(The third option would have been to temporarily change the custom analysis options for the file_selector/ directory, but that's fiddly in a different way.)

If we have to do this again for another package, we can revisit the approach, but I thought added boilerplate in exchange for added safety during the process was worthwhile. Now that the PR is basically done, I don't think it's worth changing since reverting the PR later should be trivial (since locally it can be an actual revert, followed by fixes.)

@eugerossetto
Copy link
Contributor Author

Hi guys, we fixed the readme_excerpts check. We believe that, with this change, all the comments have been resolved.
If there's anything I can do, just let me know.

@@ -27,4 +27,3 @@ dev_dependencies:
sdk: flutter
mockito: ^5.1.0
pigeon: ^3.2.5

Copy link
Contributor

Choose a reason for hiding this comment

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

You've marked this as resolved, but didn't change anything.

@@ -15,6 +15,8 @@ class OpenImagePage extends StatelessWidget {

Future<void> _openImageFile(BuildContext context) async {
// #docregion SingleOpen
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
Copy link
Contributor

Choose a reason for hiding this comment

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

You've marked this as resolved, but did the opposite of what I requested. As I said, we don't want these TODOs in the README.

@eugerossetto
Copy link
Contributor Author

Hi Stuart, sorry for the misunderstanding, we applied the suggested changes.
Let me know if I can help you with anything else.
Thanks

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 26, 2022
@auto-submit auto-submit bot merged commit 4b2a636 into flutter:main Sep 26, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 27, 2022
@eugerossetto eugerossetto deleted the 111906-ignore-const-constructor-file-selector branch September 27, 2022 17:37
adam-harwood pushed a commit to adam-harwood/flutter_plugins that referenced this pull request Nov 3, 2022
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App override: no changelog needed Override the check requiring CHANGELOG updates for most changes p: file_selector platform-ios platform-linux platform-macos platform-web platform-windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants