fix(backend): Format

This commit is contained in:
2026-02-16 19:30:49 +01:00
parent 987f4efffe
commit fed3a2e574
4 changed files with 25 additions and 19 deletions

View File

@@ -23,7 +23,6 @@ class InitialApplicationFormSeeder(
private val versionService: ApplicationFormVersionService,
private val splitYamlLoader: SplitYamlLoader,
) : ApplicationRunner {
override fun run(args: ApplicationArguments) {
seedInitialFormIfMissing()
}

View File

@@ -20,7 +20,6 @@ class InitialApplicationFormTemplateSeeder(
private val userRepository: UserRepository,
private val splitYamlLoader: SplitYamlLoader,
) : ApplicationRunner {
override fun run(args: ApplicationArguments) {
seedInitialTemplateIfMissing()
}

View File

@@ -40,7 +40,10 @@ class SplitYamlLoader {
return processIncludes(mainContent, baseDir)
}
private fun processIncludes(content: String, baseDir: String): String {
private fun processIncludes(
content: String,
baseDir: String,
): String {
val result = StringBuilder()
content.lines().forEach { line ->
@@ -61,9 +64,13 @@ class SplitYamlLoader {
return result.toString()
}
private fun indentContent(content: String, indent: String): String {
private fun indentContent(
content: String,
indent: String,
): String {
val lines = content.lines()
return lines.mapIndexed { index, line ->
return lines
.mapIndexed { index, line ->
when {
index == 0 -> "- $line" // First line gets the list marker
line.isBlank() -> line

View File

@@ -4,12 +4,12 @@ import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertDoesNotThrow
class SplitYamlLoaderTest {
@Test
fun `loads template form from split files`() {
val loader = SplitYamlLoader()
val form = assertDoesNotThrow {
val form =
assertDoesNotThrow {
loader.loadApplicationForm("seed/template/_main.yaml")
}
@@ -23,7 +23,8 @@ class SplitYamlLoaderTest {
fun `loads demo form from split files`() {
val loader = SplitYamlLoader()
val form = assertDoesNotThrow {
val form =
assertDoesNotThrow {
loader.loadApplicationForm("seed/demo/_main.yaml")
}