From 7c694c2e2b0716f3fca44553b9cfa17b78703960 Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Tue, 8 Apr 2025 12:16:51 +0200 Subject: [PATCH 01/11] Update build.gradle.kts --- build.gradle.kts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 97e87cb..1a13ae4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ plugins { alias(libs.plugins.kotlin.jvm) alias(libs.plugins.ktor) + id("com.diffplug.spotless") version "7.0.3" } group = "com.es" @@ -33,3 +34,10 @@ dependencies { testImplementation(libs.ktor.server.test.host) testImplementation(libs.kotlin.test.junit) } + +spotless { + kotlin { + ktlint("3.1.1") + target("**/*.kt") + } +} From 2721747d43ba3c6c10af088a227016e267587a9d Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Tue, 8 Apr 2025 12:16:53 +0200 Subject: [PATCH 02/11] Create .editorconfig --- .editorconfig | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..dc0f536 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +[*.{kt,kts}] +indent_size = 4 +continuation_indent_size = 4 +insert_final_newline = true +max_line_length = 120 +disabled_rules = no-wildcard-imports,experimental:argument-list-wrapping From 19c3963aa176d5ab4aaa6c3c5b06beed38c51719 Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Thu, 10 Apr 2025 09:02:05 +0200 Subject: [PATCH 03/11] Update .editorconfig --- .editorconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index dc0f536..9813448 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,4 +3,3 @@ indent_size = 4 continuation_indent_size = 4 insert_final_newline = true max_line_length = 120 -disabled_rules = no-wildcard-imports,experimental:argument-list-wrapping From 178fa9e4ad096f881b8106b1ce936691cd1a2405 Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Thu, 10 Apr 2025 09:02:10 +0200 Subject: [PATCH 04/11] Update build.gradle.kts --- build.gradle.kts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 20769fd..1425809 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -37,7 +37,11 @@ dependencies { spotless { kotlin { - ktlint("3.1.1") + ktlint("1.2.1") target("**/*.kt") + suppressLintsFor { + step = "ktlint" + shortCode = "standard:no-wildcard-imports" + } } } From 714efc9cae1c306778fee54260cf255ce35c486b Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Thu, 10 Apr 2025 09:02:12 +0200 Subject: [PATCH 05/11] Update BGGPropertyValue.kt --- src/main/kotlin/model/BGGPropertyValue.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/model/BGGPropertyValue.kt b/src/main/kotlin/model/BGGPropertyValue.kt index 0338fa8..36220ca 100644 --- a/src/main/kotlin/model/BGGPropertyValue.kt +++ b/src/main/kotlin/model/BGGPropertyValue.kt @@ -6,5 +6,5 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty data class BGGPropertyValue( @JacksonXmlProperty(isAttribute = true) @JsonProperty("value") - val value: String? = null + val value: String? = null, ) From 4fc082072b56b455a97075e95617f13de4185814 Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Thu, 10 Apr 2025 09:02:16 +0200 Subject: [PATCH 06/11] Update BGGGameDetailItem.kt --- src/main/kotlin/model/detail/BGGGameDetailItem.kt | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/main/kotlin/model/detail/BGGGameDetailItem.kt b/src/main/kotlin/model/detail/BGGGameDetailItem.kt index 0160402..5716e74 100644 --- a/src/main/kotlin/model/detail/BGGGameDetailItem.kt +++ b/src/main/kotlin/model/detail/BGGGameDetailItem.kt @@ -1,7 +1,7 @@ package com.es.model.detail -import com.es.model.search.BGGGameItemName import com.es.model.BGGPropertyValue +import com.es.model.search.BGGGameItemName import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -12,63 +12,50 @@ data class BGGGameDetailItem( @JacksonXmlProperty(isAttribute = true) @JsonProperty("id") val id: String, - @JacksonXmlProperty(isAttribute = true) @JsonProperty("type") val type: String, - @JacksonXmlProperty(localName = "thumbnail") @JsonProperty("thumbnail") val thumbnail: String? = null, - @JacksonXmlProperty(localName = "image") @JsonProperty("image") val image: String? = null, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "name") @JsonProperty("names") val names: List? = null, - @JacksonXmlProperty(localName = "description") @JsonProperty("description") val description: String? = null, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "yearpublished") @JsonProperty("yearpublished") val yearPublished: BGGPropertyValue? = null, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "minplayers") @JsonProperty("minplayers") val minPlayers: BGGPropertyValue? = null, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "maxplayers") @JsonProperty("maxplayers") val maxPlayers: BGGPropertyValue? = null, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "playingtime") @JsonProperty("playingtime") val playingTime: BGGPropertyValue? = null, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "minplaytime") @JsonProperty("minplaytime") val minPlayTime: BGGPropertyValue? = null, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "maxplaytime") @JsonProperty("maxplaytime") val maxPlayTime: BGGPropertyValue? = null, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "minage") @JsonProperty("minage") val minAge: BGGPropertyValue? = null, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "link") @JsonProperty("links") From 6c65428b0704e2b62a9e08fd362e831d5fd68799 Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Thu, 10 Apr 2025 09:02:20 +0200 Subject: [PATCH 07/11] Update BGGGameDetailLink.kt --- src/main/kotlin/model/detail/BGGGameDetailLink.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/kotlin/model/detail/BGGGameDetailLink.kt b/src/main/kotlin/model/detail/BGGGameDetailLink.kt index 8c40981..76582b8 100644 --- a/src/main/kotlin/model/detail/BGGGameDetailLink.kt +++ b/src/main/kotlin/model/detail/BGGGameDetailLink.kt @@ -9,12 +9,10 @@ data class BGGGameDetailLink( @JacksonXmlProperty(isAttribute = true) @JsonProperty("type") val type: String? = null, - @JacksonXmlProperty(isAttribute = true) @JsonProperty("id") val id: String? = null, - @JacksonXmlProperty(isAttribute = true) @JsonProperty("value") - val value: String? = null + val value: String? = null, ) From b038e1c7c7034b867effb14c92bb45ab8cd3643f Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Thu, 10 Apr 2025 09:02:27 +0200 Subject: [PATCH 08/11] Update BGGGameItem.kt --- src/main/kotlin/model/search/BGGGameItem.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/model/search/BGGGameItem.kt b/src/main/kotlin/model/search/BGGGameItem.kt index 92dc442..86e827b 100644 --- a/src/main/kotlin/model/search/BGGGameItem.kt +++ b/src/main/kotlin/model/search/BGGGameItem.kt @@ -3,22 +3,20 @@ package com.es.model.search import com.es.model.BGGPropertyValue import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty @JsonIgnoreProperties(ignoreUnknown = true) data class BGGGameItem( @JacksonXmlProperty(isAttribute = true) @JsonProperty("id") val id: String, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "name") @JsonProperty("name") val name: BGGGameItemName? = null, - @JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlProperty(localName = "yearpublished") @JsonProperty("yearpublished") - val yearPublished: BGGPropertyValue? = null + val yearPublished: BGGPropertyValue? = null, ) From c74b3fe8dadfba4434f21ca73c74de5be9cbb29e Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Thu, 10 Apr 2025 09:02:30 +0200 Subject: [PATCH 09/11] Update BGGGameItemName.kt --- src/main/kotlin/model/search/BGGGameItemName.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/model/search/BGGGameItemName.kt b/src/main/kotlin/model/search/BGGGameItemName.kt index 6810b1e..9349f47 100644 --- a/src/main/kotlin/model/search/BGGGameItemName.kt +++ b/src/main/kotlin/model/search/BGGGameItemName.kt @@ -9,8 +9,7 @@ data class BGGGameItemName( @JacksonXmlProperty(isAttribute = true) @JsonProperty("type") val type: String? = null, - @JacksonXmlProperty(isAttribute = true) @JsonProperty("value") - val value: String? = null + val value: String? = null, ) From 9006a57fd3ea440721c2050c79252aed676e9a56 Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Thu, 10 Apr 2025 09:39:02 +0200 Subject: [PATCH 10/11] Update libs.versions.toml --- gradle/libs.versions.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 150258c..6d5796a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,6 +3,7 @@ kotlin-version = "2.1.20" ktor-version = "3.1.1" logback-version = "1.4.14" jackson-version = "2.15.0" +spotless-version = "7.0.3" [libraries] 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 [plugins] kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-version" } ktor = { id = "io.ktor.plugin", version.ref = "ktor-version" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless-version" } From cea38cd9039db91a185ef9011948d0f832c81ce3 Mon Sep 17 00:00:00 2001 From: Jesus Chaves <82162116+GachaDev@users.noreply.github.com> Date: Thu, 10 Apr 2025 09:39:06 +0200 Subject: [PATCH 11/11] Update build.gradle.kts --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1425809..324ec17 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,7 @@ plugins { alias(libs.plugins.kotlin.jvm) alias(libs.plugins.ktor) - id("com.diffplug.spotless") version "7.0.3" + alias(libs.plugins.spotless) } group = "com.es"