From 0b68fa97afacca47e0b8cb1e96c6ca40aae85009 Mon Sep 17 00:00:00 2001 From: Luca Tassinari Date: Sun, 3 Mar 2024 17:18:01 +0100 Subject: [PATCH] chore: suppressions --- .../analyzer/lib/GitHubAnalyzerByFlows.kt | 2 ++ commons/src/main/kotlin/FlowTests.kt | 27 ------------------- settings.gradle.kts | 2 +- 3 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 commons/src/main/kotlin/FlowTests.kt diff --git a/analyzer-direct-kt/src/main/kotlin/io/github/tassiLuca/analyzer/lib/GitHubAnalyzerByFlows.kt b/analyzer-direct-kt/src/main/kotlin/io/github/tassiLuca/analyzer/lib/GitHubAnalyzerByFlows.kt index cc8b4c00..ed8baec7 100644 --- a/analyzer-direct-kt/src/main/kotlin/io/github/tassiLuca/analyzer/lib/GitHubAnalyzerByFlows.kt +++ b/analyzer-direct-kt/src/main/kotlin/io/github/tassiLuca/analyzer/lib/GitHubAnalyzerByFlows.kt @@ -14,6 +14,7 @@ import kotlinx.coroutines.launch internal class GitHubAnalyzerByFlows(private val provider: GitHubRepositoryProvider) : Analyzer { @OptIn(ExperimentalCoroutinesApi::class) + @Suppress("InjectDispatcher") override suspend fun analyze( organizationName: String, updateResults: suspend (RepositoryReport) -> Unit, @@ -31,6 +32,7 @@ internal class GitHubAnalyzerByFlows(private val provider: GitHubRepositoryProvi } } + @Suppress("InjectDispatcher") private fun analyzeAll(repositories: List): Flow = channelFlow { repositories.forEach { repository -> launch { diff --git a/commons/src/main/kotlin/FlowTests.kt b/commons/src/main/kotlin/FlowTests.kt deleted file mode 100644 index 1dc7c0de..00000000 --- a/commons/src/main/kotlin/FlowTests.kt +++ /dev/null @@ -1,27 +0,0 @@ -import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.flow -import kotlinx.coroutines.launch -import kotlinx.coroutines.runBlocking - -fun simple(): Flow = flow { - for (i in 1..3) { - delay(500) - println("Emitting $i") - emit(i) - } -} - -fun main(): Unit = runBlocking { - println("Calling simple function...") - val flow = simple() - - launch { - println("Calling collect...") - flow.collect { value -> println(value) } - } - launch { - println("Calling collect again...") - flow.collect { value -> println(value) } - } -} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index ca489a27..21a6be99 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,7 +9,7 @@ gitHooks { commitMsg { conventionalCommits() } - createHooks() + createHooks(overwriteExisting = true) } rootProject.name = "direct-style-experiments"