Skip to content

Commit

Permalink
scalafmtAll
Browse files Browse the repository at this point in the history
  • Loading branch information
aednichols committed Feb 13, 2025
1 parent 5dbcd27 commit ed817b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
9 changes: 6 additions & 3 deletions core/src/main/scala/cromwell/core/io/IoCommandBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cromwell.core.io

import cromwell.core.callcaching.FileHashStrategy
import cromwell.core.io.DefaultIoCommand._
import cromwell.core.io.IoCommand.{IOMetricsCallback, noopMetricsCallback}
import cromwell.core.io.IoCommand.{noopMetricsCallback, IOMetricsCallback}
import cromwell.core.io.IoContentAsStringCommand.IoReadOptions
import cromwell.core.path.BetterFileMethods.OpenOptions
import cromwell.core.path.Path
Expand All @@ -20,7 +20,8 @@ abstract class PartialIoCommandBuilder {
def sizeCommand: PartialFunction[Path, Try[IoSizeCommand]] = PartialFunction.empty
def deleteCommand: PartialFunction[(Path, Boolean), Try[IoDeleteCommand]] = PartialFunction.empty
def copyCommand: PartialFunction[(Path, Path), Try[IoCopyCommand]] = PartialFunction.empty
def hashCommand: PartialFunction[(Path, FileHashStrategy, IOMetricsCallback), Try[IoHashCommand]] = PartialFunction.empty
def hashCommand: PartialFunction[(Path, FileHashStrategy, IOMetricsCallback), Try[IoHashCommand]] =
PartialFunction.empty

Check warning on line 24 in core/src/main/scala/cromwell/core/io/IoCommandBuilder.scala

View check run for this annotation

Codecov / codecov/patch

core/src/main/scala/cromwell/core/io/IoCommandBuilder.scala#L24

Added line #L24 was not covered by tests
def touchCommand: PartialFunction[Path, Try[IoTouchCommand]] = PartialFunction.empty
def existsCommand: PartialFunction[Path, Try[IoExistsCommand]] = PartialFunction.empty
def isDirectoryCommand: PartialFunction[Path, Try[IoIsDirectoryCommand]] = PartialFunction.empty
Expand All @@ -37,7 +38,9 @@ abstract class PartialIoCommandBuilder {
* This always defaults to building a DefaultIoCommand.
* @param partialBuilders list of PartialIoCommandBuilder to try
*/
class IoCommandBuilder(partialBuilders: List[PartialIoCommandBuilder] = List.empty, metricsCallback: IOMetricsCallback = noopMetricsCallback) {
class IoCommandBuilder(partialBuilders: List[PartialIoCommandBuilder] = List.empty,
metricsCallback: IOMetricsCallback = noopMetricsCallback
) {
// Find the first partialBuilder for which the partial function is defined, or use the default
private def buildOrDefault[A, B](builder: PartialIoCommandBuilder => PartialFunction[A, Try[B]],
params: A,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ class GcsBatchFlowSpec
projectId = "GcsBatchFlowSpec-project"
)
val gcsBatchCommandContext =
GcsBatchCommandContext(GcsBatchHashCommand.forPath(mockGcsPath, FileHashStrategy.Crc32c, noopMetricsCallback).get, TestProbe().ref, 5)
GcsBatchCommandContext(GcsBatchHashCommand.forPath(mockGcsPath, FileHashStrategy.Crc32c, noopMetricsCallback).get,
TestProbe().ref,
5
)
val recoverCommandPrivateMethod =
PrivateMethod[PartialFunction[Throwable, Future[GcsBatchResponse[_]]]](Symbol("recoverCommand"))
val partialFuncAcceptingThrowable = gcsBatchFlow invokePrivate recoverCommandPrivateMethod(gcsBatchCommandContext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ private case object PartialGcsBatchCommandBuilder extends PartialIoCommandBuilde
}

case object GcsBatchCommandBuilder extends IoCommandBuilder(List(PartialGcsBatchCommandBuilder)) {
def apply(metricsCallback: IOMetricsCallback) = new IoCommandBuilder(List(PartialGcsBatchCommandBuilder), metricsCallback)
def apply(metricsCallback: IOMetricsCallback) =
new IoCommandBuilder(List(PartialGcsBatchCommandBuilder), metricsCallback)
}

0 comments on commit ed817b0

Please sign in to comment.