Skip to content

Commit fc3f124

Browse files
authored
Update scalafmt-core to 3.0.1
1 parent 6fc0a48 commit fc3f124

File tree

14 files changed

+77
-57
lines changed

14 files changed

+77
-57
lines changed

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=3.0.0
1+
version=3.0.1
22
style = defaultWithAlign
33
maxColumn = 100
44

compiler/src/main/scala/org/scalaexercises/exercises/compiler/Compiler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ case class Compiler() {
170170

171171
contribs.unsafeRunSync().result match {
172172
case Right(result) =>
173-
result.collect({
173+
result.collect {
174174
case Commit(sha, message, date, url, Some(login), Some(avatar_url), Some(author_url)) =>
175175
ContributionInfo(
176176
sha = sha,
@@ -181,7 +181,7 @@ case class Compiler() {
181181
avatarUrl = avatar_url,
182182
authorUrl = author_url
183183
)
184-
})
184+
}
185185
case Left(ex) => throw ex
186186
}
187187
}

compiler/src/main/scala/org/scalaexercises/exercises/compiler/SourceTextExtraction.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ class SourceTextExtraction {
6161
absolutePath.split(base).lift(1).getOrElse("")
6262

6363
def extractAll(sources: List[String], paths: List[String], baseDir: String): Extracted = {
64-
new global.Run() compileSources (paths zip sources).map({ case (path, code) =>
64+
new global.Run() compileSources (paths zip sources).map { case (path, code) =>
6565
new BatchSourceFile(path, code)
66-
})
66+
}
6767
val run = global.currentRun
68-
val symbolPaths = Map(run.symSource.toList: _*).map({ case (symbol, file) =>
68+
val symbolPaths = Map(run.symSource.toList: _*).map { case (symbol, file) =>
6969
(symbol.toString, relativePath(file.path, baseDir))
70-
})
70+
}
7171
val compilationUnits = run.units.toList // `units` is only only iterable once!
7272
val extractions = compilationUnits.map(_.body).map(boundExtractRaw)
7373

sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,18 @@ object ExerciseCompilerPlugin extends AutoPlugin {
126126
* `exercise.Library`.
127127
*/
128128
private def discoverLibraries(analysis: CompileAnalysis): Seq[String] =
129-
Discovery(Set("org.scalaexercises.definitions.Library"), Set.empty)(Tests.allDefs(analysis))
130-
.collect({
131-
case (definition, discovered) if !discovered.isEmpty => definition.name
132-
})
133-
.sorted
129+
Discovery(Set("org.scalaexercises.definitions.Library"), Set.empty)(
130+
Tests.allDefs(analysis)
131+
).collect {
132+
case (definition, discovered) if !discovered.isEmpty => definition.name
133+
}.sorted
134134

135135
private def discoverSections(analysis: CompileAnalysis): Seq[String] =
136-
Discovery(Set("org.scalaexercises.definitions.Section"), Set.empty)(Tests.allDefs(analysis))
137-
.collect({
138-
case (definition, discovered) if !discovered.isEmpty => definition.name
139-
})
140-
.sorted
136+
Discovery(Set("org.scalaexercises.definitions.Section"), Set.empty)(
137+
Tests.allDefs(analysis)
138+
).collect {
139+
case (definition, discovered) if !discovered.isEmpty => definition.name
140+
}.sorted
141141

142142
// reflection is used to invoke a java-style interface to the exercise compiler
143143
private val COMPILER_CLASS = "org.scalaexercises.compiler.CompilerJava"

sbt-exercise/src/sbt-test/sbt-exercise/basic/check/src/main/scala/check.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ object Check extends App {
1313
assert(errors.isEmpty, "expected errors to be empty")
1414
assert(libraries.length == 1, "expected one library from the content project")
1515

16-
17-
val res = libraries.find(_.name == "sample")
16+
val res = libraries
17+
.find(_.name == "sample")
1818
.flatMap(_.sections.find(_.name == "foo"))
1919
.flatMap(_.exercises.find(_.name == "foo1"))
2020

2121
assert(res.isDefined, "evaluation of exercise method failed")
22-
}
22+
}

sbt-exercise/src/sbt-test/sbt-exercise/basic/content/src/main/scala/BarSection.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ package stdlib
22

33
import org.scalaexercises.definitions.Section
44

5-
/** This is a Section
6-
*
7-
* @param name Section Bar
8-
*/
5+
/**
6+
* This is a Section
7+
*
8+
* @param name
9+
* Section Bar
10+
*/
911
object BarSection extends Section {
1012

1113
/** Exercise bar 1 */

sbt-exercise/src/sbt-test/sbt-exercise/basic/content/src/main/scala/FooSection.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ package stdlib
22

33
import org.scalaexercises.definitions.Section
44

5-
/** This is a Section Foo
6-
*
7-
* @param name foo
8-
*/
5+
/**
6+
* This is a Section Foo
7+
*
8+
* @param name
9+
* foo
10+
*/
911
object FooSection extends Section {
1012

1113
/** Exercise foo 1 */

sbt-exercise/src/sbt-test/sbt-exercise/basic/content/src/main/scala/SampleLibrary.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package stdlib
22

33
import org.scalaexercises.definitions.Library
44

5-
/** This is my Library
6-
* @param name sample
7-
*/
5+
/**
6+
* This is my Library
7+
* @param name
8+
* sample
9+
*/
810
object SampleLibrary extends Library {
911

10-
override def owner = "scala-exercises"
12+
override def owner = "scala-exercises"
1113
override def repository = "scala-exercises"
1214

1315
override def color = Option("#BADA55")

sbt-exercise/src/sbt-test/sbt-exercise/basic/contentinpackages/src/main/scala/org/my/nested/pack/BarSection.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ package org.my.nested.pack
22

33
import org.scalaexercises.definitions.Section
44

5-
/** This is a Section within package package org.my.nested.pack
6-
*
7-
* @param name Section Bar
8-
*/
5+
/**
6+
* This is a Section within package package org.my.nested.pack
7+
*
8+
* @param name
9+
* Section Bar
10+
*/
911
object BarSection extends Section {
1012

1113
/** Exercise bar 1 */

sbt-exercise/src/sbt-test/sbt-exercise/basic/contentinpackages/src/main/scala/org/my/nested/pack/FooSection.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ package org.my.nested.pack
22

33
import org.scalaexercises.definitions.Section
44

5-
/** This is a Section Foo in package org.my.nested.pack
6-
*
7-
* @param name foo
8-
*/
5+
/**
6+
* This is a Section Foo in package org.my.nested.pack
7+
*
8+
* @param name
9+
* foo
10+
*/
911
object FooSection extends Section {
1012

1113
/** Exercise foo 1 */

0 commit comments

Comments
 (0)