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

Ignore unnecessary_import in legacy analysis options #4129

Merged
merged 5 commits into from Sep 9, 2021

Conversation

srawlins
Copy link
Contributor

@srawlins srawlins commented Jul 1, 2021

This mirrors the change to analysis_options.yaml in 642a483.

This change is needed in order to land the new unnecessary_import Hint. There are many violations of this new Hint. If we do not ignore them, the flutter roll breaks.

Related to flutter/flutter#74381

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

  • 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. (Note that 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.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the 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.

This mirrors the change to analysis_options.yaml in flutter@642a483.

This change is needed in order to land the new unnecessary_import Hint. There are many violations of this new Hint. If we do not ignore them, the flutter roll breaks.

Related to flutter/flutter#74381
@google-cla google-cla bot added the cla: yes label Jul 1, 2021
@srawlins
Copy link
Contributor Author

srawlins commented Jul 1, 2021

Note on "analyze CHANNEL:stable" CI:

warning - analysis_options.yaml:1:10 - Warning in the included options file /tmp/cirrus-ci-build/analysis_options_legacy.yaml(428..445): 'unnecessary_import' isn't a recognized error code. - included_file_warning
warning - analysis_options.yaml:1:10 - Warning in the included options file /tmp/cirrus-ci-build/analysis_options_legacy.yaml(428..445): 'unnecessary_import' isn't a recognized error code. - included_file_warning

The error code will be recognized when it lands.

@stuartmorgan
Copy link
Contributor

The error code will be recognized when it lands.

How will landing a new option change the behavior on stable?

This can't land with analyze being red; it'll close the tree. It's not clear to me what the path for landing this is.

@srawlins
Copy link
Contributor Author

The error code does exist in Dart now, as of dart-lang/sdk@2bcc415#diff-7788abdb7b889d06cb0bd29803f0f11dda64c2cf17c791c54968eabea51607dd.

Do we just need to wait until the code gets through to Flutter stable?

@stuartmorgan
Copy link
Contributor

If you want to add an ignore but doing so is an error until it's on stable, then yes.

Usually changes like this have been made by fixing the violations, not ignoring them, as that can be done in advance.

@srawlins
Copy link
Contributor Author

srawlins commented Sep 9, 2021

Sorry for the delay. Now that stable has bumped to know about the unnecessary_import code, ignoring it in analysis_options is legal.

Usually changes like this have been made by fixing the violations

Yes. This is a case where there are simply too many to clean up ahead of time, and new ones are added faster than I can cycle through and clean them up. Ignoring them allows the check to land.

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

LGTM

@goderbauer goderbauer added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Sep 9, 2021
@fluttergithubbot fluttergithubbot merged commit 5266acb into flutter:master Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
NickalasB added a commit to NickalasB/plugins that referenced this pull request Sep 10, 2021
* master:
  [webview_flutter] Add download listener to Android webview (flutter#4322)
  [video_player] add support for content-uri based videos (flutter#4330)
  [webview_flutter] Implementation of the webview_flutter_platform_interface package (flutter#4302)
  [camera] Bump minimum Flutter version and iOS deployment target (flutter#4327)
  [video_player] interface: add support for content-uri based videos (android only) (flutter#4307)
  Ignore unnecessary_import in legacy analysis options (flutter#4129)
  [ci] Enable the new Windows targets (flutter#4325)

# Conflicts:
#	packages/webview_flutter/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebView.java
#	packages/webview_flutter/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewBuilder.java
fotiDim pushed a commit to fotiDim/plugins that referenced this pull request Sep 13, 2021
amantoux pushed a commit to amantoux/plugins that referenced this pull request Sep 27, 2021
KyleFin pushed a commit to KyleFin/plugins that referenced this pull request Dec 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
4 participants