Skip to content

Commit 0cd4254

Browse files
authored
Merge pull request #15 from xebia-functional/14-insert-spotless-plugin
Insert spotless plugin
2 parents 3d570ba + cea38cd commit 0cd4254

File tree

8 files changed

+25
-24
lines changed

8 files changed

+25
-24
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.{kt,kts}]
2+
indent_size = 4
3+
continuation_indent_size = 4
4+
insert_final_newline = true
5+
max_line_length = 120

build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
plugins {
33
alias(libs.plugins.kotlin.jvm)
44
alias(libs.plugins.ktor)
5+
alias(libs.plugins.spotless)
56
}
67

78
group = "com.es"
@@ -33,3 +34,14 @@ dependencies {
3334
testImplementation(libs.ktor.server.test.host)
3435
testImplementation(libs.kotlin.test.junit)
3536
}
37+
38+
spotless {
39+
kotlin {
40+
ktlint("1.2.1")
41+
target("**/*.kt")
42+
suppressLintsFor {
43+
step = "ktlint"
44+
shortCode = "standard:no-wildcard-imports"
45+
}
46+
}
47+
}

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ kotlin-version = "2.1.20"
33
ktor-version = "3.1.1"
44
logback-version = "1.4.14"
55
jackson-version = "2.15.0"
6+
spotless-version = "7.0.3"
67

78
[libraries]
89
ktor-server-content-negotiation = { module = "io.ktor:ktor-server-content-negotiation", version.ref = "ktor-version" }
@@ -22,3 +23,4 @@ jackson-dataformat-xml = { module = "com.fasterxml.jackson.dataformat:jackson-da
2223
[plugins]
2324
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-version" }
2425
ktor = { id = "io.ktor.plugin", version.ref = "ktor-version" }
26+
spotless = { id = "com.diffplug.spotless", version.ref = "spotless-version" }

src/main/kotlin/model/BGGPropertyValue.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
66
data class BGGPropertyValue(
77
@JacksonXmlProperty(isAttribute = true)
88
@JsonProperty("value")
9-
val value: String? = null
9+
val value: String? = null,
1010
)

src/main/kotlin/model/detail/BGGGameDetailItem.kt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.es.model.detail
22

3-
import com.es.model.search.BGGGameItemName
43
import com.es.model.BGGPropertyValue
4+
import com.es.model.search.BGGGameItemName
55
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
66
import com.fasterxml.jackson.annotation.JsonProperty
77
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper
@@ -12,63 +12,50 @@ data class BGGGameDetailItem(
1212
@JacksonXmlProperty(isAttribute = true)
1313
@JsonProperty("id")
1414
val id: String,
15-
1615
@JacksonXmlProperty(isAttribute = true)
1716
@JsonProperty("type")
1817
val type: String,
19-
2018
@JacksonXmlProperty(localName = "thumbnail")
2119
@JsonProperty("thumbnail")
2220
val thumbnail: String? = null,
23-
2421
@JacksonXmlProperty(localName = "image")
2522
@JsonProperty("image")
2623
val image: String? = null,
27-
2824
@JacksonXmlElementWrapper(useWrapping = false)
2925
@JacksonXmlProperty(localName = "name")
3026
@JsonProperty("names")
3127
val names: List<BGGGameItemName>? = null,
32-
3328
@JacksonXmlProperty(localName = "description")
3429
@JsonProperty("description")
3530
val description: String? = null,
36-
3731
@JacksonXmlElementWrapper(useWrapping = false)
3832
@JacksonXmlProperty(localName = "yearpublished")
3933
@JsonProperty("yearpublished")
4034
val yearPublished: BGGPropertyValue? = null,
41-
4235
@JacksonXmlElementWrapper(useWrapping = false)
4336
@JacksonXmlProperty(localName = "minplayers")
4437
@JsonProperty("minplayers")
4538
val minPlayers: BGGPropertyValue? = null,
46-
4739
@JacksonXmlElementWrapper(useWrapping = false)
4840
@JacksonXmlProperty(localName = "maxplayers")
4941
@JsonProperty("maxplayers")
5042
val maxPlayers: BGGPropertyValue? = null,
51-
5243
@JacksonXmlElementWrapper(useWrapping = false)
5344
@JacksonXmlProperty(localName = "playingtime")
5445
@JsonProperty("playingtime")
5546
val playingTime: BGGPropertyValue? = null,
56-
5747
@JacksonXmlElementWrapper(useWrapping = false)
5848
@JacksonXmlProperty(localName = "minplaytime")
5949
@JsonProperty("minplaytime")
6050
val minPlayTime: BGGPropertyValue? = null,
61-
6251
@JacksonXmlElementWrapper(useWrapping = false)
6352
@JacksonXmlProperty(localName = "maxplaytime")
6453
@JsonProperty("maxplaytime")
6554
val maxPlayTime: BGGPropertyValue? = null,
66-
6755
@JacksonXmlElementWrapper(useWrapping = false)
6856
@JacksonXmlProperty(localName = "minage")
6957
@JsonProperty("minage")
7058
val minAge: BGGPropertyValue? = null,
71-
7259
@JacksonXmlElementWrapper(useWrapping = false)
7360
@JacksonXmlProperty(localName = "link")
7461
@JsonProperty("links")

src/main/kotlin/model/detail/BGGGameDetailLink.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ data class BGGGameDetailLink(
99
@JacksonXmlProperty(isAttribute = true)
1010
@JsonProperty("type")
1111
val type: String? = null,
12-
1312
@JacksonXmlProperty(isAttribute = true)
1413
@JsonProperty("id")
1514
val id: String? = null,
16-
1715
@JacksonXmlProperty(isAttribute = true)
1816
@JsonProperty("value")
19-
val value: String? = null
17+
val value: String? = null,
2018
)

src/main/kotlin/model/search/BGGGameItem.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,20 @@ package com.es.model.search
33
import com.es.model.BGGPropertyValue
44
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
55
import com.fasterxml.jackson.annotation.JsonProperty
6-
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
76
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper
7+
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
88

99
@JsonIgnoreProperties(ignoreUnknown = true)
1010
data class BGGGameItem(
1111
@JacksonXmlProperty(isAttribute = true)
1212
@JsonProperty("id")
1313
val id: String,
14-
1514
@JacksonXmlElementWrapper(useWrapping = false)
1615
@JacksonXmlProperty(localName = "name")
1716
@JsonProperty("name")
1817
val name: BGGGameItemName? = null,
19-
2018
@JacksonXmlElementWrapper(useWrapping = false)
2119
@JacksonXmlProperty(localName = "yearpublished")
2220
@JsonProperty("yearpublished")
23-
val yearPublished: BGGPropertyValue? = null
21+
val yearPublished: BGGPropertyValue? = null,
2422
)

src/main/kotlin/model/search/BGGGameItemName.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ data class BGGGameItemName(
99
@JacksonXmlProperty(isAttribute = true)
1010
@JsonProperty("type")
1111
val type: String? = null,
12-
1312
@JacksonXmlProperty(isAttribute = true)
1413
@JsonProperty("value")
15-
val value: String? = null
14+
val value: String? = null,
1615
)

0 commit comments

Comments
 (0)