Skip to content

Commit

Permalink
Fix code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenschenk authored and stevenschenk committed May 19, 2023
1 parent 21a7b2e commit 2d5230e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.rabobank.ret.plugins

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import io.rabobank.ret.config.Environment
import io.rabobank.ret.context.ExecutionContext
import io.rabobank.ret.plugin.Plugin
Expand All @@ -13,7 +14,7 @@ import picocli.CommandLine.Command
import java.nio.file.Path

class PluginLoaderTest {
private val objectMapper = ObjectMapper().registerModule(KotlinModule.Builder().build())
private val objectMapper = jacksonObjectMapper()
private val commandLine = CommandLine(EmptyCommand())

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import java.nio.file.Path
@RegisterForReflection
data class Plugin(
val pluginDefinition: PluginDefinition,
val pluginLocation: Path
val pluginLocation: Path,
)

@RegisterForReflection
data class PluginDefinition(
val libName: String,
val commands: List<PluginCommand>,
val customZshAutocompletion: String?
val customZshAutocompletion: String?,
)

@RegisterForReflection
Expand All @@ -23,7 +23,7 @@ data class PluginCommand(
val options: List<Option>,
val subcommands: List<PluginCommand>,
val description: String? = null,
val hidden: Boolean = false
val hidden: Boolean = false,
)

@RegisterForReflection
Expand Down
12 changes: 5 additions & 7 deletions ret-plugin/src/main/kotlin/io/rabobank/ret/IntrospectionUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import picocli.CommandLine.Model.CommandSpec

object IntrospectionUtil {

fun introspect(commandSpec: CommandSpec, pluginName: String): PluginDefinition {
return PluginDefinition(
pluginName,
listOf(generateCommand(commandSpec)),
loadCustomZshAutocompletion()
)
}
fun introspect(commandSpec: CommandSpec, pluginName: String) = PluginDefinition(
pluginName,
listOf(generateCommand(commandSpec)),
loadCustomZshAutocompletion()
)

private fun loadCustomZshAutocompletion(): String? =
javaClass.getResourceAsStream("/autocompletion/zsh/completions.zsh")
Expand Down

0 comments on commit 2d5230e

Please sign in to comment.