Skip to content

Commit

Permalink
Close #372 - Update sbt plugins
Browse files Browse the repository at this point in the history
* sbt-ci-release to 1.6.1
* sbt-wartremover to 3.2.0
* sbt-scalafix to 0.12.1
* sbt-scalafmt to 2.5.2
* sbt-scoverage to 2.1.1
* sbt-mdoc to 2.5.4
* sbt-docusaur to 0.16.0
* sbt-tpolecat to 0.5.2
* com.github.xuwei-k:scalafix-rules to 0.4.5
  • Loading branch information
kevin-lee committed Aug 31, 2024
1 parent 3dda93d commit adb29c3
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 69 deletions.
16 changes: 1 addition & 15 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ThisBuild / licenses := props.licenses

ThisBuild / resolvers += props.SonatypeSnapshots

ThisBuild / scalafixDependencies += "com.github.xuwei-k" %% "scalafix-rules" % "0.3.0"
ThisBuild / scalafixDependencies += "com.github.xuwei-k" %% "scalafix-rules" % "0.4.5"

ThisBuild / scalafixConfig := (
if (scalaVersion.value.startsWith("3"))
Expand All @@ -38,20 +38,6 @@ ThisBuild / scalafixConfig := (
((ThisBuild / baseDirectory).value / ".scalafix-scala2.conf").some
)

ThisBuild / scalafixScalaBinaryVersion := {
val log = sLog.value
val newVersion = if (scalaVersion.value.startsWith("3")) {
(ThisBuild / scalafixScalaBinaryVersion).value
} else {
CrossVersion.binaryScalaVersion(scalaVersion.value)
}

log.info(
s">> Change ThisBuild / scalafixScalaBinaryVersion from ${(ThisBuild / scalafixScalaBinaryVersion).value} to $newVersion"
)
newVersion
}

lazy val refined4s = (project in file("."))
.enablePlugins(DevOopsGitHubReleasePlugin)
.settings(mavenCentralPublishSettings)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object InlinedInlinedRefinedSpec extends Properties {
def testUnsafeFromInvalid: Result = {
val expected = "Invalid value: []. It has to be a non-empty String but got \"\""
try {
MyType.unsafeFrom("")
val _ = MyType.unsafeFrom("")
Result.failure.log("""IllegalArgumentException was expected from MyType.unsafeFrom(""), but it was not thrown.""")
} catch {
case ex: IllegalArgumentException =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object InlinedRefinedType {
a.asTerm match {
case Inlined(_, _, Literal(IntConstant(num))) =>
try {
validate(num)
val _ = validate(num)
Expr(true)
} catch {
case _: Throwable => Expr(false)
Expand All @@ -35,7 +35,7 @@ object InlinedRefinedType {

override def predicate(a: Int): Boolean =
try {
validate(a)
val _ = validate(a)
true
} catch {
case _: Throwable => false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ object RefinedSpec extends Properties {
def testUnsafeFromInvalid: Result = {
val expected = "Invalid value: []. It has to be non-empty String but got \"\""
try {
MyType.unsafeFrom("")
val _ = MyType.unsafeFrom("")
Result.failure.log("""IllegalArgumentException was expected from MyType.unsafeFrom(""), but it was not thrown.""")
} catch {
case ex: IllegalArgumentException =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ object networkSpec extends Properties {
val expected = s"Invalid value: [$input]. It must be a URI String"

try {
Uri.unsafeFrom(input)
val _ = Uri.unsafeFrom(input)
Result
.failure
.log(
Expand Down Expand Up @@ -408,7 +408,7 @@ object networkSpec extends Properties {
val expected = s"Invalid value: [$input]. It must be a URL String"

try {
Url.unsafeFrom(input)
val _ = Url.unsafeFrom(input)
Result
.failure
.log(
Expand Down Expand Up @@ -586,7 +586,7 @@ object networkSpec extends Properties {
val expected = s"Invalid value: [$p]. It has to be Int between 0 and 65535 (0 <= PortNumber <= 65535)"

try {
PortNumber.unsafeFrom(p)
val _ = PortNumber.unsafeFrom(p)
Result
.failure
.log(
Expand Down Expand Up @@ -696,7 +696,7 @@ object networkSpec extends Properties {
val expected = s"Invalid value: [$p]. It has to be Int between 0 and 1023 (0 <= SystemPortNumber <= 1023)"

try {
SystemPortNumber.unsafeFrom(p)
val _ = SystemPortNumber.unsafeFrom(p)
Result
.failure
.log(
Expand Down Expand Up @@ -807,7 +807,7 @@ object networkSpec extends Properties {
val expected = s"Invalid value: [$p]. It has to be Int between 1024 and 65535 (1024 <= NonSystemPortNumber <= 65535)"

try {
NonSystemPortNumber.unsafeFrom(p)
val _ = NonSystemPortNumber.unsafeFrom(p)
Result
.failure
.log(
Expand Down Expand Up @@ -917,7 +917,7 @@ object networkSpec extends Properties {
val expected = s"Invalid value: [$p]. It has to be Int between 1024 and 49151 (1024 <= UserPortNumber <= 49151)"

try {
UserPortNumber.unsafeFrom(p)
val _ = UserPortNumber.unsafeFrom(p)
Result
.failure
.log(
Expand Down Expand Up @@ -1027,7 +1027,7 @@ object networkSpec extends Properties {
val expected = s"Invalid value: [$p]. It has to be Int between 49152 and 65535 (49152 <= DynamicPortNumber <= 65535)"

try {
DynamicPortNumber.unsafeFrom(p)
val _ = DynamicPortNumber.unsafeFrom(p)
Result
.failure
.log(
Expand Down
Loading

0 comments on commit adb29c3

Please sign in to comment.