Skip to content

Commit

Permalink
chore(spotless): use ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
powercasgamer committed Nov 11, 2023
1 parent 102ede2 commit 2e25971
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ spotless {
}
kotlinGradle {
applyCommon()
ktlint("0.50.0")
}
kotlin {
applyCommon()
ktlint("0.50.0")
}
}

Expand All @@ -76,7 +78,6 @@ indraSpotlessLicenser {
property("year", year)
property("description", project.description ?: "A template project")
property("author", providers.gradleProperty("projectAuthor").getOrElse("template"))

}

application {
Expand Down
23 changes: 14 additions & 9 deletions app/src/main/kotlin/dev/mizule/imagery/app/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class App {
ctx.method(),
ctx.ip(),
ctx.port(),
ctx.fullUrl()
)
ctx.fullUrl(),
),
)
}
javalin.post("/upload") { ctx ->
Expand All @@ -142,7 +142,7 @@ class App {
System.currentTimeMillis(),
file.filename(),
file.extension(),
MimeTypes.getDefaultMimeByExtension(file.extension())
MimeTypes.getDefaultMimeByExtension(file.extension()),
)
dataConfig.node(uploadedFile.id).set(uploadedFile)
try {
Expand All @@ -151,12 +151,17 @@ class App {
throw RuntimeException(e)
}
cache.put(fileName, Pair(uploadedFile, filePath))
ctx.json(JsonObject().apply {
add("data", JsonObject().apply {
addProperty("url", "https://i.mizule.dev/$fileName")
addProperty("delete", "https://i.mizule.dev/$fileName/del")
})
})
ctx.json(
JsonObject().apply {
add(
"data",
JsonObject().apply {
addProperty("url", "https://i.mizule.dev/$fileName")
addProperty("delete", "https://i.mizule.dev/$fileName/del")
},
)
},
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ data class Config(
val port: Int = 8052,

@Comment("The domain that this will be on")
val domain: String = "https://example.com"
val domain: String = "https://example.com",
)
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* SOFTWARE.
*/
@file:JvmName("Launcher")

package dev.mizule.imagery.app.launcher

import dev.mizule.imagery.app.App
Expand All @@ -33,7 +34,9 @@ fun main() {
app.load()
app.enable()

Runtime.getRuntime().addShutdownHook(Thread {
app.disable()
})
Runtime.getRuntime().addShutdownHook(
Thread {
app.disable()
},
)
}

0 comments on commit 2e25971

Please sign in to comment.