Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rx-coroutines interop lint message #315

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down