Skip to content

Commit be1cda9

Browse files
fix(deps): update dependency org.jmailen.gradle:kotlinter-gradle to v5.3.0 (#2136)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [org.jmailen.gradle:kotlinter-gradle](https://redirect.github.com/jeremymailen/kotlinter-gradle) | `5.2.0` -> `5.3.0` | ![age](https://developer.mend.io/api/mc/badges/age/maven/org.jmailen.gradle:kotlinter-gradle/5.3.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.jmailen.gradle:kotlinter-gradle/5.2.0/5.3.0?slim=true) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>jeremymailen/kotlinter-gradle (org.jmailen.gradle:kotlinter-gradle)</summary> ### [`v5.3.0`](https://redirect.github.com/jeremymailen/kotlinter-gradle/releases/tag/5.3.0) [Compare Source](https://redirect.github.com/jeremymailen/kotlinter-gradle/compare/5.2.0...5.3.0) #### What's Changed - Bump org.jmailen.kotlinter from 5.1.1 to 5.2.0 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;475](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/475) - Bump com.android.tools.build:gradle from 7.4.2 to 8.12.0 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;477](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/477) - Bump actions/checkout from 4 to 5 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;478](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/478) - Bump com.android.tools.build:gradle from 8.12.0 to 8.12.1 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;481](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/481) - Bump org.jetbrains.kotlin.jvm from 2.2.0 to 2.2.10 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;480](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/480) - Bump actions/setup-java from 4 to 5 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;482](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/482) - Updated Readme and test for excluding source files by [@&#8203;jeremymailen](https://redirect.github.com/jeremymailen) in [#&#8203;483](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/483) - Bump com.android.tools.build:gradle from 8.12.1 to 8.13.0 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;485](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/485) - Bump com.gradle.plugin-publish from 1.3.1 to 2.0.0 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;484](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/484) - Bump org.jetbrains.kotlin.jvm from 2.2.10 to 2.2.20 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;486](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/486) - Bump gradle/actions from 4 to 5 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;490](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/490) - Bump org.mockito.kotlin:mockito-kotlin from 6.0.0 to 6.1.0 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;489](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/489) - Bump actions/upload-artifact from 4 to 5 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;493](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/493) - Bump org.jetbrains.kotlin.jvm from 2.2.20 to 2.2.21 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;494](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/494) - Bump commons-io:commons-io from 2.20.0 to 2.21.0 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;496](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/496) - Bump com.android.tools.build:gradle from 8.13.0 to 8.13.1 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;497](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/497) - Upgrade ktlint to 1.8.0 by [@&#8203;jeremymailen](https://redirect.github.com/jeremymailen) in [#&#8203;498](https://redirect.github.com/jeremymailen/kotlinter-gradle/pull/498) **Full Changelog**: <jeremymailen/kotlinter-gradle@5.2.0...5.3.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/typesafegithub/github-workflows-kt). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQyLjU0LjIiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Piotr Krzeminski <[email protected]>
1 parent 11aef75 commit be1cda9

File tree

8 files changed

+183
-49
lines changed

8 files changed

+183
-49
lines changed

action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/typing/TypesProviding.kt

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,18 @@ private suspend fun ActionCoords.fetchTypingMetadata(
6868
logger.info { " ... types from action $url" }
6969
val response = httpClient.get(url)
7070
when (response.status) {
71-
HttpStatusCode.OK -> response.bodyAsText()
71+
HttpStatusCode.OK -> {
72+
response.bodyAsText()
73+
}
74+
7275
HttpStatusCode.NotFound -> {
7376
logger.info { " ... types from action were not found: $url" }
7477
null
7578
}
76-
else -> throw IOException("Failed fetching from $url")
79+
80+
else -> {
81+
throw IOException("Failed fetching from $url")
82+
}
7783
}
7884
} ?: return null
7985

@@ -124,12 +130,18 @@ private suspend fun fetchTypingsFromUrl(
124130
val response = httpClient.get(url)
125131
val typesMetadataYml =
126132
when (response.status) {
127-
HttpStatusCode.OK -> response.bodyAsText()
133+
HttpStatusCode.OK -> {
134+
response.bodyAsText()
135+
}
136+
128137
HttpStatusCode.NotFound -> {
129138
logger.info { " ... types from catalog were not found: $url" }
130139
return null
131140
}
132-
else -> throw IOException("Failed fetching from $url")
141+
142+
else -> {
143+
throw IOException("Failed fetching from $url")
144+
}
133145
}
134146
return yaml.decodeFromStringOrDefaultIfEmpty(typesMetadataYml, ActionTypes())
135147
}
@@ -143,8 +155,14 @@ private fun ActionCoords.toMajorVersion(): ActionCoords = this.copy(version = th
143155

144156
private fun ActionType.toTyping(fieldName: String): Typing =
145157
when (this.type) {
146-
ActionTypeEnum.String -> StringTyping
147-
ActionTypeEnum.Boolean -> BooleanTyping
158+
ActionTypeEnum.String -> {
159+
StringTyping
160+
}
161+
162+
ActionTypeEnum.Boolean -> {
163+
BooleanTyping
164+
}
165+
148166
ActionTypeEnum.Integer -> {
149167
if (this.namedValues.isEmpty()) {
150168
IntegerTyping
@@ -155,17 +173,24 @@ private fun ActionType.toTyping(fieldName: String): Typing =
155173
)
156174
}
157175
}
158-
ActionTypeEnum.Float -> FloatTyping
159-
ActionTypeEnum.List ->
176+
177+
ActionTypeEnum.Float -> {
178+
FloatTyping
179+
}
180+
181+
ActionTypeEnum.List -> {
160182
ListOfTypings(
161183
delimiter = separator,
162184
typing = listItem?.toTyping(fieldName) ?: error("Lists should have list-item set!"),
163185
)
164-
ActionTypeEnum.Enum ->
186+
}
187+
188+
ActionTypeEnum.Enum -> {
165189
EnumTyping(
166190
items = allowedValues,
167191
typeName = name?.toPascalCase() ?: fieldName.toPascalCase(),
168192
)
193+
}
169194
}
170195

171196
private inline fun <reified T> Yaml.decodeFromStringOrDefaultIfEmpty(

action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/typing/TypingGeneration.kt

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,61 @@ internal fun Typing.getClassName(
2020
fieldName: String,
2121
): TypeName =
2222
when (this) {
23-
BooleanTyping -> Boolean::class.asTypeName()
23+
BooleanTyping -> {
24+
Boolean::class.asTypeName()
25+
}
26+
2427
is EnumTyping -> {
2528
val typeName = this.typeName?.toPascalCase() ?: fieldName.toPascalCase()
2629
ClassName("io.github.typesafegithub.workflows.actions.$actionPackageName", "$actionClassName.$typeName")
2730
}
28-
FloatTyping -> Float::class.asTypeName()
29-
IntegerTyping -> Integer::class.asTypeName()
31+
32+
FloatTyping -> {
33+
Float::class.asTypeName()
34+
}
35+
36+
IntegerTyping -> {
37+
Integer::class.asTypeName()
38+
}
39+
3040
is IntegerWithSpecialValueTyping -> {
3141
val typeName = this.typeName?.toPascalCase() ?: fieldName.toPascalCase()
3242
ClassName("io.github.typesafegithub.workflows.actions.$actionPackageName", "$actionClassName.$typeName")
3343
}
34-
is ListOfTypings ->
44+
45+
is ListOfTypings -> {
3546
List::class
3647
.asClassName()
3748
.parameterizedBy(typing.getClassName(actionPackageName, actionClassName, fieldName))
38-
StringTyping -> String::class.asTypeName()
49+
}
50+
51+
StringTyping -> {
52+
String::class.asTypeName()
53+
}
3954
}
4055

4156
internal fun Typing.asString(): String =
4257
when (this) {
43-
BooleanTyping -> ".toString()"
44-
is EnumTyping -> ".stringValue"
45-
FloatTyping -> ".toString()"
46-
IntegerTyping -> ".toString()"
47-
is IntegerWithSpecialValueTyping -> ".integerValue.toString()"
58+
BooleanTyping -> {
59+
".toString()"
60+
}
61+
62+
is EnumTyping -> {
63+
".stringValue"
64+
}
65+
66+
FloatTyping -> {
67+
".toString()"
68+
}
69+
70+
IntegerTyping -> {
71+
".toString()"
72+
}
73+
74+
is IntegerWithSpecialValueTyping -> {
75+
".integerValue.toString()"
76+
}
77+
4878
is ListOfTypings -> {
4979
val mapValue: String =
5080
when (typing) {
@@ -56,7 +86,10 @@ internal fun Typing.asString(): String =
5686
}
5787
".joinToString(\"${if (delimiter == "\n") "\\n" else delimiter}\")$mapValue"
5888
}
59-
else -> ""
89+
90+
else -> {
91+
""
92+
}
6093
}
6194

6295
internal fun Typing.buildCustomType(

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies {
1313
implementation("io.kotest:kotest-framework-plugin-gradle:6.0.7")
1414

1515
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8")
16-
implementation("org.jmailen.gradle:kotlinter-gradle:5.2.0")
16+
implementation("org.jmailen.gradle:kotlinter-gradle:5.3.0")
1717

1818
implementation(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.10.2"))
1919
implementation(("org.jetbrains.kotlinx:kotlinx-coroutines-core"))

code-generator/src/main/kotlin/io/github/typesafegithub/workflows/dsl/expressions/GenerateEventPayloads.kt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,19 @@ fun PayloadEventParams.findAllObjects(
8888
element
8989
.flatMap { (subpath, entry) ->
9090
when (entry) {
91-
is JsonObject -> findAllObjects(entry, "$path.$subpath")
91+
is JsonObject -> {
92+
findAllObjects(entry, "$path.$subpath")
93+
}
94+
9295
is JsonArray -> {
9396
(entry.firstOrNull() as? JsonObject)
9497
?.let { firtSchild -> findAllObjects(firtSchild, "$path/$subpath") }
9598
?: nothing
9699
}
97-
else -> nothing
100+
101+
else -> {
102+
nothing
103+
}
98104
}.toList()
99105
}.toMap()
100106
return result + Pair(path, element)
@@ -149,11 +155,14 @@ fun Map.Entry<String, JsonElement>.generatePropertySpec(
149155
.initializer("%S", "github.$key.$child")
150156
.build()
151157
}
152-
is JsonObject ->
158+
159+
is JsonObject -> {
153160
PropertySpec
154161
.builder(child, ClassName(PACKAGE, payloadClassName("$key.$child", filename)))
155162
.initializer("%L", payloadClassName("$key.$child", filename))
156163
.build()
164+
}
165+
157166
is JsonArray -> {
158167
PropertySpec
159168
.builder(child, listOfStrings)

github-workflows-kt/src/main/kotlin/io/github/typesafegithub/workflows/yaml/ConsistencyCheckJob.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,19 @@ internal fun WorkflowBuilder.consistencyCheckJob(
4343
) {
4444
val checkoutActionVersion =
4545
when (consistencyCheckJobConfig.checkoutActionVersion) {
46-
CheckoutActionVersionSource.BundledWithLibrary -> "v4"
47-
is CheckoutActionVersionSource.Given -> consistencyCheckJobConfig.checkoutActionVersion.version
48-
is CheckoutActionVersionSource.InferFromClasspath ->
46+
CheckoutActionVersionSource.BundledWithLibrary -> {
47+
"v4"
48+
}
49+
50+
is CheckoutActionVersionSource.Given -> {
51+
consistencyCheckJobConfig.checkoutActionVersion.version
52+
}
53+
54+
is CheckoutActionVersionSource.InferFromClasspath -> {
4955
inferCheckoutActionVersionFromClasspath(
5056
consistencyCheckJobConfig.checkoutActionVersion.checkoutActionClassFQN,
5157
)
58+
}
5259
}
5360

5461
uses(

github-workflows-kt/src/main/kotlin/io/github/typesafegithub/workflows/yaml/JobsToYaml.kt

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,62 @@ private fun Job<*>.toYaml(): Map<String, Any?> =
6363
@Suppress("CyclomaticComplexMethod")
6464
public fun RunnerType.toYaml(): Any =
6565
when (this) {
66-
is Custom -> runsOn
67-
is Labelled -> labels.toList()
68-
is RunnerType.Group ->
66+
is Custom -> {
67+
runsOn
68+
}
69+
70+
is Labelled -> {
71+
labels.toList()
72+
}
73+
74+
is RunnerType.Group -> {
6975
mapOfNotNullValues(
7076
"group" to name,
7177
"labels" to labels?.toList(),
7278
)
73-
UbuntuLatest -> "ubuntu-latest"
74-
WindowsLatest -> "windows-latest"
75-
MacOSLatest -> "macos-latest"
76-
Windows2025 -> "windows-2025"
77-
Windows2022 -> "windows-2022"
78-
Windows2019 -> "windows-2019"
79-
Windows2016 -> "windows-2016"
80-
Ubuntu2004 -> "ubuntu-20.04"
81-
Ubuntu1804 -> "ubuntu-18.04"
82-
MacOS11 -> "macos-11"
83-
MacOS1015 -> "macos-10.15"
79+
}
80+
81+
UbuntuLatest -> {
82+
"ubuntu-latest"
83+
}
84+
85+
WindowsLatest -> {
86+
"windows-latest"
87+
}
88+
89+
MacOSLatest -> {
90+
"macos-latest"
91+
}
92+
93+
Windows2025 -> {
94+
"windows-2025"
95+
}
96+
97+
Windows2022 -> {
98+
"windows-2022"
99+
}
100+
101+
Windows2019 -> {
102+
"windows-2019"
103+
}
104+
105+
Windows2016 -> {
106+
"windows-2016"
107+
}
108+
109+
Ubuntu2004 -> {
110+
"ubuntu-20.04"
111+
}
112+
113+
Ubuntu1804 -> {
114+
"ubuntu-18.04"
115+
}
116+
117+
MacOS11 -> {
118+
"macos-11"
119+
}
120+
121+
MacOS1015 -> {
122+
"macos-10.15"
123+
}
84124
}

github-workflows-kt/src/main/kotlin/io/github/typesafegithub/workflows/yaml/ObjectToYaml.kt

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,26 @@ internal fun Any.toYaml(): String {
4747

4848
private fun Any?.elementToYaml(emitter: Emitter) {
4949
when (this) {
50-
is Map<*, *> -> this.mapToYaml(emitter)
51-
is List<*> -> this.listToYaml(emitter)
52-
is String, is Int, is Float, is Double, is Boolean, null -> this.scalarToYaml(emitter)
50+
is Map<*, *> -> {
51+
this.mapToYaml(emitter)
52+
}
53+
54+
is List<*> -> {
55+
this.listToYaml(emitter)
56+
}
57+
58+
is String, is Int, is Float, is Double, is Boolean, null -> {
59+
this.scalarToYaml(emitter)
60+
}
61+
5362
is StringWithComment -> {
5463
this.value.scalarToYaml(emitter)
5564
(" " + this.comment).commentToYaml(emitter)
5665
}
57-
else -> error("Serializing $this is not supported!")
66+
67+
else -> {
68+
error("Serializing $this is not supported!")
69+
}
5870
}
5971
}
6072

github-workflows-kt/src/main/kotlin/io/github/typesafegithub/workflows/yaml/TriggersToYaml.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,15 @@ private fun Schedule.toAdditionalYaml(): List<Map<String, String>> = triggers.ma
152152

153153
private fun WorkflowDispatch.toAdditionalYaml(): Map<String, Any?> =
154154
when {
155-
inputs.isEmpty() -> emptyMap()
156-
else ->
155+
inputs.isEmpty() -> {
156+
emptyMap()
157+
}
158+
159+
else -> {
157160
mapOf(
158161
"inputs" to inputs.mapValues { (_, value) -> value.toYaml() },
159162
)
163+
}
160164
}
161165

162166
private fun WorkflowDispatch.Input.toYaml(): Map<String, Any> =
@@ -170,13 +174,17 @@ private fun WorkflowDispatch.Input.toYaml(): Map<String, Any> =
170174

171175
private fun WorkflowCall.toAdditionalYaml(): Map<String, Any?> =
172176
when {
173-
inputs.isEmpty() -> emptyMap()
174-
else ->
177+
inputs.isEmpty() -> {
178+
emptyMap()
179+
}
180+
181+
else -> {
175182
mapOfNotNullValues(
176183
"inputs" to inputs.mapValues { (_, value) -> value.toYaml() },
177184
"outputs" to outputs?.mapValues { (_, value) -> value.toYaml() },
178185
"secrets" to secrets?.mapValues { (_, value) -> value.toYaml() },
179186
)
187+
}
180188
}
181189

182190
private fun WorkflowCall.Input.toYaml(): Map<String, Any> =

0 commit comments

Comments
 (0)