Skip to content

Commit

Permalink
scala3 fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanlas committed Oct 3, 2023
1 parent 8feaeaa commit bb86821
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 21 deletions.
4 changes: 3 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version = "3.7.14"

runner.dialect = "scala213"
runner.dialect = "scala213source3"

fileOverride {
"glob:**.sbt" {
Expand Down Expand Up @@ -48,3 +48,5 @@ docstrings.blankFirstLine = yes

includeNoParensInSelectChains = true
optIn.breakChainOnFirstMethodDot = true

rewrite.scala3.convertToNewSyntax = true
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.htmlism.spawningpool

import scala.concurrent.ExecutionContext.Implicits.global

import com.htmlism.spawningpool.combinatorics._
import com.htmlism.spawningpool.combinatorics.*

object VectorVsArray extends App {
Benchmark(
Expand Down
20 changes: 10 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sbtrelease.ReleaseStateTransformations._
import sbtrelease.ReleaseStateTransformations.*

val commonSettings = Seq(
organization := "com.htmlism",
Expand All @@ -7,33 +7,33 @@ val commonSettings = Seq(
)

lazy val core = Project("spawning-pool-core", file("spawning-pool-core"))
.settings(commonSettings: _*)
.settings(specs2: _*)
.settings(commonSettings*)
.settings(specs2*)
.settings(betterConsole)

lazy val coreAlpha =
Project("spawning-pool-core-alpha", file("spawning-pool-core-alpha"))
.settings(commonSettings: _*)
.settings(fs2: _*)
.settings(specs2: _*)
.settings(commonSettings*)
.settings(fs2*)
.settings(specs2*)
.settings(betterConsole)

lazy val coreCats =
Project("spawning-pool-scalaz", file("spawning-pool-scalaz"))
.settings(commonSettings: _*)
.settings(commonSettings*)
.dependsOn(coreAlpha)

lazy val shapelessMutation = Project("spawning-pool-shapeless-mutation", file("spawning-pool-shapeless-mutation"))
.settings(commonSettings: _*)
.settings(commonSettings*)
.settings(shapeless)
.dependsOn(coreAlpha)

lazy val benchmark = project
.settings(commonSettings: _*)
.settings(commonSettings*)
.dependsOn(core)

lazy val root = Project("spawning-pool", file("."))
.settings(commonSettings: _*)
.settings(commonSettings*)
.aggregate(core, benchmark, coreAlpha)

releaseProcess := Seq(
Expand Down
2 changes: 1 addition & 1 deletion project/CatsEffectForkPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object CatsEffectForkPlugin extends AutoPlugin {

// cats-effect prefers to run in its own main thread
// https://github.com/typelevel/cats-effect/pull/3774
override val buildSettings: Seq[Setting[_]] = Seq(
override val buildSettings: Seq[Setting[?]] = Seq(
fork := true
)
}
6 changes: 3 additions & 3 deletions project/LintingPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sbt.Keys._
import sbt._
import scalafix.sbt.ScalafixPlugin.autoImport._
import sbt.Keys.*
import sbt.*
import scalafix.sbt.ScalafixPlugin.autoImport.*

object LintingPlugin extends AutoPlugin {
override def trigger =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.htmlism.spawningpool

import com.htmlism.spawningpool.generation._
import com.htmlism.spawningpool.generation.*

/**
* A trait that represents a nullary operation for generating chromosomes of `A`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.htmlism.spawningpool

import scala.annotation.tailrec
import scala.concurrent._
import scala.concurrent.duration._
import scala.concurrent.*
import scala.concurrent.duration.*

object Solver {
val DEFAULT_POPULATION_SIZE = PositiveCount(50)
Expand Down Expand Up @@ -82,7 +82,7 @@ class Solver[A, B](
mutationRate: Double = Solver.DEFAULT_MUTATION_RATE,
generations: PositiveCount = Solver.DEFAULT_GENERATION_COUNT
)(implicit evolver: Evolver[A], ordering: Ordering[B]) {
import com.htmlism.spawningpool.Solver._
import com.htmlism.spawningpool.Solver.*

type Population = Vector[A]
type Solutions = Set[A]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.htmlism.spawningpool

import org.specs2.mutable.Specification

import com.htmlism.spawningpool.Solver._
import com.htmlism.spawningpool.Solver.*

class SolverSpec extends Specification {
"The solver" should {
Expand Down

0 comments on commit bb86821

Please sign in to comment.