From a5259f0f53eddb2ec1c63092f0ee477eab5c4950 Mon Sep 17 00:00:00 2001 From: paweliwanow Date: Thu, 21 Nov 2019 23:28:46 +0100 Subject: [PATCH] #51 Update sbt-scoverage to 1.6.1, re-enable test coverage and formatter removed unnecessary empty lines --- .travis.yml | 2 +- .../foundationdb4s/streams/InfinitePollingSubspaceSource.scala | 2 -- .../foundationdb4s/streams/SubspaceGraphStageLogic.scala | 1 - .../pwliwanow/foundationdb4s/streams/SubspaceSource.scala | 2 -- .../streams/InfinitePollingSubspaceSourceSpec.scala | 2 -- .../pwliwanow/foundationdb4s/streams/SubspaceSourceSpec.scala | 2 -- .../github/pwliwanow/foundationdb4s/core/AsyncIterator.scala | 2 -- .../scala/com/github/pwliwanow/foundationdb4s/core/DBIO.scala | 2 -- .../com/github/pwliwanow/foundationdb4s/core/ReadDBIO.scala | 2 -- .../foundationdb4s/core/RefreshingSubspaceStream.scala | 1 - .../foundationdb4s/core/SubspaceWithVersionstampedKeys.scala | 2 -- .../foundationdb4s/core/SubspaceWithVersionstampedValues.scala | 2 -- .../foundationdb4s/core/internal/CompletableFutureHolder.scala | 2 -- .../foundationdb4s/core/internal/TransactionalM.scala | 3 --- .../com/github/pwliwanow/foundationdb4s/core/DBIOSpec.scala | 2 -- .../pwliwanow/foundationdb4s/core/FoundationDbSpec.scala | 1 - .../github/pwliwanow/foundationdb4s/core/ReadDBIOSpec.scala | 2 -- .../foundationdb4s/core/RefreshingSubspaceStreamSpec.scala | 2 -- .../core/SubspaceWithVersionstampedKeysSpec.scala | 1 - .../core/SubspaceWithVersionstampedValuesSpec.scala | 1 - .../pwliwanow/foundationdb4s/core/TypedSubspaceSpec.scala | 1 - project/Dependencies.scala | 1 - project/plugins.sbt | 2 +- .../pwliwanow/foundationdb4s/schema/DerivedDecoder.scala | 1 - .../pwliwanow/foundationdb4s/schema/DerivedEncoder.scala | 2 -- .../com/github/pwliwanow/foundationdb4s/schema/Prefix.scala | 1 - .../com/github/pwliwanow/foundationdb4s/schema/Schema.scala | 3 --- .../github/pwliwanow/foundationdb4s/schema/TupleDecoder.scala | 3 --- .../github/pwliwanow/foundationdb4s/schema/TupleEncoder.scala | 1 - .../pwliwanow/foundationdb4s/schema/EncoderDecoderSpec.scala | 3 --- .../github/pwliwanow/foundationdb4s/schema/NamespaceSpec.scala | 2 -- 31 files changed, 2 insertions(+), 54 deletions(-) diff --git a/.travis.yml b/.travis.yml index cda16d8..8ade15c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,6 @@ install: - wget https://www.foundationdb.org/downloads/6.1.8/ubuntu/installers/foundationdb-server_6.1.8-1_amd64.deb - sudo dpkg -i foundationdb-clients_6.1.8-1_amd64.deb foundationdb-server_6.1.8-1_amd64.deb script: - - sbt test:scalafmt scalafmtSbt +test + - sbt test:scalafmt scalafmtSbt coverage +test coverageReport after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/InfinitePollingSubspaceSource.scala b/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/InfinitePollingSubspaceSource.scala index 7adc914..2a6a384 100644 --- a/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/InfinitePollingSubspaceSource.scala +++ b/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/InfinitePollingSubspaceSource.scala @@ -21,7 +21,6 @@ import scala.concurrent.duration.FiniteDuration * - poll subspace after it reaches the end */ object InfinitePollingSubspaceSource { - def from[Entity, KeyRepr]( subspace: TypedSubspace[Entity, KeyRepr], database: Database, @@ -69,7 +68,6 @@ private final class InfinitePollingSubspaceSource[Entity]( pollingInterval: FiniteDuration, createStream: ExecutionContextExecutor => RefreshingSubspaceStream[Entity]) extends GraphStage[SourceShape[Entity]] { - private val out: Outlet[Entity] = Outlet("InfinitePollingSubspaceSource.out") override def shape: SourceShape[Entity] = SourceShape(out) diff --git a/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceGraphStageLogic.scala b/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceGraphStageLogic.scala index f370c2a..8f0911c 100644 --- a/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceGraphStageLogic.scala +++ b/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceGraphStageLogic.scala @@ -67,5 +67,4 @@ private[streams] abstract class SubspaceGraphStageLogic[Entity]( private def createFailStageCallback(): AsyncCallback[Throwable] = getAsyncCallback[Throwable](failStage) - } diff --git a/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceSource.scala b/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceSource.scala index aa22471..0296757 100644 --- a/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceSource.scala +++ b/akka-streams/src/main/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceSource.scala @@ -63,7 +63,6 @@ object SubspaceSource { private final class SubspaceSource[Entity]( createStream: ExecutionContextExecutor => RefreshingSubspaceStream[Entity]) extends GraphStage[SourceShape[Entity]] { - private val out: Outlet[Entity] = Outlet("SubspaceSource.out") override def shape: SourceShape[Entity] = SourceShape(out) @@ -73,5 +72,4 @@ private final class SubspaceSource[Entity]( override protected def endReached(): Unit = completeStage() } } - } diff --git a/akka-streams/src/test/scala/com/github/pwliwanow/foundationdb4s/streams/InfinitePollingSubspaceSourceSpec.scala b/akka-streams/src/test/scala/com/github/pwliwanow/foundationdb4s/streams/InfinitePollingSubspaceSourceSpec.scala index 883696f..d23d61d 100644 --- a/akka-streams/src/test/scala/com/github/pwliwanow/foundationdb4s/streams/InfinitePollingSubspaceSourceSpec.scala +++ b/akka-streams/src/test/scala/com/github/pwliwanow/foundationdb4s/streams/InfinitePollingSubspaceSourceSpec.scala @@ -10,7 +10,6 @@ import com.github.pwliwanow.foundationdb4s.core.FriendEntity import scala.concurrent.duration._ class InfinitePollingSubspaceSourceSpec extends FoundationDbStreamsSpec { - private val entity = FriendEntity( ofUserId = 1L, @@ -42,5 +41,4 @@ class InfinitePollingSubspaceSourceSpec extends FoundationDbStreamsSpec { private def entityFromInt(i: Int): FriendEntity = { entity.copy(addedAt = entity.addedAt.plusSeconds(i.toLong), friendId = entity.friendId + i) } - } diff --git a/akka-streams/src/test/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceSourceSpec.scala b/akka-streams/src/test/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceSourceSpec.scala index 0a1ae35..4dd2c66 100644 --- a/akka-streams/src/test/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceSourceSpec.scala +++ b/akka-streams/src/test/scala/com/github/pwliwanow/foundationdb4s/streams/SubspaceSourceSpec.scala @@ -13,7 +13,6 @@ import scala.concurrent.Future import scala.util.{Failure, Try} class SubspaceSourceSpec extends FoundationDbStreamsSpec { - private val entity = FriendEntity( ofUserId = 1L, @@ -92,5 +91,4 @@ class SubspaceSourceSpec extends FoundationDbStreamsSpec { private def entityFromInt(i: Int): FriendEntity = { entity.copy(addedAt = entity.addedAt.plusSeconds(i.toLong), friendId = entity.friendId + i) } - } diff --git a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/AsyncIterator.scala b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/AsyncIterator.scala index 9913a5c..ec453ee 100644 --- a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/AsyncIterator.scala +++ b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/AsyncIterator.scala @@ -11,7 +11,6 @@ import scala.compat.java8.FutureConverters._ * - it does not extend [[java.util.Iterator]], so it also does not expose blocking `hasNext()` operation */ trait AsyncIterator[A] { - def onHasNext(): Future[Boolean] /** Similar to [[FdbAsyncIterator.hasNext]] method. @@ -24,7 +23,6 @@ trait AsyncIterator[A] { /** Cancels any outstanding asynchronous work associated with this [[AsyncIterator]]. */ def cancel(): Unit - } object AsyncIterator { diff --git a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/DBIO.scala b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/DBIO.scala index 88483c7..8efec17 100644 --- a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/DBIO.scala +++ b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/DBIO.scala @@ -14,7 +14,6 @@ import scala.concurrent.{ExecutionContextExecutor, Future} import scala.util.Try final case class DBIO[+A] private (private val underlying: TransactionalM[Transaction, A]) { - def map[B](f: A => B): DBIO[B] = { DBIO(underlying.map(f)) } @@ -206,5 +205,4 @@ object DBIO { } } } - } diff --git a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/ReadDBIO.scala b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/ReadDBIO.scala index 7b79a75..fbe093e 100644 --- a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/ReadDBIO.scala +++ b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/ReadDBIO.scala @@ -12,7 +12,6 @@ import scala.concurrent.{ExecutionContextExecutor, Future} import scala.util.Try final case class ReadDBIO[+A] private (private val underlying: TransactionalM[ReadTransaction, A]) { - def map[B](f: A => B): ReadDBIO[B] = { ReadDBIO(underlying.map(f)) } @@ -111,5 +110,4 @@ object ReadDBIO { } } } - } diff --git a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/RefreshingSubspaceStream.scala b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/RefreshingSubspaceStream.scala index 02f5e26..8ee6077 100644 --- a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/RefreshingSubspaceStream.scala +++ b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/RefreshingSubspaceStream.scala @@ -178,5 +178,4 @@ private final class SubspaceStream( } private def closeTx(): Unit = Try(tx.foreach(_.close())).getOrElse(()) - } diff --git a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedKeys.scala b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedKeys.scala index 0c5adac..78a3698 100644 --- a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedKeys.scala +++ b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedKeys.scala @@ -8,7 +8,6 @@ import scala.util.Try * whose Keys contain [[Versionstamp]]. */ trait SubspaceWithVersionstampedKeys[Entity, Key] extends TypedSubspace[Entity, Key] { - protected def extractVersionstamp(key: Key): Versionstamp override def toSubspaceKey(key: Key): Array[Byte] = { @@ -32,5 +31,4 @@ trait SubspaceWithVersionstampedKeys[Entity, Key] extends TypedSubspace[Entity, else Try(tx.mutate(MutationType.SET_VERSIONSTAMPED_KEY, packedKey, packedValue)) } } - } diff --git a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedValues.scala b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedValues.scala index b6946ea..1262692 100644 --- a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedValues.scala +++ b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedValues.scala @@ -11,7 +11,6 @@ import scala.util.Try * otherwise it would not be possible to use [[Versionstamp]] correctly. */ trait SubspaceWithVersionstampedValues[Entity, Key] extends TypedSubspace[Entity, Key] { - protected def extractVersionstamp(entity: Entity): Versionstamp protected def toTupledValue(entity: Entity): Tuple protected def toEntity(key: Key, tupledValue: Tuple): Entity @@ -35,5 +34,4 @@ trait SubspaceWithVersionstampedValues[Entity, Key] extends TypedSubspace[Entity else Try(tx.mutate(MutationType.SET_VERSIONSTAMPED_VALUE, packedKey, packedValue)) } } - } diff --git a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/internal/CompletableFutureHolder.scala b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/internal/CompletableFutureHolder.scala index 6538208..52f71d5 100644 --- a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/internal/CompletableFutureHolder.scala +++ b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/internal/CompletableFutureHolder.scala @@ -12,7 +12,6 @@ private[foundationdb4s] object CompletableFutureHolder { private[foundationdb4s] class CompletableFutureHolder[A](val value: CompletableFuture[A]) extends AnyVal { - def completeWithTry(result: Try[A]): Boolean = result match { case Success(v) => value.complete(v) case Failure(t) => value.completeExceptionally(t) @@ -52,5 +51,4 @@ private[foundationdb4s] class CompletableFutureHolder[A](val value: CompletableF def zip[B](other: CompletableFuture[B]): CompletableFuture[(A, B)] = { value.thenCompose(a => other.thenApply(b => (a, b))) } - } diff --git a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/internal/TransactionalM.scala b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/internal/TransactionalM.scala index f1a8018..1464870 100644 --- a/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/internal/TransactionalM.scala +++ b/core/src/main/scala/com/github/pwliwanow/foundationdb4s/core/internal/TransactionalM.scala @@ -61,11 +61,9 @@ private[foundationdb4s] abstract class TransactionalM[Tx <: ReadTransactionConte } } } - } private[foundationdb4s] object TransactionalM { - private[foundationdb4s] def pure[Tx <: ReadTransactionContext, A]( value: A): TransactionalM[Tx, A] = { Pure(value) @@ -103,5 +101,4 @@ private[foundationdb4s] object TransactionalM { private final case class RaiseError[Tx <: ReadTransactionContext, A](ex: Throwable) extends TransactionalM[Tx, A] - } diff --git a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/DBIOSpec.scala b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/DBIOSpec.scala index f0a28af..0cdfca1 100644 --- a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/DBIOSpec.scala +++ b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/DBIOSpec.scala @@ -14,7 +14,6 @@ import scala.concurrent.blocking import scala.util.{Failure, Success, Try} class DBIOSpec extends FoundationDbSpec { - private val monadLaws = MonadLaws[DBIO] private val applicativeLaws = ApplicativeLaws[DBIO.Par] private val parLaws = ParallelLaws[DBIO, DBIO.Par] @@ -253,5 +252,4 @@ class DBIOSpec extends FoundationDbSpec { private def assertParDbioEq[A](isEq: IsEq[DBIO.Par[A]]): Assertion = { assertDbioEq(IsEq(Par.unwrap(isEq.lhs), Par.unwrap(isEq.rhs))) } - } diff --git a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/FoundationDbSpec.scala b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/FoundationDbSpec.scala index 88ba97f..e3e4811 100644 --- a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/FoundationDbSpec.scala +++ b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/FoundationDbSpec.scala @@ -111,7 +111,6 @@ trait FoundationDbSpec extends FlatSpecLike with TableDrivenPropertyChecks with case _ => assert(left === right) } - } final case class FriendEntity(ofUserId: Long, addedAt: Instant, friendId: Long, friendName: String) diff --git a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/ReadDBIOSpec.scala b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/ReadDBIOSpec.scala index 5c8eb0b..92babca 100644 --- a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/ReadDBIOSpec.scala +++ b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/ReadDBIOSpec.scala @@ -13,7 +13,6 @@ import scala.concurrent.blocking import scala.util.Try class ReadDBIOSpec extends FoundationDbSpec { - private val monadLaws = MonadLaws[ReadDBIO] private val applicativeLaws = ApplicativeLaws[ReadDBIO.Par] private val parLaws = ParallelLaws[ReadDBIO, ReadDBIO.Par] @@ -226,5 +225,4 @@ class ReadDBIOSpec extends FoundationDbSpec { private def assertParDbioEq[A](isEq: IsEq[ReadDBIO.Par[A]]): Assertion = { assertReadDbioEq(IsEq(ReadDBIO.Par.unwrap(isEq.lhs), ReadDBIO.Par.unwrap(isEq.rhs))) } - } diff --git a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/RefreshingSubspaceStreamSpec.scala b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/RefreshingSubspaceStreamSpec.scala index dd03453..172ea5d 100644 --- a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/RefreshingSubspaceStreamSpec.scala +++ b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/RefreshingSubspaceStreamSpec.scala @@ -25,7 +25,6 @@ class RefreshingSubspaceStreamSpec extends FoundationDbSpec with MockitoSugar with BeforeAndAfterAll { - private val entity = FriendEntity( ofUserId = 1L, @@ -301,5 +300,4 @@ class RefreshingSubspaceStreamSpec override def cancel(): Unit = underlying.cancel() } } - } diff --git a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedKeysSpec.scala b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedKeysSpec.scala index cfb0758..f228f58 100644 --- a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedKeysSpec.scala +++ b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedKeysSpec.scala @@ -44,5 +44,4 @@ class SubspaceWithVersionstampedKeysSpec extends FoundationDbSpec { spec => assert(futureResult.await === Some(Event(versionstamp, value))) } } - } diff --git a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedValuesSpec.scala b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedValuesSpec.scala index 9f5d556..27d6231 100644 --- a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedValuesSpec.scala +++ b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/SubspaceWithVersionstampedValuesSpec.scala @@ -41,5 +41,4 @@ class SubspaceWithVersionstampedValuesSpec extends FoundationDbSpec { spec => assert(result === Some(Event(key, versionstamp))) } } - } diff --git a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/TypedSubspaceSpec.scala b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/TypedSubspaceSpec.scala index a75b4ce..c152202 100644 --- a/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/TypedSubspaceSpec.scala +++ b/core/src/test/scala/com/github/pwliwanow/foundationdb4s/core/TypedSubspaceSpec.scala @@ -339,5 +339,4 @@ class TypedSubspaceSpec extends FoundationDbSpec { spec => val v = new Tuple().add(entity.friendId).add(entity.friendName) k -> v } - } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index c923dbd..b9e8ae3 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -2,7 +2,6 @@ import sbt._ import scala.collection.immutable.Seq object Dependencies { - lazy val allAkkaStreamsDependencies: Seq[ModuleID] = { val akkaVersion = "2.5.26" val akkaStreams = "com.typesafe.akka" %% "akka-stream" % akkaVersion diff --git a/project/plugins.sbt b/project/plugins.sbt index 575d53c..f6d5604 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.2.1") addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.12") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0") diff --git a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/DerivedDecoder.scala b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/DerivedDecoder.scala index 5dd398f..3978b3f 100644 --- a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/DerivedDecoder.scala +++ b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/DerivedDecoder.scala @@ -24,7 +24,6 @@ abstract class ReprDecoder[A] extends TupleDecoder[A] /** Provides automatic derivation for HList-based structures. */ object ReprDecoder { - implicit object HnilDecoder extends ReprDecoder[HNil] { override def decode(tuple: Tuple): HNil = HNil override def decode(tuple: Tuple, index: Int): HNil = HNil diff --git a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/DerivedEncoder.scala b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/DerivedEncoder.scala index 3657d9d..87ca259 100644 --- a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/DerivedEncoder.scala +++ b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/DerivedEncoder.scala @@ -23,7 +23,6 @@ abstract class ReprEncoder[A] extends TupleEncoder[A] /** Provides automatic derivation for HList-based structures. */ object ReprEncoder { - implicit object HnilEncoder extends ReprEncoder[HNil] { override def encode(value: HNil): Tuple = new Tuple() override def encode(value: HNil, acc: Tuple, preceedingNulls: Int): (Tuple, Int) = @@ -43,5 +42,4 @@ object ReprEncoder { tEncoder.value.encode(t, hEncoded, numberOfNulls) } } - } diff --git a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/Prefix.scala b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/Prefix.scala index 0c904e9..fa03b01 100644 --- a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/Prefix.scala +++ b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/Prefix.scala @@ -15,7 +15,6 @@ trait Prefix[L <: HList, Prefix <: HList] extends Serializable { object Prefix extends PrefixDerivation trait PrefixDerivation { - implicit def hlistPrefixNil[L <: HList]: Prefix[L, HNil] = new Prefix[L, HNil] { override def apply(x: L): HNil = HNil } diff --git a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/Schema.scala b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/Schema.scala index 3970092..dc1aa5a 100644 --- a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/Schema.scala +++ b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/Schema.scala @@ -45,7 +45,6 @@ trait Schema { schema => keyDecoder: ReprDecoder[KeySchema], valueDecoder: ReprDecoder[ValueSchema]) extends TypedSubspace[Entity, KeySchema] { - final override def toKey(entity: Entity): KeySchema = schema.toKey(entity) final override def toRawValue(entity: Entity): Array[Byte] = @@ -187,7 +186,5 @@ trait Schema { schema => new Range(start, end) } } - } - } diff --git a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/TupleDecoder.scala b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/TupleDecoder.scala index da773c0..885a127 100644 --- a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/TupleDecoder.scala +++ b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/TupleDecoder.scala @@ -29,7 +29,6 @@ trait TupleDecoder[A] { self => } object TupleDecoder extends BasicDecodersProtocol { - /** Derives [[TupleDecoder]] for [[A]] type parameter. * * Derivation will succeed only if there exist implicit @@ -39,7 +38,6 @@ object TupleDecoder extends BasicDecodersProtocol { } trait BasicDecodersProtocol { - implicit object IntDecoder extends TupleDecoder[Int] { override def decode(tuple: Tuple): Int = decode(tuple, 0) override def decode(tuple: Tuple, index: Int): Int = decodeInt(tuple.getBytes(index)) @@ -101,5 +99,4 @@ trait BasicDecodersProtocol { if (value.length != 4) throw new IllegalArgumentException("Array must be of size 4") ByteBuffer.wrap(value).getInt } - } diff --git a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/TupleEncoder.scala b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/TupleEncoder.scala index f5d7513..6c01772 100644 --- a/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/TupleEncoder.scala +++ b/schema/src/main/scala/com/github/pwliwanow/foundationdb4s/schema/TupleEncoder.scala @@ -37,7 +37,6 @@ trait TupleEncoder[A] { self => } object TupleEncoder extends BasicEncoders { - /** Derives [[TupleEncoder]] for [[A]] type parameter. * * Derivation will succeed only if there exist implicit diff --git a/schema/src/test/scala/com/github/pwliwanow/foundationdb4s/schema/EncoderDecoderSpec.scala b/schema/src/test/scala/com/github/pwliwanow/foundationdb4s/schema/EncoderDecoderSpec.scala index a0cefcf..9ccb8ef 100644 --- a/schema/src/test/scala/com/github/pwliwanow/foundationdb4s/schema/EncoderDecoderSpec.scala +++ b/schema/src/test/scala/com/github/pwliwanow/foundationdb4s/schema/EncoderDecoderSpec.scala @@ -8,7 +8,6 @@ import com.github.pwliwanow.foundationdb4s.schema.TestCodecs.Age import org.scalatest.FlatSpec object TestCodecs { - case class Age(value: Int) extends AnyVal case class Inner(age: Age) @@ -42,7 +41,6 @@ object OverridenCodecs { } class EncoderDecoderSpec extends FlatSpec { - it should "encode and decode back values with missing values" in { import TestCodecs._ val value = @@ -262,5 +260,4 @@ class EncoderDecoderSpec extends FlatSpec { } private def decodeInt(bytes: Array[Byte]): Int = ByteBuffer.wrap(bytes).getInt - } diff --git a/schema/src/test/scala/com/github/pwliwanow/foundationdb4s/schema/NamespaceSpec.scala b/schema/src/test/scala/com/github/pwliwanow/foundationdb4s/schema/NamespaceSpec.scala index 25e930b..97f54b2 100644 --- a/schema/src/test/scala/com/github/pwliwanow/foundationdb4s/schema/NamespaceSpec.scala +++ b/schema/src/test/scala/com/github/pwliwanow/foundationdb4s/schema/NamespaceSpec.scala @@ -29,7 +29,6 @@ object UserSchema extends Schema { val lastName :: city :: yearOfBirth :: HNil = key User(UserKey(lastName, city, yearOfBirth), registeredAt) } - } class NamespaceSpec extends FoundationDbSpec { spec => @@ -263,5 +262,4 @@ class NamespaceSpec extends FoundationDbSpec { spec => } } } - }