{"id":22615725,"url":"https://github.com/polyvariant/better-tostring","last_synced_at":"2025-04-05T22:10:51.991Z","repository":{"id":39984834,"uuid":"257043911","full_name":"polyvariant/better-tostring","owner":"polyvariant","description":"(b2s) Scala compiler plugin for a better default toString.","archived":false,"fork":false,"pushed_at":"2025-03-17T22:40:26.000Z","size":255,"stargazers_count":103,"open_issues_count":6,"forks_count":9,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-29T21:09:14.562Z","etag":null,"topics":["compiler-plugin","scala","to-string","tostring"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polyvariant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-19T16:11:04.000Z","updated_at":"2025-03-17T22:40:30.000Z","dependencies_parsed_at":"2023-02-14T11:15:43.637Z","dependency_job_id":"408c393a-0b7d-49c7-83ba-6864aea6a971","html_url":"https://github.com/polyvariant/better-tostring","commit_stats":{"total_commits":141,"total_committers":9,"mean_commits":"15.666666666666666","dds":"0.34042553191489366","last_synced_commit":"3733f27227aa62f18a46ccd4511ee0207d1a10f2"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fbetter-tostring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fbetter-tostring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fbetter-tostring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fbetter-tostring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polyvariant","download_url":"https://codeload.github.com/polyvariant/better-tostring/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406111,"owners_count":20933806,"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":["compiler-plugin","scala","to-string","tostring"],"created_at":"2024-12-08T19:09:13.337Z","updated_at":"2025-04-05T22:10:51.971Z","avatar_url":"https://github.com/polyvariant.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# better-tostring\n\n[![License](http://img.shields.io/:license-Apache%202-green.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)\n[![Latest version](https://index.scala-lang.org/polyvariant/better-tostring/better-tostring/latest.svg)](https://index.scala-lang.org/kubukoz/better-tostring/better-tostring)\n[![Maven Central](https://img.shields.io/maven-central/v/org.polyvariant/better-tostring_2.13.5.svg)](http://search.maven.org/#search%7Cga%7C1%7Cbetter-tostring)\n\nA Scala compiler plugin that replaces the default `toString` implementation of case classes with a more verbose one.\n\n## Example\n\nWithout the plugin:\n\n```scala\nfinal case class User(name: String, age: Int)\n\nUser(\"Joe\", 18).toString() // \"User(Joe, 18)\"\n```\n\nWith the plugin:\n\n```scala\nUser(\"Joe\", 18).toString() // \"User(name = Joe, age = 18)\"\n```\n\n## Usage\n\nIn sbt:\n\n```scala\nlibraryDependencies += compilerPlugin(\"org.polyvariant\" % \"better-tostring\" % \"0.3.17\" cross CrossVersion.full)\n```\n\nIn scala-cli:\n\n```scala\n//\u003e using plugin \"org.polyvariant:::better-tostring:0.3.17\"\n```\n\n(note: versions before `0.3.8` were published under the `com.kubukoz` organization instead of `org.polyvariant`)\n\n\u003c!-- SCALA VERSIONS START --\u003e\nThe plugin is currently published for the following 23 Scala versions:\n\n- 2.12.18, 2.12.19, 2.12.20\n- 2.13.12, 2.13.13, 2.13.14, 2.13.15, 2.13.16\n- 3.3.0, 3.3.1, 3.3.3, 3.3.4, 3.3.5\n- 3.4.0, 3.4.1, 3.4.2, 3.4.3\n- 3.5.0, 3.5.1, 3.5.2\n- 3.6.2, 3.6.3, 3.6.4\n\u003c!-- SCALA VERSIONS END --\u003e\n\nFor older Scala versions, see [previous versions of better-tostring](https://repo1.maven.org/maven2/org/polyvariant) ([or even older versions](https://repo1.maven.org/maven2/com/kubukoz)).\n\nAs a rule of thumb, active support will include _at least_ 3 latest stable versions of 2.12, 2.13 and 3.0 for the foreseeable future.\n\n## What does the plugin actually do?\n\n1. Only case classes located directly in `package`s or `object`s are changed. Nested classes and classes local to functions are currently ignored.\n2. Only the fields in the first parameter list are shown.\n3. If the class is nested in an object (but not a package object), the object's name and a dot are prepended.\n4. If the class already overrides `toString` *directly*, it's not replaced.\n\n## Roadmap\n\n- Ignore classes that inherit `toString` from a type that isn't `Object` (#34)\n- Potentially ignore value classes (#19)\n\nIf you have ideas for improving the plugin, feel free to create an issue and we'll consider making it happen :)\n\n## Customization?\n\n_tl;dr there is none._\n\nThe plugin makes certain assumptions about what is a _better_ `toString`. We aim for a useful and reasonably verbose description of the data type,\nwhich could make it easier to find certain issues with your tests (mismatching values in a field) or see the labels in debug logs.\n\nWe also want the plugin to become minimal in the implementation and easy to use (plug \u0026 play), without lots of configuration options, so the representation of the data types will not be customizable. **The format may change over time without prior notice**, so you shouldn't rely on the exact representation (as is the case with any `toString` methods), but any changes in behavior will be communicated in the release notes.\n\nIf you need a different `toString`, we suggest that you implement one yourself. You may also want to look at [pprint](https://github.com/com-lihaoyi/PPrint).\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md)\n\n## Maintainers\n\nThe maintainers of this project (people who can merge PRs and make releases) are:\n\n- Jakub Kozłowski ([@kubukoz](https://github.com/kubukoz))\n- Michał Pawlik ([@majk-p](https://github.com/majk-p))\n- Mikołaj Robakowski ([@mrobakowski](https://github.com/mrobakowski))\n\n## Community\n\nThis project supports the [Scala code of conduct](https://www.scala-lang.org/conduct/) and wants communication on all its channels (GitHub etc.) to be inclusive environments.\n\nIf you have any concerns about someone's behavior on these channels, contact [Jakub Kozłowski](mailto:kubukoz@gmail.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyvariant%2Fbetter-tostring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolyvariant%2Fbetter-tostring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyvariant%2Fbetter-tostring/lists"}