From 329845f2288b2a168a287de875f6b93bdbd13274 Mon Sep 17 00:00:00 2001 From: chuxue Date: Sat, 26 Sep 2026 01:18:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20CI=20=E7=9A=84=20analyze=20=E5=9B=A0=20i?= =?UTF-8?q?nfo=20=E7=BA=A7=E5=88=AB=E6=8F=90=E7=A4=BA=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit flutter analyze 默认把 info 也当致命项,仓库里那条既有的 prefer_initializing_formals 让 checks 作业 exit 1,后面三个构建作业全被跳过。 两处处理: 1. 真把这条 lint 修掉——TitleApiService 改用私有初始化形参 {this._cookies}, Dart 对外仍暴露成 cookies: 具名参数,调用点无需改动。analyze 现在 0 issue。 2. CI 改用 flutter analyze --no-fatal-infos,与 README 写的「0 error/warning」 一致;否则依赖升级带进来的 deprecation 提示(之前 dart:html 那 5 条) 会毫无道理地打断整条流水线。 --- .github/workflows/build.yml | 4 +++- lib/services/title_api_service.dart | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64144d4..790d08b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,9 @@ jobs: channel: stable cache: true - run: flutter pub get - - run: flutter analyze + # info 级别不致命:仓库标准是 0 error/warning(见 README), + # 否则依赖升级带进来的 deprecation 提示就会打断整条流水线。 + - run: flutter analyze --no-fatal-infos - run: flutter test android: diff --git a/lib/services/title_api_service.dart b/lib/services/title_api_service.dart index 03307c7..29c2f7b 100644 --- a/lib/services/title_api_service.dart +++ b/lib/services/title_api_service.dart @@ -42,7 +42,7 @@ class TitleApiService { final TitleServerConfig _config; String? _cookies; - TitleApiService(this._config, {String? cookies}) : _cookies = cookies; + TitleApiService(this._config, {this._cookies}); String? get cookies => _cookies;