From aa1e6844d466166f2059654f672543046ed3e0d5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 05:32:53 +0000 Subject: [PATCH 1/2] Update dependency com.facebook:ktfmt to v0.64 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5bef413..3be8ce0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", ve kotlin-collections-immutable = "org.jetbrains.kotlinx:kotlinx-collections-immutable:0.5.0" kotlin-serialization-json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0" kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test" } -ktfmt = "com.facebook:ktfmt:0.63" +ktfmt = "com.facebook:ktfmt:0.64" ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" } ktor-client-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } From 8b4c91ef685535f109c2d7a47af6af8ea80cc355 Mon Sep 17 00:00:00 2001 From: Matthew Precious Date: Wed, 22 Jul 2026 10:55:29 -0400 Subject: [PATCH 2/2] Format --- .../stacker/command/StackerCommand.kt | 21 ++++---- .../stacker/vc/GitVersionControl.kt | 50 +++++++++---------- .../stacker/test/util/environment.kt | 20 ++++---- 3 files changed, 45 insertions(+), 46 deletions(-) diff --git a/src/commonMain/kotlin/com/mattprecious/stacker/command/StackerCommand.kt b/src/commonMain/kotlin/com/mattprecious/stacker/command/StackerCommand.kt index 97c8813..6286ef4 100644 --- a/src/commonMain/kotlin/com/mattprecious/stacker/command/StackerCommand.kt +++ b/src/commonMain/kotlin/com/mattprecious/stacker/command/StackerCommand.kt @@ -60,18 +60,17 @@ abstract class StackerCommand { // Mosaic will wait for all effects to finish before exiting. Finished and Aborted signal that // we should terminate this collect in order to tear down. - val currentState = - remember { - snapshotFlow { workState.state } - .transformWhile { - // We need to emit the terminal state so that the LaunchedEffect below can be - // interrupted. - emit(it) - it !is State.TerminalState - } + val currentState = remember { + snapshotFlow { workState.state } + .transformWhile { + // We need to emit the terminal state so that the LaunchedEffect below can be + // interrupted. + emit(it) + it !is State.TerminalState } - .collectAsState(workState.state) - .value + } + .collectAsState(workState.state) + .value printer.Messages() diff --git a/src/commonMain/kotlin/com/mattprecious/stacker/vc/GitVersionControl.kt b/src/commonMain/kotlin/com/mattprecious/stacker/vc/GitVersionControl.kt index 1532d3a..0c02fc3 100644 --- a/src/commonMain/kotlin/com/mattprecious/stacker/vc/GitVersionControl.kt +++ b/src/commonMain/kotlin/com/mattprecious/stacker/vc/GitVersionControl.kt @@ -407,38 +407,38 @@ class GitVersionControl(scope: MemScope, private val fs: FileSystem, private val private fun MemScope.getCommitForBranch(branchName: String): git_commit { return withAllocPointerTo { - checkError( - functionName = "git_commit_lookup", - result = git_commit_lookup(it.pointer, repo, getCommitId(branchName).pointer), - ) - } + checkError( + functionName = "git_commit_lookup", + result = git_commit_lookup(it.pointer, repo, getCommitId(branchName).pointer), + ) + } .pointed!! } private fun MemScope.getHead(): git_reference { return withAllocPointerTo { - checkError("git_repository_head", git_repository_head(it.ptr, repo)) - } + checkError("git_repository_head", git_repository_head(it.ptr, repo)) + } .pointed!! } private fun MemScope.getBranch(branchName: String): git_reference { return withAllocPointerTo { - checkError( - functionName = "git_reference_lookup", - result = git_reference_lookup(it.ptr, repo, branchName.asBranchRevSpec()), - ) - } + checkError( + functionName = "git_reference_lookup", + result = git_reference_lookup(it.ptr, repo, branchName.asBranchRevSpec()), + ) + } .pointed!! } /** Should be freed with [git_remote_free]. */ private fun MemScope.getOrigin(): git_remote? { return withAllocPointerTo { - val code = git_remote_lookup(it.ptr, repo, "origin") - if (code == ReturnCodes.ENOTFOUND) return null - checkError("git_remote_lookup", code) - } + val code = git_remote_lookup(it.ptr, repo, "origin") + if (code == ReturnCodes.ENOTFOUND) return null + checkError("git_remote_lookup", code) + } .pointed!! } @@ -557,20 +557,20 @@ class GitVersionControl(scope: MemScope, private val fs: FileSystem, private val private fun MemScope.getAnnotatedCommit(branchName: String): git_annotated_commit { return withAllocPointerTo { - checkError( - functionName = "git_annotated_commit_from_revspec", - result = git_annotated_commit_from_revspec(it.ptr, repo, branchName.asBranchRevSpec()), - ) - } + checkError( + functionName = "git_annotated_commit_from_revspec", + result = git_annotated_commit_from_revspec(it.ptr, repo, branchName.asBranchRevSpec()), + ) + } .pointed!! } private fun MemScope.getRebase(): git_rebase? { return withAllocPointerTo { - val code = git_rebase_open(it.ptr, repo, null) - if (code == ReturnCodes.ENOTFOUND) return null - checkError("git_rebase_open", code) - } + val code = git_rebase_open(it.ptr, repo, null) + if (code == ReturnCodes.ENOTFOUND) return null + checkError("git_rebase_open", code) + } .pointed } diff --git a/src/commonTest/kotlin/com/mattprecious/stacker/test/util/environment.kt b/src/commonTest/kotlin/com/mattprecious/stacker/test/util/environment.kt index e7da9ae..41d2e94 100644 --- a/src/commonTest/kotlin/com/mattprecious/stacker/test/util/environment.kt +++ b/src/commonTest/kotlin/com/mattprecious/stacker/test/util/environment.kt @@ -118,17 +118,17 @@ class Environment { val stream = popen("$command 2>&1", "r") ?: fail("Command ($command) failed.") return buildString { - val buffer = ByteArray(4096) - while (true) { - val input = fgets(buffer.refTo(0), buffer.size, stream) ?: break - append(input.toKString()) - } - - val status = pclose(stream) - if (status != 0) { - fail("Command ($command) failed with status: $status.") - } + val buffer = ByteArray(4096) + while (true) { + val input = fgets(buffer.refTo(0), buffer.size, stream) ?: break + append(input.toKString()) } + + val status = pclose(stream) + if (status != 0) { + fail("Command ($command) failed with status: $status.") + } + } .trim() }