From 64beaefcd77e23f423a1b9437d5be4e7eb8e6cc6 Mon Sep 17 00:00:00 2001 From: Serge Chernetskiy Date: Tue, 1 Oct 2024 11:00:24 -0700 Subject: [PATCH] Update rx-coroutines interop lint message --- .../slack/lint/denylistedapis/DenyListedApiDetector.kt | 8 ++++---- .../lint/denylistedapis/DenyListedApiDetectorTest.kt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/slack-lint-checks/src/main/java/slack/lint/denylistedapis/DenyListedApiDetector.kt b/slack-lint-checks/src/main/java/slack/lint/denylistedapis/DenyListedApiDetector.kt index fb0c0ac1..e8385943 100644 --- a/slack-lint-checks/src/main/java/slack/lint/denylistedapis/DenyListedApiDetector.kt +++ b/slack-lint-checks/src/main/java/slack/lint/denylistedapis/DenyListedApiDetector.kt @@ -371,7 +371,7 @@ internal class DenyListedApiDetector : Detector(), SourceCodeScanner, XmlScanner className = "kotlinx.coroutines.rx3.RxCompletableKt", functionName = "rxCompletable", errorMessage = - "rxCompletable defaults to Dispatchers.Default, which will silently introduce multithreading. Provide an explicit dispatcher. Dispatchers.Unconfined is usually the best choice, as it behaves in an rx-y way.", + "rxCompletable defaults to Dispatchers.Default. Provide an explicit dispatcher which can be replaced with a test dispatcher to make your tests more deterministic.", parameters = listOf( "kotlin.coroutines.CoroutineContext", @@ -383,7 +383,7 @@ internal class DenyListedApiDetector : Detector(), SourceCodeScanner, XmlScanner className = "kotlinx.coroutines.rx3.RxMaybeKt", functionName = "rxMaybe", errorMessage = - "rxMaybe defaults to Dispatchers.Default, which will silently introduce multithreading. Provide an explicit dispatcher. Dispatchers.Unconfined is usually the best choice, as it behaves in an rx-y way.", + "rxMaybe defaults to Dispatchers.Default. Provide an explicit dispatcher which can be replaced with a test dispatcher to make your tests more deterministic.", parameters = listOf( "kotlin.coroutines.CoroutineContext", @@ -395,7 +395,7 @@ internal class DenyListedApiDetector : Detector(), SourceCodeScanner, XmlScanner className = "kotlinx.coroutines.rx3.RxSingleKt", functionName = "rxSingle", errorMessage = - "rxSingle defaults to Dispatchers.Default, which will silently introduce multithreading. Provide an explicit dispatcher. Dispatchers.Unconfined is usually the best choice, as it behaves in an rx-y way.", + "rxSingle defaults to Dispatchers.Default. Provide an explicit dispatcher which can be replaced with a test dispatcher to make your tests more deterministic.", parameters = listOf( "kotlin.coroutines.CoroutineContext", @@ -407,7 +407,7 @@ internal class DenyListedApiDetector : Detector(), SourceCodeScanner, XmlScanner className = "kotlinx.coroutines.rx3.RxObservableKt", functionName = "rxObservable", errorMessage = - "rxObservable defaults to Dispatchers.Default, which will silently introduce multithreading. Provide an explicit dispatcher. Dispatchers.Unconfined is usually the best choice, as it behaves in an rx-y way.", + "rxObservable defaults to Dispatchers.Default. Provide an explicit dispatcher which can be replaced with a test dispatcher to make your tests more deterministic.", parameters = listOf( "kotlin.coroutines.CoroutineContext", diff --git a/slack-lint-checks/src/test/java/slack/lint/denylistedapis/DenyListedApiDetectorTest.kt b/slack-lint-checks/src/test/java/slack/lint/denylistedapis/DenyListedApiDetectorTest.kt index b3f3bfa1..559aa7fc 100644 --- a/slack-lint-checks/src/test/java/slack/lint/denylistedapis/DenyListedApiDetectorTest.kt +++ b/slack-lint-checks/src/test/java/slack/lint/denylistedapis/DenyListedApiDetectorTest.kt @@ -446,7 +446,7 @@ class DenyListedApiDetectorTest : BaseSlackLintTest() { .run() .expect( """ - src/foo/SomeClass.kt:6: Error: rxCompletable defaults to Dispatchers.Default, which will silently introduce multithreading. Provide an explicit dispatcher. Dispatchers.Unconfined is usually the best choice, as it behaves in an rx-y way. [DenyListedApi] + src/foo/SomeClass.kt:6: Error: rxCompletable defaults to Dispatchers.Default. Provide an explicit dispatcher which can be replaced with a test dispatcher to make your tests more deterministic. [DenyListedApi] val now = rxCompletable {} ~~~~~~~~~~~~~ 1 errors, 0 warnings @@ -478,7 +478,7 @@ class DenyListedApiDetectorTest : BaseSlackLintTest() { .run() .expect( """ - src/foo/SomeClass.kt:6: Error: rxSingle defaults to Dispatchers.Default, which will silently introduce multithreading. Provide an explicit dispatcher. Dispatchers.Unconfined is usually the best choice, as it behaves in an rx-y way. [DenyListedApi] + src/foo/SomeClass.kt:6: Error: rxSingle defaults to Dispatchers.Default. Provide an explicit dispatcher which can be replaced with a test dispatcher to make your tests more deterministic. [DenyListedApi] val now = rxSingle { "a" } ~~~~~~~~ 1 errors, 0 warnings @@ -510,7 +510,7 @@ class DenyListedApiDetectorTest : BaseSlackLintTest() { .run() .expect( """ - src/foo/SomeClass.kt:6: Error: rxMaybe defaults to Dispatchers.Default, which will silently introduce multithreading. Provide an explicit dispatcher. Dispatchers.Unconfined is usually the best choice, as it behaves in an rx-y way. [DenyListedApi] + src/foo/SomeClass.kt:6: Error: rxMaybe defaults to Dispatchers.Default. Provide an explicit dispatcher which can be replaced with a test dispatcher to make your tests more deterministic. [DenyListedApi] val now = rxMaybe { "a" } ~~~~~~~ 1 errors, 0 warnings @@ -544,7 +544,7 @@ class DenyListedApiDetectorTest : BaseSlackLintTest() { .run() .expect( """ - src/foo/SomeClass.kt:6: Error: rxObservable defaults to Dispatchers.Default, which will silently introduce multithreading. Provide an explicit dispatcher. Dispatchers.Unconfined is usually the best choice, as it behaves in an rx-y way. [DenyListedApi] + src/foo/SomeClass.kt:6: Error: rxObservable defaults to Dispatchers.Default. Provide an explicit dispatcher which can be replaced with a test dispatcher to make your tests more deterministic. [DenyListedApi] val now = rxObservable { send("a") } ~~~~~~~~~~~~ 1 errors, 0 warnings