Skip to content

Commit

Permalink
Remove manually set lint options, fix warnings in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdziuban committed Feb 22, 2024
1 parent 323745c commit a24f174
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package andxor.template
object TypesTest {
def apply(tpeLists: List[(List[String], Int)]) =
s"""
import andxor.AndXorProperties.arbitrary.*
import andxor.scalacheck.given
import org.scalacheck.{Arbitrary, Properties}
import cats.{Apply, Eq, Functor}
Expand Down Expand Up @@ -51,7 +50,7 @@ object arbitrary {
}

${tpeLists.map { case (_tpes, i) =>
val tpes = _tpes.zipWithIndex.map { case (t, j) => if (j % 2 == 0) "String" else "Int" }
val tpes = _tpes.zipWithIndex.map { case (_, j) => if (j % 2 == 0) "String" else "Int" }
val prodName = s"Prod${i}"
val fTpes = (F: String) => tpes.map(t => s"$F[$t]")
val prodTpe = (F: String) => (fTpes(F) :+ "EmptyTuple").mkString(" *: ")
Expand Down
6 changes: 0 additions & 6 deletions scala-3/project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ object Build extends CommonBuild {
val scalaVersions = Seq("3.3.1")

val lintOpts = Seq(
"-Wvalue-discard",
"-Wunused:implicits",
"-Wunused:imports",
"-Wunused:locals",
"-Wunused:params",
"-Wunused:privates",
"-Wunused:unsafe-warn-patvars",
)

Expand Down
17 changes: 9 additions & 8 deletions scala-3/tests/src/test/scala/andxor/AndXorProperties.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package andxor
import cats.{~>, Applicative, Eq, Id}
import cats.syntax.apply.*
import org.scalacheck.{Arbitrary, Prop, PropFromFun, Properties}
import scala.util.chaining.*

object AndXorProperties {
object arbitrary {
Expand Down Expand Up @@ -37,8 +38,8 @@ object AndXorProperties {

def laws[F[_[_]]](implicit F: FFunctor[F], af: Arbitrary[F[Option]], axy: Arbitrary[Option ~> Option], ef: Eq[F[Option]]): Properties =
newProperties("ffunctor") { p =>
p.property.update("identity", identity[F, Option]): Unit
p.property.update("composite", composite[F, Option, Option, Option]): Unit
p.property.update("identity", identity[F, Option]).pipe(_ => ())
p.property.update("composite", composite[F, Option, Option, Option]).pipe(_ => ())
}
}

Expand Down Expand Up @@ -76,13 +77,13 @@ object AndXorProperties {
import arbitrary.*

p.include(ffunctor.laws[F])
p.property.update("identity", identity[F, TC, Option, Option]): Unit
p.property.update("purity.list", purity[F, TC, List, Option]): Unit
p.property.update("purity.stream", purity[F, TC, Vector, Option]): Unit
p.property.update("sequential fusion", sequentialFusion[F, TC, Id, Id, Option, Option, Option]): Unit
p.property.update("identity", identity[F, TC, Option, Option]).pipe(_ => ())
p.property.update("purity.list", purity[F, TC, List, Option]).pipe(_ => ())
p.property.update("purity.stream", purity[F, TC, Vector, Option]).pipe(_ => ())
p.property.update("sequential fusion", sequentialFusion[F, TC, Id, Id, Option, Option, Option]).pipe(_ => ())
p.property.update("naturality", naturality[F, TC, Vector, List, Option](
new (List ~> Vector) { def apply[A](l: List[A]): Vector[A] = l.toVector })): Unit
p.property.update("parallel fusion", parallelFusion[F, TC, Id, Id, Option, Option]): Unit
new (List ~> Vector) { def apply[A](l: List[A]): Vector[A] = l.toVector })).pipe(_ => ())
p.property.update("parallel fusion", parallelFusion[F, TC, Id, Id, Option, Option]).pipe(_ => ())
}
}
}
1 change: 0 additions & 1 deletion scala-3/tests/src/test/scala/andxor/TypesTest.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package andxor


import andxor.AndXorProperties.arbitrary.*
import andxor.scalacheck.given
import org.scalacheck.{Arbitrary, Properties}
import cats.{Apply, Eq, Functor}
Expand Down

0 comments on commit a24f174

Please sign in to comment.