Skip to content

Commit 0f6f08a

Browse files
committed
Formatting
1 parent 2dc49e2 commit 0f6f08a

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ internal fun WorkflowBuilder.consistencyCheckJob(
3737
condition = consistencyCheckJobConfig.condition,
3838
env = consistencyCheckJobConfig.env,
3939
) {
40-
val checkoutActionVersion = when (consistencyCheckJobConfig.checkoutActionVersion) {
41-
CheckoutActionVersionSource.BundledWithLibrary -> "v4"
42-
is CheckoutActionVersionSource.Given -> consistencyCheckJobConfig.checkoutActionVersion.version
43-
CheckoutActionVersionSource.InferredFromClasspath -> inferCheckoutActionVersionFromClasspath()
44-
}
40+
val checkoutActionVersion =
41+
when (consistencyCheckJobConfig.checkoutActionVersion) {
42+
CheckoutActionVersionSource.BundledWithLibrary -> "v4"
43+
is CheckoutActionVersionSource.Given -> consistencyCheckJobConfig.checkoutActionVersion.version
44+
CheckoutActionVersionSource.InferredFromClasspath -> inferCheckoutActionVersionFromClasspath()
45+
}
4546

4647
uses(
4748
name = "Check out",
@@ -108,6 +109,9 @@ internal fun WorkflowBuilder.consistencyCheckJob(
108109

109110
private fun inferCheckoutActionVersionFromClasspath(): String {
110111
val clazz = Class.forName("io.github.typesafegithub.workflows.actions.actions.Checkout")
111-
val jarName = clazz.protectionDomain.codeSource.location.toString().substringAfterLast("/")
112+
val jarName =
113+
clazz.protectionDomain.codeSource.location
114+
.toString()
115+
.substringAfterLast("/")
112116
return jarName.substringAfterLast("-").substringBeforeLast(".")
113117
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public sealed interface ConsistencyCheckJobConfig {
3636

3737
public sealed interface CheckoutActionVersionSource {
3838
public object BundledWithLibrary : CheckoutActionVersionSource
39+
3940
public object InferredFromClasspath : CheckoutActionVersionSource
40-
public class Given(public val version: String) : CheckoutActionVersionSource
41+
42+
public class Given(
43+
public val version: String,
44+
) : CheckoutActionVersionSource
4145
}

github-workflows-kt/src/test/kotlin/io/github/typesafegithub/workflows/IntegrationTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ class IntegrationTest :
384384
sourceFile = sourceTempFile,
385385
consistencyCheckJobConfig =
386386
DEFAULT_CONSISTENCY_CHECK_JOB_CONFIG.copy(
387-
checkoutActionVersion = CheckoutActionVersionSource.InferredFromClasspath
387+
checkoutActionVersion = CheckoutActionVersionSource.InferredFromClasspath,
388388
),
389389
) {
390390
job(

0 commit comments

Comments
 (0)