diff --git a/analysis_options.yaml b/analysis_options.yaml index afea0793..43a1a8b9 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:very_good_analysis/analysis_options.9.0.0.yaml +include: package:very_good_analysis/analysis_options.10.0.0.yaml analyzer: exclude: - bin/cache/** diff --git a/packages/shorebird_cli/lib/src/http_client/retrying_client.dart b/packages/shorebird_cli/lib/src/http_client/retrying_client.dart index 49b7e07c..02c09d55 100644 --- a/packages/shorebird_cli/lib/src/http_client/retrying_client.dart +++ b/packages/shorebird_cli/lib/src/http_client/retrying_client.dart @@ -12,14 +12,16 @@ http.Client retryingHttpClient(http.Client client) => RetryClient( /// Returns `true` if the [exception] is a retryable exception. bool isRetryableException(Object exception, StackTrace _) { - return switch (exception.runtimeType) { - const (http.ClientException) => true, - const (HttpException) => true, - const (TlsException) => true, - const (SocketException) => true, - const (WebSocketException) => true, - _ => false, - }; + switch (exception) { + case http.ClientException(): + case HttpException(): + case TlsException(): + case SocketException(): + case WebSocketException(): + return true; + default: + return false; + } } /// Returns `true` if the [response] is a retryable response. diff --git a/packages/shorebird_cli/test/src/cache_test.dart b/packages/shorebird_cli/test/src/cache_test.dart index d41a7734..eebc770c 100644 --- a/packages/shorebird_cli/test/src/cache_test.dart +++ b/packages/shorebird_cli/test/src/cache_test.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:io'; import 'package:archive/archive_io.dart'; @@ -168,7 +169,7 @@ void main() { () => Cache.shorebirdCacheDirectory, ); expect(shorebirdCacheDirectory.existsSync(), isFalse); - runWithOverrides(cache.clear); + unawaited(runWithOverrides(cache.clear)); expect(shorebirdCacheDirectory.existsSync(), isFalse); }); }); diff --git a/packages/shorebird_cli/test/src/commands/patches/promote_command_test.dart b/packages/shorebird_cli/test/src/commands/patches/promote_command_test.dart index 4679fedb..219c9077 100644 --- a/packages/shorebird_cli/test/src/commands/patches/promote_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/patches/promote_command_test.dart @@ -119,8 +119,8 @@ void main() { when(() => argResults['patch-number']).thenReturn('5'); }); - test('should log an error', () { - runWithOverrides(() async { + test('should log an error', () async { + await runWithOverrides(() async { final result = await command.run(); expect(result, equals(ExitCode.usage.code)); diff --git a/packages/shorebird_cli/test/src/commands/preview_command_test.dart b/packages/shorebird_cli/test/src/commands/preview_command_test.dart index 362ad217..118a6f68 100644 --- a/packages/shorebird_cli/test/src/commands/preview_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/preview_command_test.dart @@ -2728,7 +2728,7 @@ channel: ${DeploymentTrack.staging.channel} () => process.exitCode, ).thenAnswer((_) async => ExitCode.success.code); - createAabFile(channel: null); + unawaited(createAabFile(channel: null)); }); test('exits with success and calls install and launch app', () async { diff --git a/packages/shorebird_cli/test/src/shorebird_process_test.dart b/packages/shorebird_cli/test/src/shorebird_process_test.dart index cb55eeac..04c45b69 100644 --- a/packages/shorebird_cli/test/src/shorebird_process_test.dart +++ b/packages/shorebird_cli/test/src/shorebird_process_test.dart @@ -118,11 +118,13 @@ void main() { ).called(1); }); - test('sanitizes executable on windows', () { + test('sanitizes executable on windows', () async { when(() => platform.isWindows).thenReturn(true); const executable = r'C:\Program Files\Android\Android Studio\jbr\bin\java.exe'; - runWithOverrides(() => shorebirdProcess.run(executable, ['--version'])); + await runWithOverrides( + () => shorebirdProcess.run(executable, ['--version']), + ); verify( () => processWrapper.run( '"$executable"', @@ -490,11 +492,11 @@ void main() { ).called(1); }); - test('sanitizes executable on windows', () { + test('sanitizes executable on windows', () async { when(() => platform.isWindows).thenReturn(true); const executable = r'C:\Program Files\Android\Android Studio\jbr\bin\java.exe'; - runWithOverrides( + await runWithOverrides( () => shorebirdProcess.start(executable, ['--version']), ); verify( diff --git a/packages/shorebird_code_push_client/lib/src/code_push_client.dart b/packages/shorebird_code_push_client/lib/src/code_push_client.dart index 7beb1bef..c177c5e7 100644 --- a/packages/shorebird_code_push_client/lib/src/code_push_client.dart +++ b/packages/shorebird_code_push_client/lib/src/code_push_client.dart @@ -146,8 +146,8 @@ class CodePushClient { 'platform': platform.name, 'hash': hash, 'size': '${file.length}', - if (hashSignature != null) 'hash_signature': hashSignature, - if (podfileLockHash != null) 'podfile_lock_hash': podfileLockHash, + 'hash_signature': ?hashSignature, + 'podfile_lock_hash': ?podfileLockHash, }); final response = await _httpClient.send(request); final body = await response.stream.bytesToString(); @@ -301,8 +301,8 @@ class CodePushClient { body: json.encode({ 'version': version, 'flutter_revision': flutterRevision, - if (flutterVersion != null) 'flutter_version': flutterVersion, - if (displayName != null) 'display_name': displayName, + 'flutter_version': ?flutterVersion, + 'display_name': ?displayName, }), ); @@ -445,7 +445,7 @@ class CodePushClient { final response = await _httpClient.get( Uri.parse('$_v1/apps/$appId/releases/$releaseId/artifacts').replace( queryParameters: { - if (arch != null) 'arch': arch, + 'arch': ?arch, if (platform != null) 'platform': platform.name, }, ), diff --git a/pubspec.lock b/pubspec.lock index 19b0e197..f15ad321 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -858,4 +858,4 @@ packages: source: hosted version: "2.2.2" sdks: - dart: ">=3.8.1 <4.0.0" + dart: ">=3.9.0 <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index beaa42fd..66b1d5b8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: _ publish_to: none environment: - sdk: ^3.8.0 + sdk: ^3.9.0 workspace: - packages/artifact_proxy - packages/discord_gcp_alerts