From f180e4515705ace09956ceddc86e872efa499d65 Mon Sep 17 00:00:00 2001 From: Kenzie Davisson Date: Thu, 30 Jul 2026 11:33:49 -0700 Subject: [PATCH 1/2] Run `dcm check-unused-code` on devtools_app_shared --- .github/workflows/build.yaml | 2 +- analysis_options.yaml | 7 +++---- flutter-candidate.txt | 2 +- .../lib/src/ui/theme/_ide_theme_web.dart | 2 ++ .../devtools_app_shared/lib/src/utils/url/_url_web.dart | 2 ++ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5f94a514ff7..a55dedcc277 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -86,7 +86,7 @@ jobs: - name: Run dcm checks on packages # TODO(https://github.com/flutter/devtools/issues/9906): run on all DevTools packages. run: | - dcm check-unused-code packages/devtools_app --exclude-public-api + dcm check-unused-code packages/devtools_app packages/devtools_app_shared --exclude-public-api test-packages: name: ${{ matrix.os }} ${{ matrix.package }} test diff --git a/analysis_options.yaml b/analysis_options.yaml index 7438d8d372a..17c90154675 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -165,9 +165,6 @@ dart_code_metrics: - test/** exclude: unused-code: - # TODO(https://github.com/dart-lang/sdk/issues/63864): clean up these - # paths once this issue is fixed. These paths are currently relative to - # devtools_app/. # TODO(https://github.com/flutter/devtools/issues/9906) remove these # excludes as findings are resolved. # Investigate internal usages of inspector logic before removing. @@ -175,7 +172,9 @@ dart_code_metrics: - lib/src/shared/diagnostics/inspector_service.dart - lib/src/shared/diagnostics/diagnostics_node.dart # This fixture has unused code for testing the debugger. - - test/test_infra/fixtures/flutter_app/** + - packages/devtools_app/test/test_infra/fixtures/flutter_app/** + # Ignore unused code in package examples. + - packages/devtools_app_shared/example/** rules: # - arguments-ordering Too strict # - avoid-banned-imports # TODO(polina-c): add configuration diff --git a/flutter-candidate.txt b/flutter-candidate.txt index f094eb2ae96..22deb79d60b 100644 --- a/flutter-candidate.txt +++ b/flutter-candidate.txt @@ -1 +1 @@ -0f0246377b1c9d8bc365a439c520a7de6c3f590b +d0da4767346ae787dc60168c8581e3e57ecda6b5 diff --git a/packages/devtools_app_shared/lib/src/ui/theme/_ide_theme_web.dart b/packages/devtools_app_shared/lib/src/ui/theme/_ide_theme_web.dart index 4b55e70edaf..993e9b70ac1 100644 --- a/packages/devtools_app_shared/lib/src/ui/theme/_ide_theme_web.dart +++ b/packages/devtools_app_shared/lib/src/ui/theme/_ide_theme_web.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. +// ignore_for_file: unused-code, this file is exported via config specific exports. + import 'package:web/web.dart'; import '../../utils/url/url.dart'; diff --git a/packages/devtools_app_shared/lib/src/utils/url/_url_web.dart b/packages/devtools_app_shared/lib/src/utils/url/_url_web.dart index 4e81763c4fc..5fa176657cc 100644 --- a/packages/devtools_app_shared/lib/src/utils/url/_url_web.dart +++ b/packages/devtools_app_shared/lib/src/utils/url/_url_web.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. +// ignore_for_file: unused-code, this file is exported via config specific exports. + import 'package:web/web.dart'; Map loadQueryParams({String Function(String)? urlModifier}) { From 7b4f5445a8c665f668574e91de58cdb3aa5e70b7 Mon Sep 17 00:00:00 2001 From: Kenzie Davisson Date: Fri, 31 Jul 2026 10:42:57 -0700 Subject: [PATCH 2/2] Resolve analysis options issues --- analysis_options.yaml | 25 ++++++++++++-------- packages/devtools_app/analysis_options.yaml | 26 --------------------- 2 files changed, 15 insertions(+), 36 deletions(-) delete mode 100644 packages/devtools_app/analysis_options.yaml diff --git a/analysis_options.yaml b/analysis_options.yaml index b1724209145..6d5d565384b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -18,13 +18,18 @@ analyzer: - '**/build/**' - '**.freezed.dart' - tool/flutter-sdk/ - - build/** - - android/** - - ios/** - - web/** - - windows/** - - macos/** - - linux/** + - '**/lib/generated_plugin_registrant.dart' + - '**/android/**' + - '**/ios/**' + - '**/web/**' + - '**/windows/**' + - '**/macos/**' + - '**/linux/**' + # Syntax highlighting test files may include or lint-violating code + # for testing so should be ignored. Uncomment this while modifying + # these files if you want to ensure code is not invalid except where + # expected. + - packages/devtools_app/test/test_infra/test_data/syntax_highlighting/** linter: rules: @@ -156,19 +161,19 @@ linter: - valid_regexps # - void_checks # not yet tested -dart_code_metrics: +dcm: metrics: cyclomatic-complexity: 20 number-of-parameters: 4 maximum-nesting-level: 5 metrics-exclude: - - test/** + - packages/devtools_app/test/test_infra/test_data/** exclude: unused-code: # TODO(https://github.com/flutter/devtools/issues/9906) remove these # excludes as findings are resolved. # This fixture has unused code for testing the debugger. - - packages/devtools_app/test/test_infra/fixtures/flutter_app/** + - packages/devtools_app/test/test_infra/fixtures/** # Ignore unused code in package examples. - packages/devtools_app_shared/example/** rules: diff --git a/packages/devtools_app/analysis_options.yaml b/packages/devtools_app/analysis_options.yaml deleted file mode 100644 index 1fb0989e4ce..00000000000 --- a/packages/devtools_app/analysis_options.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2025 The Flutter Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. -include: ../../analysis_options.yaml - -analyzer: - exclude: - - build/** - - lib/generated_plugin_registrant.dart - - macos/ - # Syntax highlighting test files may include or lint-violating code - # for testing so should be ignored. Uncomment this while modifying - # these files if you want to ensure code is not invalid except where - # expected. - - test/test_infra/test_data/syntax_highlighting/** - - android/** - - ios/** - - web/** - - windows/** - - macos/** - - linux/** - -dart_code_metrics: - metrics-exclude: - - test/** - - test/test_infra/test_data/**