Skip to content

A fully functional Android app built entirely with Kotlin and Jetpack Compose

Ignore function naming check when annotated with @Test

lihenggui56fbe13b5abe
diff --git a/.editorconfig b/.editorconfig
index 2d5a46b3c..7be3f8784 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -4,4 +4,4 @@
[*.{kt,kts}]
ij_kotlin_allow_trailing_comma=true
ij_kotlin_allow_trailing_comma_on_call_site=true
-ktlint_function_naming_ignore_when_annotated_with=Composable
+ktlint_function_naming_ignore_when_annotated_with=Composable, Test
diff --git a/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt b/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt
index 08fed508c..4f1229e9d 100644
--- a/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt
+++ b/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt
@@ -24,7 +24,6 @@ import kotlin.test.assertEquals
class ResultKtTest {
- @Suppress("ktlint:standard:function-naming")
@Test
fun Result_catches_errors() = runTest {
flow {
diff --git a/core/datastore/src/test/kotlin/com/google/samples/apps/nowinandroid/core/datastore/IntToStringIdsMigrationTest.kt b/core/datastore/src/test/kotlin/com/google/samples/apps/nowinandroid/core/datastore/IntToStringIdsMigrationTest.kt
index 392ca2550..8b97cff34 100644
--- a/core/datastore/src/test/kotlin/com/google/samples/apps/nowinandroid/core/datastore/IntToStringIdsMigrationTest.kt
+++ b/core/datastore/src/test/kotlin/com/google/samples/apps/nowinandroid/core/datastore/IntToStringIdsMigrationTest.kt
@@ -27,7 +27,7 @@ import kotlin.test.assertTrue
class IntToStringIdsMigrationTest {
@Test
- fun intToStringIdsMigration_should_migrate_topic_ids() = runTest {
+ fun IntToStringIdsMigration_should_migrate_topic_ids() = runTest {
// Set up existing preferences with topic int ids
val preMigrationUserPreferences = userPreferences {
deprecatedIntFollowedTopicIds.addAll(listOf(1, 2, 3))
@@ -56,7 +56,7 @@ class IntToStringIdsMigrationTest {
}
@Test
- fun intToStringIdsMigration_should_migrate_author_ids() = runTest {
+ fun IntToStringIdsMigration_should_migrate_author_ids() = runTest {
// Set up existing preferences with author int ids
val preMigrationUserPreferences = userPreferences {
deprecatedIntFollowedAuthorIds.addAll(listOf(4, 5, 6))
diff --git a/core/datastore/src/test/kotlin/com/google/samples/apps/nowinandroid/core/datastore/ListToMapMigrationTest.kt b/core/datastore/src/test/kotlin/com/google/samples/apps/nowinandroid/core/datastore/ListToMapMigrationTest.kt
index 41404d6a9..f7e083b45 100644
--- a/core/datastore/src/test/kotlin/com/google/samples/apps/nowinandroid/core/datastore/ListToMapMigrationTest.kt
+++ b/core/datastore/src/test/kotlin/com/google/samples/apps/nowinandroid/core/datastore/ListToMapMigrationTest.kt
@@ -24,7 +24,7 @@ import kotlin.test.assertTrue
class ListToMapMigrationTest {
@Test
- fun listToMapMigration_should_migrate_topic_ids() = runTest {
+ fun ListToMapMigration_should_migrate_topic_ids() = runTest {
// Set up existing preferences with topic ids
val preMigrationUserPreferences = userPreferences {
deprecatedFollowedTopicIds.addAll(listOf("1", "2", "3"))
@@ -50,7 +50,7 @@ class ListToMapMigrationTest {
}
@Test
- fun listToMapMigration_should_migrate_author_ids() = runTest {
+ fun ListToMapMigration_should_migrate_author_ids() = runTest {
// Set up existing preferences with author ids
val preMigrationUserPreferences = userPreferences {
deprecatedFollowedAuthorIds.addAll(listOf("4", "5", "6"))
@@ -76,7 +76,7 @@ class ListToMapMigrationTest {
}
@Test
- fun listToMapMigration_should_migrate_bookmarks() = runTest {
+ fun ListToMapMigration_should_migrate_bookmarks() = runTest {
// Set up existing preferences with bookmarks
val preMigrationUserPreferences = userPreferences {
deprecatedBookmarkedNewsResourceIds.addAll(listOf("7", "8", "9"))
diff --git a/core/designsystem/src/test/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/TagScreenshotTests.kt b/core/designsystem/src/test/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/TagScreenshotTests.kt
index 16ed71aeb..d9edfd6c6 100644
--- a/core/designsystem/src/test/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/TagScreenshotTests.kt
+++ b/core/designsystem/src/test/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/TagScreenshotTests.kt
@@ -47,7 +47,7 @@ class TagScreenshotTests() {
val composeTestRule = createAndroidComposeRule<ComponentActivity>()
@Test
- fun tag_multipleThemes() {
+ fun Tag_multipleThemes() {
composeTestRule.captureMultiTheme("Tag") {
NiaTopicTag(followed = true, onClick = {}) {
Text("TOPIC")