From 0268185830d10133a71681f7fb38c14db81694a4 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 27 May 2021 14:35:23 -0400 Subject: [PATCH 1/2] Enable pubspec dependency sorting lint Enables the dependencies sorting link in analysis_options.yaml (which applies only to the directories that have migrated off the legacy options already), and fixes the resulting new analysis issues. Part of https://github.com/flutter/flutter/issues/82913 --- analysis_options.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 858560e41e8a..67d2a541e1df 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -198,7 +198,6 @@ linter: - slash_for_doc_comments # - sort_child_properties_last # not yet tested - sort_constructors_first - # - sort_pub_dependencies # prevents separating pinned transitive dependencies - sort_unnamed_constructors_first - test_types_in_equals - throw_in_finally @@ -243,3 +242,6 @@ linter: # separately when moving to a shared file. - no_runtimeType_toString # use objectRuntimeType from package:foundation - public_member_api_docs # see https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#documentation-dartdocs-javadocs-etc + # Flutter has a specific use case for dependencies that intentionally not + # sorted, which doesn't apply to this repo. + - sort_pub_dependencies From ade02dfadd54cfdfa47a4f75fbf6c73c457063cc Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 27 May 2021 14:39:26 -0400 Subject: [PATCH 2/2] Fix violations --- analysis_options.yaml | 4 ++-- packages/espresso/example/pubspec.yaml | 11 +++++------ .../path_provider/path_provider/example/pubspec.yaml | 4 ++-- packages/path_provider/path_provider/pubspec.yaml | 4 ++-- .../path_provider_linux/example/pubspec.yaml | 4 ++-- .../path_provider_macos/example/pubspec.yaml | 4 ++-- .../path_provider_windows/example/pubspec.yaml | 4 ++-- 7 files changed, 17 insertions(+), 18 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 67d2a541e1df..5d4fbadd3dec 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -242,6 +242,6 @@ linter: # separately when moving to a shared file. - no_runtimeType_toString # use objectRuntimeType from package:foundation - public_member_api_docs # see https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#documentation-dartdocs-javadocs-etc - # Flutter has a specific use case for dependencies that intentionally not - # sorted, which doesn't apply to this repo. + # Flutter has a specific use case for dependencies that are intentionally + # not sorted, which doesn't apply to this repo. - sort_pub_dependencies diff --git a/packages/espresso/example/pubspec.yaml b/packages/espresso/example/pubspec.yaml index 41cc8cdac6b4..6a5fcdd466fe 100644 --- a/packages/espresso/example/pubspec.yaml +++ b/packages/espresso/example/pubspec.yaml @@ -11,12 +11,6 @@ dependencies: sdk: flutter dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - pedantic: ^1.10.0 - espresso: # When depending on this package from a real application you should use: # espresso: ^x.y.z @@ -24,6 +18,11 @@ dev_dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ + flutter_driver: + sdk: flutter + flutter_test: + sdk: flutter + pedantic: ^1.10.0 flutter: uses-material-design: true diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index cf9f3dc8d6cf..975def4332e2 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -14,10 +14,10 @@ dependencies: path: ../ dev_dependencies: - integration_test: - sdk: flutter flutter_driver: sdk: flutter + integration_test: + sdk: flutter pedantic: ^1.10.0 flutter: diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 4f7786fa03c6..a61c15f1e417 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -32,10 +32,10 @@ dependencies: path_provider_windows: ^2.0.0 dev_dependencies: - flutter_test: - sdk: flutter flutter_driver: sdk: flutter + flutter_test: + sdk: flutter integration_test: sdk: flutter pedantic: ^1.10.0 diff --git a/packages/path_provider/path_provider_linux/example/pubspec.yaml b/packages/path_provider/path_provider_linux/example/pubspec.yaml index f59c7435dc74..252f3510a789 100644 --- a/packages/path_provider/path_provider_linux/example/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/example/pubspec.yaml @@ -19,10 +19,10 @@ dependencies: path: ../ dev_dependencies: - flutter_test: - sdk: flutter flutter_driver: sdk: flutter + flutter_test: + sdk: flutter integration_test: sdk: flutter diff --git a/packages/path_provider/path_provider_macos/example/pubspec.yaml b/packages/path_provider/path_provider_macos/example/pubspec.yaml index 6ca5ea154176..8442451cc10f 100644 --- a/packages/path_provider/path_provider_macos/example/pubspec.yaml +++ b/packages/path_provider/path_provider_macos/example/pubspec.yaml @@ -15,10 +15,10 @@ dependencies: path_provider_platform_interface: ^2.0.0 dev_dependencies: - integration_test: - sdk: flutter flutter_driver: sdk: flutter + integration_test: + sdk: flutter pedantic: ^1.8.0 flutter: diff --git a/packages/path_provider/path_provider_windows/example/pubspec.yaml b/packages/path_provider/path_provider_windows/example/pubspec.yaml index 4b3e8ec62180..c55bf0bcf279 100644 --- a/packages/path_provider/path_provider_windows/example/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/example/pubspec.yaml @@ -14,10 +14,10 @@ dependencies: path: ../ dev_dependencies: - integration_test: - sdk: flutter flutter_driver: sdk: flutter + integration_test: + sdk: flutter pedantic: ^1.10.0 flutter: