Skip to content

Commit

Permalink
Update scalafmt-core to 3.2.2 (#130)
Browse files Browse the repository at this point in the history
* Update scalafmt-core to 3.2.2

* Reformat with scalafmt 3.2.2
  • Loading branch information
scala-steward authored Dec 28, 2021
1 parent 5147589 commit f386419
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
runner.dialect = "scala212"
version = "3.2.1"
version = "3.2.2"
maxColumn = 120
20 changes: 12 additions & 8 deletions src/main/scala/com/thoughtworks/Example.scala
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ object Example extends AutoPlugin {
val title = name.syntax
val trees =
scaladocTestTree(comments.leading(tree)) :::
stats.flatMap(testTree)
stats.flatMap(testTree)
if (trees.isEmpty) {
Nil
} else {
Expand Down Expand Up @@ -276,11 +276,14 @@ object Example extends AutoPlugin {
case param if !param.mods.exists(Set(Mod.Implicit, Mod.Using)) =>
param.name
}))
defnTestTree(name, stat match {
case Term.Block(stats) =>
stats
case stat => List(stat)
})
defnTestTree(
name,
stat match {
case Term.Block(stats) =>
stats
case stat => List(stat)
}
)
case Defn.Given(_, name, _, _, template) =>
templateTestTree(name, template)
case Defn.GivenAlias(_, name, _, _, _, _) =>
Expand Down Expand Up @@ -394,8 +397,9 @@ object Example extends AutoPlugin {
Type.Name(NameTransformer.encode(raw"""${splitName.last}Example"""))
},
examplePackageRef := {
val organizationPackageRef = new ScalametaParser(Input.String(organization.value.replace('-', '_')))((Test / exampleDialect).value)
.parseRule(_.path(thisOK = false))
val organizationPackageRef =
new ScalametaParser(Input.String(organization.value.replace('-', '_')))((Test / exampleDialect).value)
.parseRule(_.path(thisOK = false))
val splitName = name.value.split('-')
splitName.view(0, splitName.length - 1).foldLeft(organizationPackageRef) { (packageRef, subpackage) =>
q"$packageRef.${Term.Name(subpackage)}"
Expand Down

0 comments on commit f386419

Please sign in to comment.