{"id":15355187,"url":"https://github.com/sake92/kalem","last_synced_at":"2025-04-15T06:20:39.397Z","repository":{"id":57715056,"uuid":"354062465","full_name":"sake92/kalem","owner":"sake92","description":"Scalafix rules for generating Withers","archived":false,"fork":false,"pushed_at":"2021-04-02T16:48:20.000Z","size":17,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T17:01:45.013Z","etag":null,"topics":["scala","scalafix-rule","scalajs"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sake92.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-02T15:42:49.000Z","updated_at":"2024-12-09T19:54:18.000Z","dependencies_parsed_at":"2022-09-02T22:01:35.872Z","dependency_job_id":null,"html_url":"https://github.com/sake92/kalem","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fkalem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fkalem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fkalem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fkalem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sake92","download_url":"https://codeload.github.com/sake92/kalem/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249017221,"owners_count":21198928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["scala","scalafix-rule","scalajs"],"created_at":"2024-10-01T12:23:03.068Z","updated_at":"2025-04-15T06:20:39.382Z","avatar_url":"https://github.com/sake92.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scalafix rules for Wither\n\n---\n## @Wither\n\nRun scalafix to turn this:\n```scala\nimport ba.sake.kalem.Wither\n\n@Wither\ncase class MyClass(x: Int, opt: Option[String])\n```\ninto this:\n```scala\n@Wither\ncase class MyClass(x: Int, opt: Option[String], lst: List[String]){\n  def withX(x: Int): MyClass = new MyClass(x = x, opt = opt, lst = lst)\n\n  def withOpt(opt: Option[String]): MyClass = MyClass(x = x, opt = opt, lst = lst)\n  def withOpt(opt: String): MyClass = new MyClass(x = x, opt = Option(opt), lst = lst)\n\n  def withLst(lst: List[String]): MyClass = new MyClass(x = x, opt = opt, lst = lst)\n  def withLst(lst: String*): MyClass = new MyClass(x = x, opt = opt, lst = lst.toList)\n}\n```\n\nWhy ?\n- more readable than named args\n- autocomplete is nicer\n- additional goodies for Options and Lists\n\nHow ?  \n\nInstall scalafix as usual.  \nAdd this to your `build.sbt`:\n```scala\nlibraryDependencies += \"ba.sake\" %% \"kalem-core\" % \"0.0.1\"\n\nThisBuild / scalafixDependencies += \"ba.sake\" %% \"kalem-rules\" % \"0.0.1\"\n```\n\nand this to `.scalafix.conf`:\n```\nrules = [\n  Wither\n]\n```\n\n---\n### Develop\nTo develop rule:\n```\nsbt ~tests/test\n# edit rules/src/main/scala/fix/Wither.scala\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsake92%2Fkalem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsake92%2Fkalem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsake92%2Fkalem/lists"}