From 1efa7e43e3205a8978a9637f4e979eeb96376a91 Mon Sep 17 00:00:00 2001 From: Felix Angelov Date: Wed, 18 Dec 2024 17:39:58 -0600 Subject: [PATCH] refactor(artifact_proxy): upgrade analysis_options (#2713) --- packages/artifact_proxy/analysis_options.yaml | 4 +++- packages/artifact_proxy/bin/server.dart | 3 --- packages/artifact_proxy/build.yaml | 1 + packages/artifact_proxy/lib/src/artifact_proxy.dart | 3 ++- .../artifact_proxy/lib/src/models/artifacts_manifest.g.dart | 2 +- packages/artifact_proxy/pubspec.lock | 4 ++-- packages/artifact_proxy/pubspec.yaml | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/artifact_proxy/analysis_options.yaml b/packages/artifact_proxy/analysis_options.yaml index 799268d3e..09094a71b 100644 --- a/packages/artifact_proxy/analysis_options.yaml +++ b/packages/artifact_proxy/analysis_options.yaml @@ -1 +1,3 @@ -include: package:very_good_analysis/analysis_options.5.1.0.yaml +include: package:very_good_analysis/analysis_options.7.0.0.yaml +analyzer: + exclude: "*.g.dart" diff --git a/packages/artifact_proxy/bin/server.dart b/packages/artifact_proxy/bin/server.dart index 3bcc14f72..e52099be8 100644 --- a/packages/artifact_proxy/bin/server.dart +++ b/packages/artifact_proxy/bin/server.dart @@ -1,5 +1,3 @@ -// ignore_for_file: avoid_print - import 'dart:io'; import 'package:artifact_proxy/artifact_proxy.dart'; @@ -24,7 +22,6 @@ Future serve(Handler proxy, InternetAddress ip, int port) async { const pipeline = Pipeline(); final handler = pipeline.addMiddleware(logRequests()).addHandler(proxy); final server = await shelf_io.serve(handler, ip, port); - print('Serving at http://localhost:${server.port}'); server.autoCompress = true; return server; } diff --git a/packages/artifact_proxy/build.yaml b/packages/artifact_proxy/build.yaml index 52cb55e6b..9afb9019d 100644 --- a/packages/artifact_proxy/build.yaml +++ b/packages/artifact_proxy/build.yaml @@ -9,6 +9,7 @@ targets: - cast_nullable_to_non_nullable - lines_longer_than_80_chars - strict_raw_type + - document_ignores json_serializable: options: field_rename: snake diff --git a/packages/artifact_proxy/lib/src/artifact_proxy.dart b/packages/artifact_proxy/lib/src/artifact_proxy.dart index b25436720..dc1106b48 100644 --- a/packages/artifact_proxy/lib/src/artifact_proxy.dart +++ b/packages/artifact_proxy/lib/src/artifact_proxy.dart @@ -1,3 +1,4 @@ +// print is used for diagnostic logs. // ignore_for_file: avoid_print import 'package:artifact_proxy/artifact_proxy.dart'; @@ -60,7 +61,7 @@ Handler artifactProxyHandler({required ArtifactManifestClient client}) { final ArtifactsManifest manifest; try { manifest = await client.getManifest(shorebirdEngineRevision); - } catch (error) { + } on Exception catch (error) { return Response.notFound( 'Failed to fetch manifest for $shorebirdEngineRevision\n$error', ); diff --git a/packages/artifact_proxy/lib/src/models/artifacts_manifest.g.dart b/packages/artifact_proxy/lib/src/models/artifacts_manifest.g.dart index 2e7f0eda8..f751506dd 100644 --- a/packages/artifact_proxy/lib/src/models/artifacts_manifest.g.dart +++ b/packages/artifact_proxy/lib/src/models/artifacts_manifest.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: implicit_dynamic_parameter, require_trailing_commas, cast_nullable_to_non_nullable, lines_longer_than_80_chars, strict_raw_type +// ignore_for_file: implicit_dynamic_parameter, require_trailing_commas, cast_nullable_to_non_nullable, lines_longer_than_80_chars, strict_raw_type, document_ignores part of 'artifacts_manifest.dart'; diff --git a/packages/artifact_proxy/pubspec.lock b/packages/artifact_proxy/pubspec.lock index 25d5be938..cdb63951f 100644 --- a/packages/artifact_proxy/pubspec.lock +++ b/packages/artifact_proxy/pubspec.lock @@ -538,10 +538,10 @@ packages: dependency: "direct dev" description: name: very_good_analysis - sha256: "1fb637c0022034b1f19ea2acb42a3603cbd8314a470646a59a2fb01f5f3a8629" + sha256: "62d2b86d183fb81b2edc22913d9f155d26eb5cf3855173adb1f59fac85035c63" url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "7.0.0" vm_service: dependency: transitive description: diff --git a/packages/artifact_proxy/pubspec.yaml b/packages/artifact_proxy/pubspec.yaml index 36596cdee..ed37e07b9 100644 --- a/packages/artifact_proxy/pubspec.yaml +++ b/packages/artifact_proxy/pubspec.yaml @@ -21,4 +21,4 @@ dev_dependencies: json_serializable: ^6.9.0 mocktail: ^1.0.4 test: ^1.25.12 - very_good_analysis: ^6.0.0 + very_good_analysis: ^7.0.0