Skip to content

Commit 963e9ad

Browse files
committed
Upgrade to sbt-houserules 0.3.0
1 parent ce40f23 commit 963e9ad

File tree

6 files changed

+13
-23
lines changed

6 files changed

+13
-23
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
.bsp/
12
.scalafmt.conf
23
target/

build.sbt

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
22

3-
val SilencerVersion = "1.6.0"
3+
val SilencerVersion = "1.7.1"
44
val TestfVersion = "0.1.4"
55

66
lazy val color = project
@@ -15,17 +15,16 @@ lazy val core = crossProject(JVMPlatform, JSPlatform)
1515
.crossType(CrossType.Pure)
1616
.settings(sonatypePublishSettings)
1717
.settings(
18-
addCompilerPlugin(
19-
"com.github.ghik" % "silencer-plugin" % SilencerVersion cross CrossVersion.full
20-
),
2118
initialCommands in console +=
2219
"""import io.taig.color._
2320
|import io.taig.color.implicits._""".stripMargin,
2421
libraryDependencies ++=
25-
("com.github.ghik" % "silencer-lib" % SilencerVersion % "provided" cross CrossVersion.full) ::
22+
compilerPlugin("com.github.ghik" % "silencer-plugin" % SilencerVersion cross CrossVersion.full) ::
23+
("com.github.ghik" % "silencer-lib" % SilencerVersion % "provided" cross CrossVersion.full) ::
2624
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided" ::
2725
"io.taig" %%% "testf-auto" % TestfVersion % "test" ::
2826
"io.taig" %%% "testf-runner-sbt" % TestfVersion % "test" ::
2927
Nil,
28+
name := "color-core",
3029
testFrameworks += new TestFramework("io.taig.testf.runner.TestF")
3130
)

core/.jvm/src/test/scala/io/taig/color/JavaColorTest.scala

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import io.taig.testf.{AutoTest, IOAutoTestApp}
88
object JavaColorTest extends IOAutoTestApp {
99
test("toAwt / fromAwt") {
1010
test("#FFAACC33") {
11-
fromRight(Color.parseHex("#FFAACC33")).flatMap { color =>
12-
isEqual(color)(Color.fromAwt(color.toAwt))
13-
}
11+
fromRight(Color.parseHex("#FFAACC33")).flatMap { color => isEqual(color)(Color.fromAwt(color.toAwt)) }
1412
}
1513
}
1614
}

core/src/main/scala/io/taig/color/Color.scala

+1-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ object Color {
7878
* `0x00000F` or even `0x0000000F`.
7979
*/
8080
def fromHex(value: Long, digits: Int): Either[String, Color] = {
81-
val channel: Long => Channel = value =>
82-
Channel.unsafeFromUnsignedShort(value.toShort)
81+
val channel: Long => Channel = value => Channel.unsafeFromUnsignedShort(value.toShort)
8382

8483
if (value < 0x00 || value > 0XFFFFFFFFL)
8584
Left("Color value must be between 0x00000000 and 0xFFFFFFFF")

core/src/main/scala/io/taig/color/implicits.scala

+4-11
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,18 @@ object implicits {
1111

1212
object ColorInterpolator {
1313
@silent
14-
def rgb_impl(
15-
context: blackbox.Context
16-
)(arguments: context.Expr[Any]*): context.Expr[Color] = {
14+
def rgb_impl(context: blackbox.Context)(arguments: context.Expr[Any]*): context.Expr[Color] = {
1715
import context.universe._
1816

1917
context.prefix.tree match {
20-
case Apply(
21-
_,
22-
List(Apply(_, List(literal @ Literal(Constant(value: String)))))
23-
) =>
18+
case Apply(_, List(Apply(_, List(literal @ Literal(Constant(value: String)))))) =>
2419
Color.parseHex(value) match {
2520
case Right(_) =>
2621
val expression: context.Expr[String] = context.Expr(literal)
2722
reify(Color.unsafeParseHex(expression.splice))
28-
case Left(value) =>
29-
context.abort(context.enclosingPosition, value)
23+
case Left(value) => context.abort(context.enclosingPosition, value)
3024
}
31-
case _ =>
32-
context.abort(context.enclosingPosition, "Invalid color value")
25+
case _ => context.abort(context.enclosingPosition, "Invalid color value")
3326
}
3427
}
3528
}

project/plugins.sbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
addSbtPlugin("io.taig" % "sbt-houserules" % "0.1.11")
1+
addSbtPlugin("io.taig" % "sbt-houserules" % "0.3.0")
22

33
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
44

5-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.1")
5+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.2.0")

0 commit comments

Comments
 (0)