build: update build-time dependencies, address new warnings (#413)

* build: update build-time dependencies, address new warnings

* build: switch to central repo declaration, remove redundant repositories

* build: use spotless predeclaration, more task avoidance on kotlin modules
This commit is contained in:
zml 2022-12-08 20:40:52 -08:00 committed by Jason
parent 86b76b91c7
commit 59c5a8310c
33 changed files with 204 additions and 135 deletions

View file

@ -60,7 +60,7 @@ public fun interface SuspendingExecutionHandler<C : Any> {
*/
public fun asCommandExecutionHandler(
scope: CoroutineScope = GlobalScope,
context: CoroutineContext = EmptyCoroutineContext,
context: CoroutineContext = EmptyCoroutineContext
): CommandExecutionHandler<C> = createCommandExecutionHandler(scope, context, this)
public companion object {
@ -76,7 +76,7 @@ public fun interface SuspendingExecutionHandler<C : Any> {
public fun <C : Any> createCommandExecutionHandler(
scope: CoroutineScope = GlobalScope,
context: CoroutineContext = EmptyCoroutineContext,
handler: SuspendingExecutionHandler<C>,
handler: SuspendingExecutionHandler<C>
): CommandExecutionHandler<C> = CommandExecutionHandler.FutureCommandExecutionHandler { ctx ->
scope.future(context) {
handler(ctx)

View file

@ -43,5 +43,5 @@ import kotlin.coroutines.EmptyCoroutineContext
public fun <C : Any> Command.Builder<C>.suspendingHandler(
scope: CoroutineScope = GlobalScope,
context: CoroutineContext = EmptyCoroutineContext,
handler: SuspendingExecutionHandler<C>,
handler: SuspendingExecutionHandler<C>
): Command.Builder<C> = handler(SuspendingExecutionHandler.createCommandExecutionHandler(scope, context, handler))

View file

@ -43,7 +43,7 @@ import kotlin.coroutines.EmptyCoroutineContext
public fun <C : Any> MutableCommandBuilder<C>.suspendingHandler(
scope: CoroutineScope = GlobalScope,
context: CoroutineContext = EmptyCoroutineContext,
handler: SuspendingExecutionHandler<C>,
handler: SuspendingExecutionHandler<C>
): MutableCommandBuilder<C> = mutate {
it.suspendingHandler(scope, context, handler)
}

View file

@ -46,7 +46,7 @@ import kotlin.reflect.KClass
*/
public class MutableCommandBuilder<C : Any>(
commandBuilder: Command.Builder<C>,
private val commandManager: CommandManager<C>,
private val commandManager: CommandManager<C>
) {
/**
* The command builder that is being mutated by this [MutableCommandBuilder] instance.
@ -703,7 +703,7 @@ public class MutableCommandBuilder<C : Any>(
public fun flag(
name: String,
aliases: Array<String> = emptyArray(),
description: ArgumentDescription = ArgumentDescription.empty(),
description: ArgumentDescription = ArgumentDescription.empty()
): MutableCommandBuilder<C> = mutate {
it.flag(
this.commandManager

View file

@ -95,7 +95,7 @@ class CommandBuildingDSLTest {
"is",
"is this",
"is this going",
"is this going too_far",
"is this going too_far"
)
.sorted()
)