library/widgets: fix all lint findings
- Commit
6896b98fc327ffe80ea2e44b3c28c4b105f32793- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-17 04:48 UTC (19 days ago)
- Parents
e0c57d6
Baseline: 3 warnings. ComposableNaming in WidgetsGlanceTest: test-only composable helpers contentForTest/fallbackForTest/ previewForTest renamed ContentForTest/FallbackForTest/ PreviewForTest with call sites updated. Verification: :library:widgets:lint -- 0 errors, 0 warnings, 0 hints. :library:widgets:testDebugUnitTest -- WidgetsGlanceTest 5/5 green; WidgetsTest classMethod fails pre-existing in this environment (Robolectric android-all-instrumented SDK 35 jar 404s on the Maven mirror, unrelated to this change).
Diff
library/widgets/src/test/java/com/vayunmathur/library/widgets/WidgetsGlanceTest.kt
diff --git a/library/widgets/src/test/java/com/vayunmathur/library/widgets/WidgetsGlanceTest.kt b/library/widgets/src/test/java/com/vayunmathur/library/widgets/WidgetsGlanceTest.ktindex 8d4950ac55..4fe745f352 100644--- a/library/widgets/src/test/java/com/vayunmathur/library/widgets/WidgetsGlanceTest.kt+++ b/library/widgets/src/test/java/com/vayunmathur/library/widgets/WidgetsGlanceTest.kt@@ -21,10 +21,10 @@ class ComposingWidget : MaWidget<String>() { override suspend fun loadData(context: Context, id: GlanceId): String = "loaded-data" override fun previewData(context: Context): String = "preview-data" @Composable override fun Content(data: String) { Text(data) }- @Composable fun contentForTest(data: String) = Content(data)+ @Composable fun ContentForTest(data: String) = Content(data) suspend fun loadForTest(c: Context, id: GlanceId) = loadData(c, id)- @Composable fun fallbackForTest() = FallbackContent()- @Composable fun previewForTest() = PreviewContent()+ @Composable fun FallbackForTest() = FallbackContent()+ @Composable fun PreviewForTest() = PreviewContent() } @RunWith(RobolectricTestRunner::class)@@ -35,17 +35,17 @@ class WidgetsGlanceTest { @Test fun contentComposesLoadedDataText() = runGlanceAppWidgetUnitTest { setContext(context) setAppWidgetSize(DpSize(200.dp, 100.dp))- provideComposable { widget.contentForTest("loaded-data") }+ provideComposable { widget.ContentForTest("loaded-data") } onNode(hasText("loaded-data")).assertExists() } @Test fun fallbackComposesDash() = runGlanceAppWidgetUnitTest { setContext(context)- provideComposable { widget.fallbackForTest() }+ provideComposable { widget.FallbackForTest() } onNode(hasText("—")).assertExists() } @Test fun previewComposesPreviewData() = runGlanceAppWidgetUnitTest { setContext(context)- provideComposable { widget.previewForTest() }+ provideComposable { widget.PreviewForTest() } onNode(hasText("preview-data")).assertExists() } @Test fun dynamicThemeGlanceComposes() = runGlanceAppWidgetUnitTest {