Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii committed Oct 24, 2023
1 parent 1bea2da commit 71f1731
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 30 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/zio/jdbc/JdbcEncoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trait JdbcEncoder[-A] {
}

object JdbcEncoder extends JdbcEncoder0LowPriorityImplicits {
def apply[A](implicit encoder: JdbcEncoder[A]): JdbcEncoder[A] = encoder
def apply[A](implicit encoder: JdbcEncoder[A]): JdbcEncoder[A] = encoder
implicit val intEncoder: JdbcEncoder[Int] = value => sql"$value"
implicit val longEncoder: JdbcEncoder[Long] = value => sql"$value"
implicit val doubleEncoder: JdbcEncoder[Double] = value => sql"$value"
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/scala/zio/jdbc/ZConnection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -316,32 +316,32 @@ object ZConnection {

case object AutoCommit extends Flag {
val index = 1
val mask = 1 << index
val mask: Int = 1 << index
}

case object Catalog extends Flag {
val index = 2
val mask = 1 << index
val mask: Int = 1 << index
}

case object ClientInfo extends Flag {
val index = 3
val mask = 1 << index
val mask: Int = 1 << index
}

case object ReadOnly extends Flag {
val index = 4
val mask = 1 << index
val mask: Int = 1 << index
}

case object Schema extends Flag {
val index = 5
val mask = 1 << index
val mask: Int = 1 << index
}

case object TransactionIsolation extends Flag {
val index = 6
val mask = 1 << index
val mask: Int = 1 << index
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion core/src/test/scala/zio/jdbc/SqlFragmentSpec.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package zio.jdbc

import zio._
import zio.test._
import zio.jdbc.SqlFragment.Setter
import zio.jdbc.{ transaction => transact }
import zio.schema.{ Schema, TypeId }
import zio.test.Assertion._
import zio.test._

import java.sql.SQLException

final case class Person(name: String, age: Int)
Expand Down
29 changes: 8 additions & 21 deletions core/src/test/scala/zio/jdbc/TestConnection.scala
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
package zio.jdbc

import java.sql.{
Blob,
CallableStatement,
Clob,
Connection,
DatabaseMetaData,
NClob,
PreparedStatement,
SQLWarning,
SQLXML,
Savepoint,
Statement,
Struct,
ResultSet
}
import java.util.{ Properties, concurrent }
import java.{ sql, util }
import zio.RuntimeFlags

import java.io.{ InputStream, Reader }
import java.net.URL
import zio.RuntimeFlags
import java.sql.{Blob, CallableStatement, Clob, Connection, DatabaseMetaData, NClob, PreparedStatement, ResultSet, SQLWarning, SQLXML, Savepoint, Statement, Struct}
import java.util.{ Properties, concurrent }
import java.{ sql, util }

class TestConnection(failNext: Boolean = false, elems: Int = 0) extends Connection { self =>

Expand Down Expand Up @@ -174,7 +161,7 @@ class DummyPreparedStatement(failNext: Boolean, elemns: Int) extends PreparedSta

override def executeUpdate(sql: String) = ???

override def close() = closed = true
override def close(): Unit = closed = true

override def getMaxFieldSize() = ???

Expand Down Expand Up @@ -377,7 +364,7 @@ class DummyResultSet(failNext: Boolean, elems: Int) extends ResultSet {

override def isWrapperFor(x$1: Class[_ <: Object]) = ???

override def next() =
override def next(): Boolean =
if (failNext) {
throw new sql.SQLException()
} else if (currentElem < elems) {
Expand All @@ -387,7 +374,7 @@ class DummyResultSet(failNext: Boolean, elems: Int) extends ResultSet {
false
}

override def close() = closed = true
override def close(): Unit = closed = true

override def wasNull() = ???

Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/zio/jdbc/ZConnectionPoolSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import zio.test.Assertion._
import zio.test.TestAspect._
import zio.test._

import scala.util.Random
import java.sql.Connection
import scala.util.Random

object ZConnectionPoolSpec extends ZIOSpecDefault {
final case class Person(name: String, age: Int)
Expand Down
1 change: 1 addition & 0 deletions core/src/test/scala/zio/jdbc/ZConnectionSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package zio.jdbc

import zio.test._
import zio.{ Random, ZIO }

import java.sql.PreparedStatement

object ZConnectionSpec extends ZIOSpecDefault {
Expand Down

0 comments on commit 71f1731

Please sign in to comment.