From cc966b7c1940178c8b67d7faefb20d496dc4fd40 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Wed, 30 Oct 2024 16:26:25 +0100 Subject: [PATCH] Fix unused import, add benchmark_generator analysis to mono_pkg. (#125) --- .github/workflows/dart.yml | 45 +++++++++++++++---- .../lib/json_encodable/input_generator.dart | 2 - tool/benchmark_generator/mono_pkg.yaml | 10 +++++ 3 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 tool/benchmark_generator/mono_pkg.yaml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 03b7ccea..1447ce9f 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -38,16 +38,16 @@ jobs: - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: - name: "analyze_and_format; linux; Dart 3.7.0-39.0.dev; PKGS: pkgs/_analyzer_cfe_macros, pkgs/_analyzer_macros, pkgs/_cfe_macros, pkgs/_macro_builder, pkgs/_macro_client, pkgs/_macro_host, pkgs/_macro_runner, pkgs/_macro_server, pkgs/_macro_tool, pkgs/_test_macros, pkgs/dart_model, pkgs/macro, pkgs/macro_service, tool/dart_model_generator; `dart analyze --fatal-infos .`" + name: "analyze_and_format; linux; Dart 3.7.0-39.0.dev; PKGS: pkgs/_analyzer_cfe_macros, pkgs/_analyzer_macros, pkgs/_cfe_macros, pkgs/_macro_builder, pkgs/_macro_client, pkgs/_macro_host, pkgs/_macro_runner, pkgs/_macro_server, pkgs/_macro_tool, pkgs/_test_macros, pkgs/dart_model, pkgs/macro, pkgs/macro_service, tool/benchmark_generator, tool/dart_model_generator; `dart analyze --fatal-infos .`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0-39.0.dev;packages:pkgs/_analyzer_cfe_macros-pkgs/_analyzer_macros-pkgs/_cfe_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/dart_model_generator;commands:analyze" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0-39.0.dev;packages:pkgs/_analyzer_cfe_macros-pkgs/_analyzer_macros-pkgs/_cfe_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/benchmark_generator-tool/dart_model_generator;commands:analyze" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0-39.0.dev;packages:pkgs/_analyzer_cfe_macros-pkgs/_analyzer_macros-pkgs/_cfe_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/dart_model_generator + os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0-39.0.dev;packages:pkgs/_analyzer_cfe_macros-pkgs/_analyzer_macros-pkgs/_cfe_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/benchmark_generator-tool/dart_model_generator os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0-39.0.dev os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest @@ -175,6 +175,15 @@ jobs: run: dart analyze --fatal-infos . if: "always() && steps.pkgs_macro_service_pub_upgrade.conclusion == 'success'" working-directory: pkgs/macro_service + - id: tool_benchmark_generator_pub_upgrade + name: tool/benchmark_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: tool/benchmark_generator + - name: "tool/benchmark_generator; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.tool_benchmark_generator_pub_upgrade.conclusion == 'success'" + working-directory: tool/benchmark_generator - id: tool_dart_model_generator_pub_upgrade name: tool/dart_model_generator; dart pub upgrade run: dart pub upgrade @@ -185,16 +194,16 @@ jobs: if: "always() && steps.tool_dart_model_generator_pub_upgrade.conclusion == 'success'" working-directory: tool/dart_model_generator job_003: - name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/_analyzer_cfe_macros, pkgs/_analyzer_macros, pkgs/_cfe_macros, pkgs/_macro_builder, pkgs/_macro_client, pkgs/_macro_host, pkgs/_macro_runner, pkgs/_macro_server, pkgs/_macro_tool, pkgs/_test_macros, pkgs/dart_model, pkgs/macro, pkgs/macro_service, tool/dart_model_generator; `dart format --output=none --set-exit-if-changed .`" + name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/_analyzer_cfe_macros, pkgs/_analyzer_macros, pkgs/_cfe_macros, pkgs/_macro_builder, pkgs/_macro_client, pkgs/_macro_host, pkgs/_macro_runner, pkgs/_macro_server, pkgs/_macro_tool, pkgs/_test_macros, pkgs/dart_model, pkgs/macro, pkgs/macro_service, tool/benchmark_generator, tool/dart_model_generator; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/_analyzer_cfe_macros-pkgs/_analyzer_macros-pkgs/_cfe_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/dart_model_generator;commands:format" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/_analyzer_cfe_macros-pkgs/_analyzer_macros-pkgs/_cfe_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/benchmark_generator-tool/dart_model_generator;commands:format" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/_analyzer_cfe_macros-pkgs/_analyzer_macros-pkgs/_cfe_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/dart_model_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/_analyzer_cfe_macros-pkgs/_analyzer_macros-pkgs/_cfe_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/benchmark_generator-tool/dart_model_generator os:ubuntu-latest;pub-cache-hosted;sdk:dev os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest @@ -322,6 +331,15 @@ jobs: run: "dart format --output=none --set-exit-if-changed ." if: "always() && steps.pkgs_macro_service_pub_upgrade.conclusion == 'success'" working-directory: pkgs/macro_service + - id: tool_benchmark_generator_pub_upgrade + name: tool/benchmark_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: tool/benchmark_generator + - name: "tool/benchmark_generator; dart format --output=none --set-exit-if-changed ." + run: "dart format --output=none --set-exit-if-changed ." + if: "always() && steps.tool_benchmark_generator_pub_upgrade.conclusion == 'success'" + working-directory: tool/benchmark_generator - id: tool_dart_model_generator_pub_upgrade name: tool/dart_model_generator; dart pub upgrade run: dart pub upgrade @@ -332,16 +350,16 @@ jobs: if: "always() && steps.tool_dart_model_generator_pub_upgrade.conclusion == 'success'" working-directory: tool/dart_model_generator job_004: - name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/_analyzer_macros, pkgs/_macro_builder, pkgs/_macro_client, pkgs/_macro_host, pkgs/_macro_runner, pkgs/_macro_server, pkgs/_macro_tool, pkgs/_test_macros, pkgs/dart_model, pkgs/macro, pkgs/macro_service, tool/dart_model_generator; `dart analyze --fatal-infos .`" + name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/_analyzer_macros, pkgs/_macro_builder, pkgs/_macro_client, pkgs/_macro_host, pkgs/_macro_runner, pkgs/_macro_server, pkgs/_macro_tool, pkgs/_test_macros, pkgs/dart_model, pkgs/macro, pkgs/macro_service, tool/benchmark_generator, tool/dart_model_generator; `dart analyze --fatal-infos .`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/_analyzer_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/dart_model_generator;commands:analyze" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/_analyzer_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/benchmark_generator-tool/dart_model_generator;commands:analyze" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/_analyzer_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/dart_model_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:pkgs/_analyzer_macros-pkgs/_macro_builder-pkgs/_macro_client-pkgs/_macro_host-pkgs/_macro_runner-pkgs/_macro_server-pkgs/_macro_tool-pkgs/_test_macros-pkgs/dart_model-pkgs/macro-pkgs/macro_service-tool/benchmark_generator-tool/dart_model_generator os:ubuntu-latest;pub-cache-hosted;sdk:dev os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest @@ -451,6 +469,15 @@ jobs: run: dart analyze --fatal-infos . if: "always() && steps.pkgs_macro_service_pub_upgrade.conclusion == 'success'" working-directory: pkgs/macro_service + - id: tool_benchmark_generator_pub_upgrade + name: tool/benchmark_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: tool/benchmark_generator + - name: "tool/benchmark_generator; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.tool_benchmark_generator_pub_upgrade.conclusion == 'success'" + working-directory: tool/benchmark_generator - id: tool_dart_model_generator_pub_upgrade name: tool/dart_model_generator; dart pub upgrade run: dart pub upgrade diff --git a/tool/benchmark_generator/lib/json_encodable/input_generator.dart b/tool/benchmark_generator/lib/json_encodable/input_generator.dart index dac10b7b..b03f5417 100644 --- a/tool/benchmark_generator/lib/json_encodable/input_generator.dart +++ b/tool/benchmark_generator/lib/json_encodable/input_generator.dart @@ -2,8 +2,6 @@ // 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:io'; - import 'package:benchmark_generator/random.dart'; import 'package:benchmark_generator/workspace.dart'; diff --git a/tool/benchmark_generator/mono_pkg.yaml b/tool/benchmark_generator/mono_pkg.yaml new file mode 100644 index 00000000..15378042 --- /dev/null +++ b/tool/benchmark_generator/mono_pkg.yaml @@ -0,0 +1,10 @@ +sdk: +- pubspec +- dev + +stages: +- analyze_and_format: + - analyze: --fatal-infos . + - format: + sdk: + - dev