Run `dcm check-unused-code` on `devtools_app_shared` (#9934)
* Run `dcm check-unused-code` on devtools_app_shared
* Resolve analysis options issues
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index d5f3f2e..8d969d4 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -86,7 +86,7 @@
- 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 packages/devtools_extensions packages/devtools_shared --exclude-public-api
+ dcm check-unused-code packages/devtools_app packages/devtools_app_shared packages/devtools_extensions packages/devtools_shared --exclude-public-api
test-packages:
name: ${{ matrix.os }} ${{ matrix.package }} test
diff --git a/analysis_options.yaml b/analysis_options.yaml
index a50ef32..6d5d565 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -18,13 +18,18 @@
- '**/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,22 +161,21 @@
- 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/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.
# This fixture has unused code for testing the debugger.
- - 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:
# - arguments-ordering Too strict
# - avoid-banned-imports # TODO(polina-c): add configuration
diff --git a/flutter-candidate.txt b/flutter-candidate.txt
index f094eb2..22deb79 100644
--- a/flutter-candidate.txt
+++ b/flutter-candidate.txt
@@ -1 +1 @@
-0f0246377b1c9d8bc365a439c520a7de6c3f590b
+d0da4767346ae787dc60168c8581e3e57ecda6b5
diff --git a/packages/devtools_app/analysis_options.yaml b/packages/devtools_app/analysis_options.yaml
deleted file mode 100644
index 1fb0989..0000000
--- 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/**
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 4b55e70..993e9b7 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 4e81763..5fa1766 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<String, String> loadQueryParams({String Function(String)? urlModifier}) {