Skip to content

Commit

Permalink
fix(analyzerkt): fix warning checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tassiluca committed Feb 22, 2024
1 parent 83d5c07 commit 5aa4e7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ class GitHubRepositoryProvider(private val gitHubService: GitHubService) {
suspend fun repositoriesOf(organizationName: String): Result<List<Repository>> =
paginatedRequest { gitHubService.organizationRepositories(organizationName, it).awaitResponse() }

@Suppress("SuspendFunWithFlowReturnType")
/** Returns the repositories of the given [organizationName] as [Flow]. */
suspend fun flowingRepositoriesOf(organizationName: String): Flow<List<Repository>> =
fun flowingRepositoriesOf(organizationName: String): Flow<List<Repository>> =
paginatedFlowRequest { gitHubService.organizationRepositories(organizationName, it).awaitResponse() }

/** Returns the contributors of the given [organizationName] and [repositoryName]. */
suspend fun contributorsOf(organizationName: String, repositoryName: String): Result<List<Contribution>> =
paginatedRequest { gitHubService.contributorsOf(organizationName, repositoryName, it).awaitResponse() }

@Suppress("SuspendFunWithFlowReturnType")
/** Returns the contributors of the given [organizationName] and [repositoryName] as [Flow]. */
suspend fun flowingContributorsOf(organizationName: String, repositoryName: String): Flow<List<Contribution>> =
fun flowingContributorsOf(organizationName: String, repositoryName: String): Flow<List<Contribution>> =
paginatedFlowRequest { gitHubService.contributorsOf(organizationName, repositoryName, it).awaitResponse() }

/** Returns the last release of the given [organizationName] and [repositoryName]. */
Expand Down Expand Up @@ -54,8 +52,7 @@ class GitHubRepositoryProvider(private val gitHubService: GitHubService) {
return withPagination(emptyList(), 1)
}

@Suppress("SuspendFunWithFlowReturnType")
private suspend fun <T> paginatedFlowRequest(requestCall: suspend (Int) -> Response<List<T>>): Flow<List<T>> {
private fun <T> paginatedFlowRequest(requestCall: suspend (Int) -> Response<List<T>>): Flow<List<T>> {
suspend fun FlowCollector<List<T>>.withPagination(next: Int?) {
return when (next) {
null -> {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ class ThermostatHubManagerTest extends AnyFlatSpec with Matchers {
override def on(using Async): Unit = ???
override def off(using Async): Unit = ???

override val dashboard: Dashboard = new Dashboard:
override def updateTemperature(entries: Seq[TemperatureEntry]): Unit = ???
override def newHeaterState(state: HeaterState): Unit = ???

override def newAlert(msg: String): Unit = ???

override val alertSystem: AlertSystem = new AlertSystem:
override def notify(message: String)(using Async): Unit = ???

Expand Down

0 comments on commit 5aa4e7a

Please sign in to comment.