Skip to content

Commit

Permalink
Add additional compiler flags to tighten up code
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydmeta committed Dec 16, 2016
1 parent 1578ea2 commit cb43483
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
20 changes: 19 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,25 @@ lazy val ideSettings = Seq(
lazy val compilerSettings = Seq(
// the name-hashing algorithm for the incremental compiler.
incOptions := incOptions.value.withNameHashing(nameHashing = true),
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature", "-Xlint", "-Xlog-free-terms")
scalacOptions ++= Seq(
"-Xlog-free-terms",
"-encoding",
"UTF-8", // yes, this is 2 args
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xfatal-warnings",
"-deprecation:false",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code", // N.B. doesn't work well with the ??? hole
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Xfuture",
"-Ywarn-unused-import" // 2.11 only
)
)

lazy val scoverageSettings = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ValueEnumJVMSpec extends FunSpec with Matchers {
)
testValuesOf(stringGenerator, "\"", "\"")
testValuesOf(
Stream.continually(Random.nextPrintableChar()).filter(Character.isAlphabetic(_)),
Stream.continually(Random.nextPrintableChar()).filter(c => Character.isAlphabetic(c.toInt)),
"'",
"'"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package enumeratum.values

import play.api.data.format.{Formats, Formatter}
import play.api.data.{FormError, Mapping}
import play.api.data.Mapping

/**
* Created by Lloyd on 4/13/16.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package enumeratum.values

import play.api.mvc.QueryStringBindable
import play.api.routing.sird.PathBindableExtractor

/**
* Created by Lloyd on 4/13/16.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package enumeratum

import reactivemongo.bson._

import scala.util.{Failure, Success}

/**
* Holds BSON reader and writer for [[enumeratum.Enum]]
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ trait BSONValueReads {
trait BSONValueWrites {

implicit val bsonWriterShort = new BSONWriter[Short, BSONValue] {
def write(t: Short): BSONValue = BSONInteger(t)
def write(t: Short): BSONValue = BSONInteger(t.toInt)
}

implicit val bsonWriterInt = new BSONWriter[Int, BSONValue] {
Expand All @@ -101,7 +101,7 @@ trait BSONValueWrites {
}

implicit val bsonWriterByte = new BSONWriter[Byte, BSONValue] {
def write(t: Byte): BSONValue = BSONInteger(t)
def write(t: Byte): BSONValue = BSONInteger(t.toInt)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package enumeratum.values

import reactivemongo.bson._

import scala.util.{Failure, Success, Try}

/**
* @author Alessandro Lacava (@lambdista)
* @since 2016-04-23
Expand Down

0 comments on commit cb43483

Please sign in to comment.