Skip to content

Commit

Permalink
Merge branch 'main' into fix-scalacenter#97
Browse files Browse the repository at this point in the history
  • Loading branch information
danicheg committed Mar 16, 2024
2 parents 976fbf8 + 93ebc81 commit 699796a
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 44 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
7 changes: 4 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ lazy val root = project
(integrations / watchSources).value
)

val bin212 = Seq("2.12.18", "2.12.17", "2.12.16", "2.12.15", "2.12.14", "2.12.13")
val bin213 = Seq("2.13.12", "2.13.11", "2.13.10", "2.13.9", "2.13.8", "2.13.7", "2.13.6", "2.13.5")
val bin212 = Seq("2.12.19", "2.12.18", "2.12.17", "2.12.16", "2.12.15", "2.12.14", "2.12.13")
val bin213 =
Seq("2.13.13", "2.13.12", "2.13.11", "2.13.10", "2.13.9", "2.13.8", "2.13.7", "2.13.6", "2.13.5")

// Copied from
// https://github.com/scalameta/scalameta/blob/370e304b0d10db1dd65fc79a5abc1f39004aeffd/build.sbt#L724-L737
Expand All @@ -36,7 +37,7 @@ lazy val fullCrossVersionSettings = Seq(
// NOTE: SBT 1.x provides cross-version support for Scala sources
// (https://www.scala-sbt.org/1.x/docs/Cross-Build.html#Scala-version+specific+source+directory).
// Unfortunately, it only includes directories like "scala_2.12" or "scala_2.13",
// not "scala_2.12.18" or "scala_2.13.12" that we need.
// not "scala_2.12.19" or "scala_2.13.13" that we need.
// That's why we have to work around here.
val base = (Compile / sourceDirectory).value
val versionDir = scalaVersion.value.replaceAll("-.*", "")
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
8 changes: 8 additions & 0 deletions plugin/src/main/scala-2.12.19/tools/SettingsOps.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package ch.epfl.scala.profilers.tools

import scala.tools.nsc.Global

object SettingsOps {
def areStatisticsEnabled(g: Global): Boolean =
g.settings.areStatisticsEnabled
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package ch.epfl.scala.profilers.tools

import scala.tools.nsc.Global

object SettingsOps {
def areStatisticsEnabled(g: Global): Boolean =
g.settings.areStatisticsEnabled
}
2 changes: 1 addition & 1 deletion project/BuildPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ object BuildImplementation {
Keys.organization := "ch.epfl.scala",
Keys.resolvers += Resolver.jcenterRepo,
Keys.updateOptions := Keys.updateOptions.value.withCachedResolution(true),
Keys.scalaVersion := "2.12.18",
Keys.scalaVersion := "2.12.19",
sbt.nio.Keys.watchTriggeredMessage := Watch.clearScreenOnTrigger,
BuildKeys.enableStatistics := true,
BuildKeys.showScalaInstances := BuildDefaults.showScalaInstances.value
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.8
sbt.version=1.9.9
2 changes: 1 addition & 1 deletion project/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ lazy val root = project
.settings(
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1"),
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.7"),
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.5"),
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.2.0"),
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12"),
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2"),
addSbtPlugin("com.github.sbt" % "sbt-ghpages" % "0.8.0"),
Expand Down
2 changes: 1 addition & 1 deletion project/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.8
sbt.version=1.9.9
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 699796a

Please sign in to comment.