From 70529de9d3d6dee08c3fa258b47a93a097b15d52 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 20 May 2026 15:10:56 -0400 Subject: [PATCH] fix(ci): golangci-lint v2 schema + Flutter 3.44 ListTile strictness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two fixes for CI bounces caused by the new ci-go:1.26 / ci-flutter:3.44 toolchain images surfacing stricter checks than the previous runners. 1. .golangci.yml: migrate to v2 schema - Add `version: "2"` (now required). - `linters.disable-all: true` → `linters.default: none`. - Move `gofmt` + `goimports` out of `linters` into the new top-level `formatters:` block (v2 separates linters and formatters). - Nest `linters-settings:` under `linters.settings:`. - Drop the v1-only `issues.exclude-use-default: false` (v2 default exclusion behavior is what we want). 2. Flutter 3.44 made ListTile-inside-ColoredBox a hard assertion (was a warning before). Both bottom sheets in track_actions/ set Container.color on the outer surface, which inserts a ColoredBox above their ListTiles. Wrap each ListTile in `Material(type: MaterialType.transparency)` so it has an ink target beneath the outer color paint without changing the visual surface: - track_actions_sheet.dart `_MenuItem.build` - add_to_playlist_sheet.dart inner ListTile 5 failing widget tests should pass with this change. Local task #70. Co-Authored-By: Claude Opus 4.7 (1M context) --- .golangci.yml | 31 ++++++++++--------- .../track_actions/add_to_playlist_sheet.dart | 28 ++++++++++------- .../track_actions/track_actions_sheet.dart | 15 ++++++--- 3 files changed, 44 insertions(+), 30 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f89576e3..962d9ed2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,28 +1,29 @@ +version: "2" + run: timeout: 5m tests: true linters: - disable-all: true + default: none enable: - errcheck - govet - ineffassign - staticcheck - unused + - revive + settings: + revive: + # Intentionally narrow: we skip `exported` (no doc-comment requirement) per + # the project's no-boilerplate-comment policy. Re-enable if the public API + # surface grows to the point where documentation lives alongside it. + rules: + - name: var-naming + - name: unused-parameter + - name: early-return + +formatters: + enable: - gofmt - goimports - - revive - -linters-settings: - revive: - # Intentionally narrow: we skip `exported` (no doc-comment requirement) per - # the project's no-boilerplate-comment policy. Re-enable if the public API - # surface grows to the point where documentation lives alongside it. - rules: - - name: var-naming - - name: unused-parameter - - name: early-return - -issues: - exclude-use-default: false diff --git a/flutter_client/lib/shared/widgets/track_actions/add_to_playlist_sheet.dart b/flutter_client/lib/shared/widgets/track_actions/add_to_playlist_sheet.dart index b3103420..d57c1a7c 100644 --- a/flutter_client/lib/shared/widgets/track_actions/add_to_playlist_sheet.dart +++ b/flutter_client/lib/shared/widgets/track_actions/add_to_playlist_sheet.dart @@ -69,18 +69,24 @@ class AddToPlaylistSheet extends ConsumerWidget { itemCount: owned.length, itemBuilder: (_, i) { final p = owned[i]; - return ListTile( - key: Key('add_to_playlist_${p.id}'), - leading: Icon(LucideIcons.list_music, color: fs.parchment), - title: Text( - p.name, - style: TextStyle(color: fs.parchment), + // Material(transparency) gives ListTile an ink target + // beneath the outer Container's color paint — required + // by the Flutter 3.44 ListTile/ColoredBox assertion. + return Material( + type: MaterialType.transparency, + child: ListTile( + key: Key('add_to_playlist_${p.id}'), + leading: Icon(LucideIcons.list_music, color: fs.parchment), + title: Text( + p.name, + style: TextStyle(color: fs.parchment), + ), + subtitle: Text( + '${p.trackCount} ${p.trackCount == 1 ? "track" : "tracks"}', + style: TextStyle(color: fs.ash, fontSize: 12), + ), + onTap: () => Navigator.pop(context, p.id), ), - subtitle: Text( - '${p.trackCount} ${p.trackCount == 1 ? "track" : "tracks"}', - style: TextStyle(color: fs.ash, fontSize: 12), - ), - onTap: () => Navigator.pop(context, p.id), ); }, ); diff --git a/flutter_client/lib/shared/widgets/track_actions/track_actions_sheet.dart b/flutter_client/lib/shared/widgets/track_actions/track_actions_sheet.dart index 4847784b..bf29f1a4 100644 --- a/flutter_client/lib/shared/widgets/track_actions/track_actions_sheet.dart +++ b/flutter_client/lib/shared/widgets/track_actions/track_actions_sheet.dart @@ -236,10 +236,17 @@ class _MenuItem extends StatelessWidget { @override Widget build(BuildContext context) { final fs = Theme.of(context).extension()!; - return ListTile( - leading: Icon(icon, color: fs.parchment), - title: Text(label, style: TextStyle(color: fs.parchment)), - onTap: onTap, + // Transparency-typed Material sits between the outer Container's color + // paint and the ListTile so ListTile can paint its own ink splashes. + // Flutter 3.44 promoted the "ListTile inside ColoredBox without Material" + // warning to a hard assertion. + return Material( + type: MaterialType.transparency, + child: ListTile( + leading: Icon(icon, color: fs.parchment), + title: Text(label, style: TextStyle(color: fs.parchment)), + onTap: onTap, + ), ); } }