Skip to content

Commit 11d6bf4

Browse files
committed
lintfix
1 parent e5b1131 commit 11d6bf4

File tree

4 files changed

+25
-7
lines changed
  • tiny-annotation-processors/tiny-api-to-json-generator/src/jvmMain/kotlin/com/github/minigdx/tiny/doc
  • tiny-cli/src/main/kotlin/com/github/minigdx/tiny/cli/command
  • tiny-engine/src/commonMain/kotlin/com/github/minigdx/tiny/sound

4 files changed

+25
-7
lines changed

tiny-annotation-processors/tiny-api-to-json-generator/src/jvmMain/kotlin/com/github/minigdx/tiny/doc/JsonDsl.kt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,26 @@ private fun escapeJson(value: String): String {
4242
class JsonObject {
4343
private val entries = mutableListOf<JsonEntry>()
4444

45-
fun value(name: String, value: String?) {
45+
fun value(
46+
name: String,
47+
value: String?,
48+
) {
4649
entries.add(JsonValueEntry(name, value))
4750
}
4851

49-
fun obj(name: String, block: JsonObject.() -> Unit) {
52+
fun obj(
53+
name: String,
54+
block: JsonObject.() -> Unit,
55+
) {
5056
val child = JsonObject()
5157
child.block()
5258
entries.add(JsonObjectEntry(name, child))
5359
}
5460

55-
fun array(name: String, block: JsonArray.() -> Unit) {
61+
fun array(
62+
name: String,
63+
block: JsonArray.() -> Unit,
64+
) {
5665
val child = JsonArray()
5766
child.block()
5867
entries.add(JsonArrayEntry(name, child))

tiny-cli/src/main/kotlin/com/github/minigdx/tiny/cli/command/AddCommand.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class AddCommand : CliktCommand(name = "add") {
129129
): GameParameters {
130130
val ttfFile = gameDirectory.resolve(resource)
131131
val fontName = this.fontName!!.ifEmpty { FontAnalyzer.deriveFontName(resource) }
132-
val pngName = "${fontName}.png"
132+
val pngName = "$fontName.png"
133133
val pngFile = gameDirectory.resolve(pngName)
134134

135135
val effectiveChars = chars ?: TtfConverter.DEFAULT_CHARS

tiny-cli/src/main/kotlin/com/github/minigdx/tiny/cli/command/utils/TtfConverter.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ object TtfConverter {
8888
)
8989
}
9090

91-
private fun fitFontToHeight(baseFont: Font, targetHeight: Int): Font {
91+
private fun fitFontToHeight(
92+
baseFont: Font,
93+
targetHeight: Int,
94+
): Font {
9295
// Start from target height as point size and adjust
9396
var fontSize = targetHeight.toFloat()
9497
var font = baseFont.deriveFont(fontSize)
@@ -119,7 +122,10 @@ object TtfConverter {
119122
return bestFont
120123
}
121124

122-
private fun measureCharacters(font: Font, chars: String): CharMetrics {
125+
private fun measureCharacters(
126+
font: Font,
127+
chars: String,
128+
): CharMetrics {
123129
val image = BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB)
124130
val g2d = image.createGraphics()
125131
g2d.font = font

tiny-engine/src/commonMain/kotlin/com/github/minigdx/tiny/sound/MusicGenerator.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ object MusicGenerator {
123123
* using the shortest path in a circular scale of [scaleSize] notes.
124124
* Returns 0 if already at root.
125125
*/
126-
private fun stepTowardRoot(pos: Int, scaleSize: Int): Int {
126+
private fun stepTowardRoot(
127+
pos: Int,
128+
scaleSize: Int,
129+
): Int {
127130
if (pos == 0) return 0
128131
return if (pos <= scaleSize / 2) -1 else 1
129132
}

0 commit comments

Comments
 (0)