kalemCore


License

License

GroupId

GroupId

ba.sake
ArtifactId

ArtifactId

kalem-core_sjs1_2.11
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

kalemCore
kalemCore
Project URL

Project URL

https://github.com/sake92/kalem
Project Organization

Project Organization

ba.sake
Source Code Management

Source Code Management

https://github.com/sake92/kalem

Download kalem-core_sjs1_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/ba.sake/kalem-core_sjs1_2.11/ -->
<dependency>
    <groupId>ba.sake</groupId>
    <artifactId>kalem-core_sjs1_2.11</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/ba.sake/kalem-core_sjs1_2.11/
implementation 'ba.sake:kalem-core_sjs1_2.11:0.0.1'
// https://jarcasting.com/artifacts/ba.sake/kalem-core_sjs1_2.11/
implementation ("ba.sake:kalem-core_sjs1_2.11:0.0.1")
'ba.sake:kalem-core_sjs1_2.11:jar:0.0.1'
<dependency org="ba.sake" name="kalem-core_sjs1_2.11" rev="0.0.1">
  <artifact name="kalem-core_sjs1_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='ba.sake', module='kalem-core_sjs1_2.11', version='0.0.1')
)
libraryDependencies += "ba.sake" % "kalem-core_sjs1_2.11" % "0.0.1"
[ba.sake/kalem-core_sjs1_2.11 "0.0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12
org.scala-js : scalajs-library_2.11 jar 1.5.0

test (1)

Group / Artifact Type Version
org.scala-js : scalajs-test-bridge_2.11 jar 1.5.0

Project Modules

There are no modules declared in this project.

Scalafix rules for Wither


@Wither

Run scalafix to turn this:

import ba.sake.kalem.Wither

@Wither
case class MyClass(x: Int, opt: Option[String])

into this:

@Wither
case class MyClass(x: Int, opt: Option[String], lst: List[String]){
  def withX(x: Int): MyClass = new MyClass(x = x, opt = opt, lst = lst)

  def withOpt(opt: Option[String]): MyClass = MyClass(x = x, opt = opt, lst = lst)
  def withOpt(opt: String): MyClass = new MyClass(x = x, opt = Option(opt), lst = lst)

  def withLst(lst: List[String]): MyClass = new MyClass(x = x, opt = opt, lst = lst)
  def withLst(lst: String*): MyClass = new MyClass(x = x, opt = opt, lst = lst.toList)
}

Why ?

  • more readable than named args
  • autocomplete is nicer
  • additional goodies for Options and Lists

How ?

Install scalafix as usual.
Add this to your build.sbt:

libraryDependencies += "ba.sake" %% "kalem-core" % "0.0.1"

ThisBuild / scalafixDependencies += "ba.sake" %% "kalem-rules" % "0.0.1"

and this to .scalafix.conf:

rules = [
  Wither
]

Develop

To develop rule:

sbt ~tests/test
# edit rules/src/main/scala/fix/Wither.scala

Versions

Version
0.0.1