fix(ci): golangci-lint v2 schema + Flutter 3.44 ListTile strictness
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) <noreply@anthropic.com>
This commit is contained in:
+16
-15
@@ -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
|
||||
|
||||
@@ -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),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -236,10 +236,17 @@ class _MenuItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final fs = Theme.of(context).extension<FabledSwordTheme>()!;
|
||||
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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user