Skip to content

Commit 51a386c

Browse files
scala-stewardscholarsmate
authored andcommitted
Update scalafmt-core to 3.10.1
- Reformat with scalafmt 3.10.1 - Executed command: scalafmt --non-interactive
1 parent fd36689 commit 51a386c

5 files changed

Lines changed: 45 additions & 24 deletions

File tree

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
version = "3.8.6"
16+
version = "3.10.1"
1717
maxColumn = 120
1818
rewrite.rules = [SortImports, RedundantBraces]
1919
runner.dialect = scala212

debugger/src/main/scala/org.apache.daffodil.debugger.dap/DAPodil.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class DAPodil(
167167
def handle(request: Request): IO[Unit] =
168168
// TODO: java-debug doesn't seem to support the Restart request
169169
request match {
170-
case extract(Command.INITIALIZE, _) => initialize(request)
170+
case extract(Command.INITIALIZE, _) => initialize(request)
171171
case extract(Command.CONFIGURATIONDONE, _) =>
172172
session.sendResponse(request.respondSuccess())
173173
case extract(Command.LAUNCH, _) =>
@@ -180,15 +180,15 @@ class DAPodil(
180180
source(request, args)
181181
case extract(Command.SETBREAKPOINTS, args: SetBreakpointArguments) =>
182182
setBreakpoints(request, args)
183-
case extract(Command.THREADS, _) => threads(request)
184-
case extract(Command.STACKTRACE, _) => stackTrace(request)
183+
case extract(Command.THREADS, _) => threads(request)
184+
case extract(Command.STACKTRACE, _) => stackTrace(request)
185185
case extract(Command.SCOPES, args: ScopesArguments) =>
186186
scopes(request, args)
187187
case extract(Command.VARIABLES, args: VariablesArguments) =>
188188
variables(request, args)
189-
case extract(Command.NEXT, _) => next(request)
190-
case extract(Command.CONTINUE, _) => continue(request)
191-
case extract(Command.PAUSE, _) => pause(request)
189+
case extract(Command.NEXT, _) => next(request)
190+
case extract(Command.CONTINUE, _) => continue(request)
191+
case extract(Command.PAUSE, _) => pause(request)
192192
case extract(Command.DISCONNECT, args: DisconnectArguments) =>
193193
disconnect(request, args)
194194
case extract(Command.EVALUATE, args: EvaluateArguments) =>

debugger/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,10 @@ object Parse {
494494
// is set to True, and the type field is set to a value other than file
495495
def parseInfosetOutput(arguments: JsonObject, requireFile: Boolean = false) =
496496
Option(arguments.getAsJsonObject("infosetOutput")) match {
497-
case None => Right(LaunchArgs.InfosetOutput.Console).toEitherNel
497+
case None => Right(LaunchArgs.InfosetOutput.Console).toEitherNel
498498
case Some(infosetOutput) =>
499499
Option(infosetOutput.getAsJsonPrimitive("type")) match {
500-
case None => Right(LaunchArgs.InfosetOutput.Console).toEitherNel
500+
case None => Right(LaunchArgs.InfosetOutput.Console).toEitherNel
501501
case Some(typ) =>
502502
typ.getAsString() match {
503503
case "none" =>
@@ -800,7 +800,7 @@ object Parse {
800800
def deliver(events: Stream[IO, Event]): Stream[IO, Nothing] =
801801
events
802802
.evalScan(Delivery.State.empty) {
803-
case (state, Parse.Event.Init(_)) => IO.pure(state.copy(data = DAPodil.Data.empty))
803+
case (state, Parse.Event.Init(_)) => IO.pure(state.copy(data = DAPodil.Data.empty))
804804
case (state, e: Event.StartElement) =>
805805
for {
806806
frame <- createFrame(e)
@@ -1169,8 +1169,8 @@ object Parse {
11691169

11701170
def apply(that: Debugee.LaunchArgs.InfosetOutput): InfosetOutput =
11711171
that match {
1172-
case Debugee.LaunchArgs.InfosetOutput.None => None
1173-
case Debugee.LaunchArgs.InfosetOutput.Console => Console
1172+
case Debugee.LaunchArgs.InfosetOutput.None => None
1173+
case Debugee.LaunchArgs.InfosetOutput.Console => Console
11741174
case Debugee.LaunchArgs.InfosetOutput.File(path) =>
11751175
File(path.toString)
11761176
}
@@ -1289,7 +1289,7 @@ object Parse {
12891289
case AwaitingFirstAwait(waiterArrived) =>
12901290
Stopped(nextContinue, nextAwaitStarted) -> waiterArrived
12911291
.complete(()) *> nextContinue.get.as(true)
1292-
case Running => Running -> IO.pure(false)
1292+
case Running => Running -> IO.pure(false)
12931293
case s @ Stopped(whenContinued, nextAwaitStarted) =>
12941294
s -> nextAwaitStarted.complete(()) *> // signal next await happened
12951295
whenContinued.get.as(true) // block
@@ -1307,7 +1307,7 @@ object Parse {
13071307
case "stepIn" => stepIn()
13081308
case "stepOut" => stepOut()
13091309
})
1310-
case Running => Running -> IO.unit
1310+
case Running => Running -> IO.unit
13111311
case Stopped(whenContinued, _) =>
13121312
Stopped(nextContinue, nextAwaitStarted) -> (
13131313
whenContinued.complete(()) *> // wake up await-ers
@@ -1324,7 +1324,7 @@ object Parse {
13241324
state.modify {
13251325
case s @ AwaitingFirstAwait(waiterArrived) =>
13261326
s -> waiterArrived.get *> continue()
1327-
case Running => Running -> IO.unit
1327+
case Running => Running -> IO.unit
13281328
case Stopped(whenContinued, _) =>
13291329
Running -> whenContinued.complete(()).void // wake up await-ers
13301330
}.flatten

debugger/src/main/scala/org.apache.daffodil.debugger.dap/logging.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ object logging {
3838
}
3939

4040
implicit val eventShow: Show[DebugEvent] = {
41-
case event: Events.StoppedEvent => s"${event.`type`} ${event.reason} ${event.description}"
42-
case event: Events.ThreadEvent => s"${event.`type`} ${event.reason}"
41+
case event: Events.StoppedEvent => s"${event.`type`} ${event.reason} ${event.description}"
42+
case event: Events.ThreadEvent => s"${event.`type`} ${event.reason}"
4343
case event: DAPodil.LoadedSourceEvent =>
4444
s"${event.`type`} ${event.reason} ${JsonUtils.toJson(event.source)}"
4545
case event: Parse.DataEvent =>

debugger/src/test/scala/org.apache.daffodil.debugger/ParseSuite.scala

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,21 @@ class ParseSuite extends FunSuite {
6666
schema.remove("path")
6767
val parseResult = Parse.Debugee.LaunchArgs.parse(testJsonObject)
6868
assertEquals(parseResult.isLeft, true)
69-
assertEquals(parseResult.swap.toOption.map(_.head).getOrElse("no error"), "missing 'schema.path' field from launch request")
69+
assertEquals(
70+
parseResult.swap.toOption.map(_.head).getOrElse("no error"),
71+
"missing 'schema.path' field from launch request"
72+
)
7073
}
7174

7275
test("Parse failed - No data") {
7376
buildJson()
7477
testJsonObject.remove("data")
7578
val parseResult = Parse.Debugee.LaunchArgs.parse(testJsonObject)
7679
assertEquals(parseResult.isLeft, true)
77-
assertEquals(parseResult.swap.toOption.map(_.head).getOrElse("no error"), "missing 'data' field from launch request")
80+
assertEquals(
81+
parseResult.swap.toOption.map(_.head).getOrElse("no error"),
82+
"missing 'data' field from launch request"
83+
)
7884
}
7985

8086
// This test succeeds because stopOnEntry defaults if it is empty
@@ -98,7 +104,10 @@ class ParseSuite extends FunSuite {
98104
buildJson()
99105
val parseResult = Parse.Debugee.LaunchArgs.parse(testJsonObject)
100106
assertEquals(parseResult.isLeft, true)
101-
assertEquals(parseResult.swap.toOption.map(_.head).getOrElse("no error"), "can't write to infoset output file at " + infosetOutputPath)
107+
assertEquals(
108+
parseResult.swap.toOption.map(_.head).getOrElse("no error"),
109+
"can't write to infoset output file at " + infosetOutputPath
110+
)
102111
infosetOutputType = "none"
103112
infosetOutputPath = "testPath/infoset.xml"
104113
}
@@ -109,7 +118,10 @@ class ParseSuite extends FunSuite {
109118
testTDMLObject.remove("name")
110119
val parseResult = Parse.Debugee.parseTDMLName(testTDMLObject)
111120
assertEquals(parseResult.isLeft, true)
112-
assertEquals(parseResult.swap.toOption.map(_.head).getOrElse("no error"), "missing 'tdmlConfig.name' field from launch request")
121+
assertEquals(
122+
parseResult.swap.toOption.map(_.head).getOrElse("no error"),
123+
"missing 'tdmlConfig.name' field from launch request"
124+
)
113125
}
114126

115127
test("Parse failed - invalid tdmlConfig - no path") {
@@ -118,7 +130,10 @@ class ParseSuite extends FunSuite {
118130
testTDMLObject.remove("path")
119131
val parseResult = Parse.Debugee.parseTDMLPath(testTDMLObject)
120132
assertEquals(parseResult.isLeft, true)
121-
assertEquals(parseResult.swap.toOption.map(_.head).getOrElse("no error"), "missing 'tdmlConfig.path' field from launch request")
133+
assertEquals(
134+
parseResult.swap.toOption.map(_.head).getOrElse("no error"),
135+
"missing 'tdmlConfig.path' field from launch request"
136+
)
122137
}
123138

124139
test("Parse failed - invalid tdmlConfig - invalid action") {
@@ -137,15 +152,21 @@ class ParseSuite extends FunSuite {
137152
buildJson()
138153
val parseResult = Parse.Debugee.LaunchArgs.parse(testJsonObject)
139154
assertEquals(parseResult.isLeft, true)
140-
assertEquals(parseResult.swap.toOption.map(_.head).getOrElse("no error"), s"schema file at $schemaPath doesn't exist")
155+
assertEquals(
156+
parseResult.swap.toOption.map(_.head).getOrElse("no error"),
157+
s"schema file at $schemaPath doesn't exist"
158+
)
141159
}
142160

143161
test("Parse failed - infosetOutputType not file") {
144162
tdmlAction = "generate"
145163
buildJson()
146164
val parseResult = Parse.Debugee.LaunchArgs.parse(testJsonObject)
147165
assertEquals(parseResult.isLeft, true)
148-
assertEquals(parseResult.swap.toOption.map(_.head).getOrElse("no error"), "'type' field in 'infosetOutput' must be set to 'file'")
166+
assertEquals(
167+
parseResult.swap.toOption.map(_.head).getOrElse("no error"),
168+
"'type' field in 'infosetOutput' must be set to 'file'"
169+
)
149170
}
150171

151172
def buildJson(): Unit = {

0 commit comments

Comments
 (0)