Skip to content

Commit

Permalink
Merge pull request #107 from scalacenter/update/scalafmt-core-3.8.0
Browse files Browse the repository at this point in the history
Update scalafmt-core to 3.8.0
  • Loading branch information
danicheg authored Feb 20, 2024
2 parents 2ebc390 + a0839de commit b16f3dd
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.8.0
28c4e96f2bb8d9379104718f4103c087a22cc1bc
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.7.17"
version = "3.8.0"
runner.dialect = Scala213
maxColumn = 100
docstrings.style = Asterisk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ object DependencyResolution {
* @return Either a coursier error or all the resolved files.
*/
def resolveWithErrors(
artifacts: List[Artifact],
resolveSources: Boolean = false,
additionalRepositories: Seq[Repository] = Nil
): Either[CoursierError, Array[AbsolutePath]] = {
artifacts: List[Artifact],
resolveSources: Boolean = false,
additionalRepositories: Seq[Repository] = Nil
): Either[CoursierError, Array[AbsolutePath]] = {
val dependencies = artifacts.map { artifact =>
import artifact._
val baseDep = coursierapi.Dependency.of(organization, module, version)
Expand All @@ -70,10 +70,10 @@ object DependencyResolution {
* @return Either a coursier error or all the resolved files.
*/
def resolveDependenciesWithErrors(
dependencies: Seq[coursierapi.Dependency],
resolveSources: Boolean = false,
additionalRepositories: Seq[Repository] = Nil
): Either[CoursierError, Array[AbsolutePath]] = {
dependencies: Seq[coursierapi.Dependency],
resolveSources: Boolean = false,
additionalRepositories: Seq[Repository] = Nil
): Either[CoursierError, Array[AbsolutePath]] = {
val fetch = coursierapi.Fetch
.create()
.withDependencies(dependencies: _*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ object Commands {
}

sealed trait CompilingCommand extends RawCommand {
//def project: String
//def reporter: ReporterKind
// def project: String
// def reporter: ReporterKind
}

/* sealed trait Tree[A]
/* sealed trait Tree[A]
case class Leaf[A](value: A) extends Tree[A]
case class Branch[A](
left: Tree[A],
Expand All @@ -58,8 +58,8 @@ object Commands {

case class Autocomplete(
@Recurse cliOptions: CliOptions = CliOptions.default,
//mode: Mode,
//format: Format,
// mode: Mode,
// format: Format,
/* command: Option[String],
project: Option[String]*/
) extends RawCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ trait CachedImplicits {
implicit val pathParser: ArgParser[Path] = SimpleArgParser.from("A filepath parser") {
case supposedPath: String =>
val toPath = Try(Paths.get(supposedPath)).toEither
toPath.left.map(t => Other(s"The provided path ${supposedPath} is not valid: '${t.getMessage()}'."))
toPath.left.map(t =>
Other(s"The provided path ${supposedPath} is not valid: '${t.getMessage()}'.")
)
}

implicit val propertiesParser: ArgParser[PrettyProperties] = {
SimpleArgParser.from("A properties parser") {
_ => Left(Other("You cannot pass in properties through the command line."))
SimpleArgParser.from("A properties parser") { _ =>
Left(Other("You cannot pass in properties through the command line."))
}
}

Expand Down Expand Up @@ -57,9 +59,11 @@ trait CachedImplicits {

object Parsers extends CachedImplicits {

implicit val labelledGenericCommonOptions: LabelledGeneric.Aux[CommonOptions, _] = LabelledGeneric.materializeProduct
implicit val labelledGenericCommonOptions: LabelledGeneric.Aux[CommonOptions, _] =
LabelledGeneric.materializeProduct
implicit val commonOptionsParser: Parser.Aux[CommonOptions, _] = Parser.derive
implicit val labelledGenericCliOptions: LabelledGeneric.Aux[CliOptions, _] = LabelledGeneric.materializeProduct
implicit val labelledGenericCliOptions: LabelledGeneric.Aux[CliOptions, _] =
LabelledGeneric.materializeProduct
implicit val cliOptionsParser: Parser.Aux[CliOptions, _] = Parser.derive

implicit val strictAutocompleteParser: Parser.Aux[Commands.Autocomplete, _] = Parser.derive
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package shapeless {
sealed trait HList extends Product with Serializable

final case class ::[+H, +T <: HList](head : H, tail : T) extends HList {
def ::[HH](h : HH) : HH :: H :: T = shapeless.::(h, this)
final case class ::[+H, +T <: HList](head: H, tail: T) extends HList {
def ::[HH](h: HH): HH :: H :: T = shapeless.::(h, this)

override def toString = head match {
case _: ::[_, _] => "("+head.toString+") :: "+tail.toString
case _ => head.toString+" :: "+tail.toString
case _: ::[_, _] => "(" + head.toString + ") :: " + tail.toString
case _ => head.toString + " :: " + tail.toString
}
}

sealed trait HNil extends HList {
def ::[H](h : H) = shapeless.::(h, this)
def ::[H](h: H) = shapeless.::(h, this)
override def toString = "HNil"
}

Expand All @@ -26,13 +26,12 @@ package shapeless {

implicit def inHead[H, T <: HList]: Selector[H :: T, H] =
new Selector[H :: T, H] {
def apply(l : H :: T) = l.head
def apply(l: H :: T) = l.head
}

implicit def inTail[H, T <: HList, U]
(implicit st : Selector[T, U]): Selector[H :: T, U] =
implicit def inTail[H, T <: HList, U](implicit st: Selector[T, U]): Selector[H :: T, U] =
new Selector[H :: T, U] {
def apply(l : H :: T) = st(l.tail)
def apply(l: H :: T) = st(l.tail)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package shapeless {
sealed trait HList extends Product with Serializable

final case class ::[+H, +T <: HList](head : H, tail : T) extends HList {
def ::[HH](h : HH) : HH :: H :: T = shapeless.::(h, this)
final case class ::[+H, +T <: HList](head: H, tail: T) extends HList {
def ::[HH](h: HH): HH :: H :: T = shapeless.::(h, this)

override def toString = head match {
case _: ::[_, _] => "("+head.toString+") :: "+tail.toString
case _ => head.toString+" :: "+tail.toString
case _: ::[_, _] => "(" + head.toString + ") :: " + tail.toString
case _ => head.toString + " :: " + tail.toString
}
}

sealed trait HNil extends HList {
def ::[H](h : H) = shapeless.::(h, this)
def ::[H](h: H) = shapeless.::(h, this)
override def toString = "HNil"
}

Expand All @@ -26,13 +26,12 @@ package shapeless {

implicit def inHead[H, T <: HList]: Selector[H :: T, H] =
new Selector[H :: T, H] {
def apply(l : H :: T) = l.head
def apply(l: H :: T) = l.head
}

implicit def inTail[H, T <: HList, U]
(implicit st : Selector[T, U]): Selector[H :: T, U] =
implicit def inTail[H, T <: HList, U](implicit st: Selector[T, U]): Selector[H :: T, U] =
new Selector[H :: T, U] {
def apply(l : H :: T) = st(l.tail)
def apply(l: H :: T) = st(l.tail)
}
}
}
Expand Down

0 comments on commit b16f3dd

Please sign in to comment.