From 9fb4cfa088f1bacdcd5a5154faa8e450ab06373d Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Wed, 22 Nov 2023 12:47:19 -0800 Subject: [PATCH] Update lints to latest, etc (#1048) Updated min SDK on http_client_conformance_tests Bumped pkg:http version on some examples --- .github/workflows/dart.yml | 74 ++++++------------- analysis_options.yaml | 5 -- pkgs/cronet_http/CHANGELOG.md | 2 + pkgs/cronet_http/example/pubspec.yaml | 6 +- pkgs/cronet_http/pubspec.yaml | 4 +- pkgs/cupertino_http/CHANGELOG.md | 2 + .../example/integration_test/client_test.dart | 3 +- pkgs/cupertino_http/example/pubspec.yaml | 4 +- pkgs/cupertino_http/pubspec.yaml | 4 +- pkgs/flutter_http_example/pubspec.yaml | 4 +- pkgs/http/CHANGELOG.md | 2 + pkgs/http/pubspec.yaml | 4 +- .../pubspec.yaml | 6 +- pkgs/java_http/pubspec.yaml | 3 +- 14 files changed, 46 insertions(+), 77 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index b800c00d58..baebff25d7 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -40,23 +40,23 @@ jobs: - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: - name: "analyze_and_format; linux; Dart 2.19.0; PKG: pkgs/http_client_conformance_tests; `dart analyze --fatal-infos`" + name: "analyze_and_format; linux; Dart 3.0.0; PKGS: pkgs/http_client_conformance_tests, pkgs/http_profile; `dart analyze --fatal-infos`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/http_client_conformance_tests;commands:analyze_1" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/http_client_conformance_tests-pkgs/http_profile;commands:analyze_1" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/http_client_conformance_tests - os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/http_client_conformance_tests-pkgs/http_profile + os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: - sdk: "2.19.0" + sdk: "3.0.0" - id: checkout name: Checkout repository uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 @@ -69,27 +69,6 @@ jobs: run: dart analyze --fatal-infos if: "always() && steps.pkgs_http_client_conformance_tests_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http_client_conformance_tests - job_003: - name: "analyze_and_format; linux; Dart 3.0.0; PKG: pkgs/http_profile; `dart analyze --fatal-infos`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/http_profile;commands:analyze_1" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/http_profile - os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0 - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d - with: - sdk: "3.0.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - id: pkgs_http_profile_pub_upgrade name: pkgs/http_profile; dart pub upgrade run: dart pub upgrade @@ -99,7 +78,7 @@ jobs: run: dart analyze --fatal-infos if: "always() && steps.pkgs_http_profile_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http_profile - job_004: + job_003: name: "analyze_and_format; linux; Dart 3.2.0; PKG: pkgs/http; `dart analyze --fatal-infos`" runs-on: ubuntu-latest steps: @@ -129,7 +108,7 @@ jobs: run: dart analyze --fatal-infos if: "always() && steps.pkgs_http_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http - job_005: + job_004: name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/http, pkgs/http_client_conformance_tests, pkgs/http_profile; `dart analyze --fatal-infos`" runs-on: ubuntu-latest steps: @@ -177,7 +156,7 @@ jobs: run: dart analyze --fatal-infos if: "always() && steps.pkgs_http_profile_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http_profile - job_006: + job_005: name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/http, pkgs/http_client_conformance_tests, pkgs/http_profile; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: @@ -225,7 +204,7 @@ jobs: run: "dart format --output=none --set-exit-if-changed ." if: "always() && steps.pkgs_http_profile_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http_profile - job_007: + job_006: name: "analyze_and_format; linux; Flutter stable; PKG: pkgs/flutter_http_example; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: @@ -255,7 +234,7 @@ jobs: run: "dart format --output=none --set-exit-if-changed ." if: "always() && steps.pkgs_flutter_http_example_pub_upgrade.conclusion == 'success'" working-directory: pkgs/flutter_http_example - job_008: + job_007: name: "analyze_and_format; linux; Flutter stable; PKG: pkgs/flutter_http_example; `flutter analyze --fatal-infos`" runs-on: ubuntu-latest steps: @@ -285,7 +264,7 @@ jobs: run: flutter analyze --fatal-infos if: "always() && steps.pkgs_flutter_http_example_pub_upgrade.conclusion == 'success'" working-directory: pkgs/flutter_http_example - job_009: + job_008: name: "unit_test; linux; Dart 3.0.0; PKG: pkgs/http_profile; `dart test --platform vm`" runs-on: ubuntu-latest steps: @@ -323,8 +302,7 @@ jobs: - job_005 - job_006 - job_007 - - job_008 - job_010: + job_009: name: "unit_test; linux; Dart 3.2.0; PKG: pkgs/http; `dart run --define=no_default_http_client=true test/no_default_http_client_test.dart`" runs-on: ubuntu-latest steps: @@ -362,8 +340,7 @@ jobs: - job_005 - job_006 - job_007 - - job_008 - job_011: + job_010: name: "unit_test; linux; Dart 3.2.0; PKG: pkgs/http; `dart test --platform chrome`" runs-on: ubuntu-latest steps: @@ -401,8 +378,7 @@ jobs: - job_005 - job_006 - job_007 - - job_008 - job_012: + job_011: name: "unit_test; linux; Dart 3.2.0; PKG: pkgs/http; `dart test --platform vm`" runs-on: ubuntu-latest steps: @@ -440,8 +416,7 @@ jobs: - job_005 - job_006 - job_007 - - job_008 - job_013: + job_012: name: "unit_test; linux; Dart dev; PKG: pkgs/http; `dart run --define=no_default_http_client=true test/no_default_http_client_test.dart`" runs-on: ubuntu-latest steps: @@ -479,8 +454,7 @@ jobs: - job_005 - job_006 - job_007 - - job_008 - job_014: + job_013: name: "unit_test; linux; Dart dev; PKG: pkgs/http; `dart test --platform chrome`" runs-on: ubuntu-latest steps: @@ -518,8 +492,7 @@ jobs: - job_005 - job_006 - job_007 - - job_008 - job_015: + job_014: name: "unit_test; linux; Dart dev; PKGS: pkgs/http, pkgs/http_profile; `dart test --platform vm`" runs-on: ubuntu-latest steps: @@ -566,8 +539,7 @@ jobs: - job_005 - job_006 - job_007 - - job_008 - job_016: + job_015: name: "unit_test; linux; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test --platform chrome`" runs-on: ubuntu-latest steps: @@ -605,8 +577,7 @@ jobs: - job_005 - job_006 - job_007 - - job_008 - job_017: + job_016: name: "unit_test; linux; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test`" runs-on: ubuntu-latest steps: @@ -644,8 +615,7 @@ jobs: - job_005 - job_006 - job_007 - - job_008 - job_018: + job_017: name: "unit_test; macos; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test`" runs-on: macos-latest steps: @@ -683,8 +653,7 @@ jobs: - job_005 - job_006 - job_007 - - job_008 - job_019: + job_018: name: "unit_test; windows; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test`" runs-on: windows-latest steps: @@ -712,4 +681,3 @@ jobs: - job_005 - job_006 - job_007 - - job_008 diff --git a/analysis_options.yaml b/analysis_options.yaml index 7d741bd4f1..e536739953 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -14,15 +14,10 @@ linter: - avoid_returning_this - avoid_unused_constructor_parameters - cascade_invocations - - comment_references - join_return_with_assignment - missing_whitespace_between_adjacent_strings - no_adjacent_strings_in_list - no_runtimeType_toString - - prefer_const_constructors - prefer_const_declarations - prefer_expression_function_bodies - - prefer_relative_imports - - test_types_in_equals - use_string_buffers - - use_super_parameters diff --git a/pkgs/cronet_http/CHANGELOG.md b/pkgs/cronet_http/CHANGELOG.md index 83e27012b2..7eecd298e0 100644 --- a/pkgs/cronet_http/CHANGELOG.md +++ b/pkgs/cronet_http/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.4.3-wip + ## 0.4.2 * Require `package:jni >= 0.7.2` to remove a potential buffer overflow. diff --git a/pkgs/cronet_http/example/pubspec.yaml b/pkgs/cronet_http/example/pubspec.yaml index 568cef98df..5bb80276a6 100644 --- a/pkgs/cronet_http/example/pubspec.yaml +++ b/pkgs/cronet_http/example/pubspec.yaml @@ -4,7 +4,7 @@ description: Demonstrates how to use the cronet_http plugin. publish_to: 'none' environment: - sdk: "^3.0.0" + sdk: ^3.0.0 dependencies: cached_network_image: ^3.2.3 @@ -13,10 +13,10 @@ dependencies: cupertino_icons: ^1.0.2 flutter: sdk: flutter - http: ^0.13.5 + http: ^1.0.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 flutter_test: sdk: flutter http_client_conformance_tests: diff --git a/pkgs/cronet_http/pubspec.yaml b/pkgs/cronet_http/pubspec.yaml index 82390c8d52..7858392c27 100644 --- a/pkgs/cronet_http/pubspec.yaml +++ b/pkgs/cronet_http/pubspec.yaml @@ -1,7 +1,7 @@ name: cronet_http description: > An Android Flutter plugin that provides access to the Cronet HTTP client. -version: 0.4.2 +version: 0.4.3-wip repository: https://github.com/dart-lang/http/tree/master/pkgs/cronet_http environment: @@ -15,7 +15,7 @@ dependencies: jni: ^0.7.2 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 jnigen: ^0.7.0 xml: ^6.1.0 yaml_edit: ^2.0.3 diff --git a/pkgs/cupertino_http/CHANGELOG.md b/pkgs/cupertino_http/CHANGELOG.md index 3a69c498dc..48d990e185 100644 --- a/pkgs/cupertino_http/CHANGELOG.md +++ b/pkgs/cupertino_http/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.1.1-wip + ## 1.1.0 * Add websocket support to `cupertino_api`. diff --git a/pkgs/cupertino_http/example/integration_test/client_test.dart b/pkgs/cupertino_http/example/integration_test/client_test.dart index 9247783a09..1becd5c049 100644 --- a/pkgs/cupertino_http/example/integration_test/client_test.dart +++ b/pkgs/cupertino_http/example/integration_test/client_test.dart @@ -2,6 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:async'; import 'dart:io'; import 'dart:typed_data'; @@ -45,7 +46,7 @@ void testClient(Client client) { } final request = StreamedRequest('POST', uri); request.sink.add(data); - request.sink.close(); + unawaited(request.sink.close()); await client.send(request); expect(serverHash, sha1.convert(data).bytes); }); diff --git a/pkgs/cupertino_http/example/pubspec.yaml b/pkgs/cupertino_http/example/pubspec.yaml index be727312a2..bae184b71c 100644 --- a/pkgs/cupertino_http/example/pubspec.yaml +++ b/pkgs/cupertino_http/example/pubspec.yaml @@ -16,12 +16,12 @@ dependencies: cupertino_icons: ^1.0.2 flutter: sdk: flutter - http: ^0.13.5 + http: ^1.0.0 dev_dependencies: convert: ^3.1.1 crypto: ^3.0.3 - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 ffi: ^2.0.1 flutter_test: sdk: flutter diff --git a/pkgs/cupertino_http/pubspec.yaml b/pkgs/cupertino_http/pubspec.yaml index 9d639a8450..9b7e1f828a 100644 --- a/pkgs/cupertino_http/pubspec.yaml +++ b/pkgs/cupertino_http/pubspec.yaml @@ -2,7 +2,7 @@ name: cupertino_http description: > A macOS/iOS Flutter plugin that provides access to the Foundation URL Loading System. -version: 1.1.0 +version: 1.1.1-wip repository: https://github.com/dart-lang/http/tree/master/pkgs/cupertino_http environment: @@ -17,7 +17,7 @@ dependencies: http: '>=0.13.4 <2.0.0' dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 ffigen: ^9.0.1 flutter: diff --git a/pkgs/flutter_http_example/pubspec.yaml b/pkgs/flutter_http_example/pubspec.yaml index 6f3d1ba729..f2cf6c19f0 100644 --- a/pkgs/flutter_http_example/pubspec.yaml +++ b/pkgs/flutter_http_example/pubspec.yaml @@ -17,11 +17,11 @@ dependencies: fetch_client: ^1.0.2 flutter: sdk: flutter - http: ^0.13.5 + http: ^1.0.0 provider: ^6.0.5 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 flutter_test: sdk: flutter integration_test: diff --git a/pkgs/http/CHANGELOG.md b/pkgs/http/CHANGELOG.md index 1fb4c223b4..ca3084fa44 100644 --- a/pkgs/http/CHANGELOG.md +++ b/pkgs/http/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.1.2-wip + ## 1.1.1 * `BrowserClient` throws `ClientException` when the `'Content-Length'` header diff --git a/pkgs/http/pubspec.yaml b/pkgs/http/pubspec.yaml index 3df7a30df4..ebe381620f 100644 --- a/pkgs/http/pubspec.yaml +++ b/pkgs/http/pubspec.yaml @@ -1,5 +1,5 @@ name: http -version: 1.1.1 +version: 1.1.2-wip description: A composable, multi-platform, Future-based API for HTTP requests. repository: https://github.com/dart-lang/http/tree/master/pkgs/http @@ -13,7 +13,7 @@ dependencies: web: ^0.4.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 fake_async: ^1.2.0 http_client_conformance_tests: path: ../http_client_conformance_tests/ diff --git a/pkgs/http_client_conformance_tests/pubspec.yaml b/pkgs/http_client_conformance_tests/pubspec.yaml index 42640597ce..de5ffb61b9 100644 --- a/pkgs/http_client_conformance_tests/pubspec.yaml +++ b/pkgs/http_client_conformance_tests/pubspec.yaml @@ -6,14 +6,14 @@ publish_to: none repository: https://github.com/dart-lang/http/tree/master/pkgs/http_client_conformance_tests environment: - sdk: '>=2.19.0 <3.0.0' + sdk: ^3.0.0 dependencies: async: ^2.8.2 dart_style: ^2.2.3 - http: '>=0.13.4 <2.0.0' + http: ^1.0.0 stream_channel: ^2.1.1 test: ^1.21.2 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 diff --git a/pkgs/java_http/pubspec.yaml b/pkgs/java_http/pubspec.yaml index ecba4f13e6..a0e100dcfd 100644 --- a/pkgs/java_http/pubspec.yaml +++ b/pkgs/java_http/pubspec.yaml @@ -14,9 +14,8 @@ dependencies: path: ^1.8.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 http_client_conformance_tests: path: ../http_client_conformance_tests/ jnigen: ^0.5.0 - lints: ^2.0.0 test: ^1.21.0