This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[various] More analysis_options alignment #6949
Merged
auto-submit
merged 17 commits into
flutter:main
from
stuartmorgan-g:analysis-option-more-misc-alignment
Jan 20, 2023
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2243d4e
Change the way local changes are handled to match packages
stuartmorgan-g 2283d72
only_throw_errors
stuartmorgan-g 2cee850
Enable no_default_cases
stuartmorgan-g 8ae0527
Fix violations in camera
stuartmorgan-g 0ecf2e2
Fix violations in webview
stuartmorgan-g 097e88e
Fix url_launcher violation
stuartmorgan-g 247c4b8
Fix violations in shared_preferences
stuartmorgan-g 77a3bb7
Fix violations in maps
stuartmorgan-g d7796f2
Version bumps
stuartmorgan-g 78e2a49
Merge branch 'main' into analysis-option-more-misc-alignment
stuartmorgan-g 266365b
Fix image_picker violations
stuartmorgan-g 274ed0f
Fix video_player violations
stuartmorgan-g b6ff982
New version bumps
stuartmorgan-g 95fc6e4
Update excerpts
stuartmorgan-g 9c91164
Merge branch 'main' into analysis-option-more-misc-alignment
stuartmorgan-g c0ba721
Merge branch 'main' into analysis-option-more-misc-alignment
stuartmorgan-g a4b0468
Address review feedback
stuartmorgan-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 0.9.10+2 | ||
|
|
||
| * Updates code for stricter lint checks. | ||
|
|
||
| ## 0.9.10+1 | ||
|
|
||
| * Updates code for stricter lint checks. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,6 +145,7 @@ class AVFoundationCamera extends CameraPlatform { | |
| // ignore: body_might_complete_normally_catch_error | ||
| (Object error, StackTrace stackTrace) { | ||
| if (error is! PlatformException) { | ||
| // ignore: only_throw_errors | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be addressed instead of ignored?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In practice this is only a violation if |
||
| throw error; | ||
| } | ||
| completer.completeError( | ||
|
|
@@ -526,9 +527,14 @@ class AVFoundationCamera extends CameraPlatform { | |
| return 'always'; | ||
| case FlashMode.torch: | ||
| return 'torch'; | ||
| default: | ||
| throw ArgumentError('Unknown FlashMode value'); | ||
| } | ||
| // The enum comes from a different package, which could get a new value at | ||
| // any time, so provide a fallback that ensures this won't break when used | ||
| // with a version that contains new values. This is deliberately outside | ||
| // the switch rather than a `default` so that the linter will flag the | ||
| // switch as needing an update. | ||
| // ignore: dead_code | ||
| return 'off'; | ||
| } | ||
|
|
||
| /// Returns the resolution preset as a String. | ||
|
|
@@ -546,9 +552,14 @@ class AVFoundationCamera extends CameraPlatform { | |
| return 'medium'; | ||
| case ResolutionPreset.low: | ||
| return 'low'; | ||
| default: | ||
| throw ArgumentError('Unknown ResolutionPreset value'); | ||
| } | ||
| // The enum comes from a different package, which could get a new value at | ||
| // any time, so provide a fallback that ensures this won't break when used | ||
| // with a version that contains new values. This is deliberately outside | ||
| // the switch rather than a `default` so that the linter will flag the | ||
| // switch as needing an update. | ||
| // ignore: dead_code | ||
| return 'max'; | ||
| } | ||
|
|
||
| /// Converts messages received from the native platform into device events. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 2.3.4 | ||
|
|
||
| * Updates code for stricter lint checks. | ||
|
|
||
| ## 2.3.3 | ||
|
|
||
| * Updates code for stricter lint checks. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 2.4.3 | ||
|
|
||
| * Updates code for stricter lint checks. | ||
|
|
||
| ## 2.4.2 | ||
|
|
||
| * Updates code for stricter lint checks. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should just keep the old behavior of throwing? It seems like in most of these cases you can keep the same behavior by removing the exception outside of the default branch which would keep the same logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could keep the same logic, but I changed it because throwing seems very extreme to me when there's a reasonable fallback.
When these switches were first written, everything was one package and this case meant that we'd forgotten to implement something, so it was a bug. Now it means that a client is using an implementation version that doesn't support that option yet, so a fallback seems better to me.