{"id":15159368,"url":"https://github.com/tek/splain","last_synced_at":"2025-10-05T08:22:47.125Z","repository":{"id":14580805,"uuid":"76754065","full_name":"tek/splain","owner":"tek","description":"better implicit errors for scala","archived":false,"fork":false,"pushed_at":"2025-04-19T20:51:09.000Z","size":1168,"stargazers_count":371,"open_issues_count":9,"forks_count":28,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-23T02:05:01.539Z","etag":null,"topics":["compiler-plugin","implicits","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tek.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-12-18T00:02:41.000Z","updated_at":"2024-12-22T13:14:18.000Z","dependencies_parsed_at":"2023-09-22T00:25:05.063Z","dependency_job_id":"908dd32d-345a-4c48-8f45-7c44f977901a","html_url":"https://github.com/tek/splain","commit_stats":{"total_commits":360,"total_committers":19,"mean_commits":18.94736842105263,"dds":"0.23611111111111116","last_synced_commit":"f18daf1b2f102b83069e061ca0404b9a0889312f"},"previous_names":[],"tags_count":97,"template":false,"template_full_name":null,"purl":"pkg:github/tek/splain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fsplain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fsplain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fsplain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fsplain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tek","download_url":"https://codeload.github.com/tek/splain/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fsplain/sbom","scorecard":{"id":872880,"data":{"date":"2025-08-11","repo":{"name":"github.com/tek/splain","commit":"4b05a299baae5bb35e6fb6d864770907b761eeb1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":3,"reason":"Found 10/29 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/tek/splain/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/tek/splain/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/tek/splain/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/tek/splain/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/tek/splain/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/tek/splain/main.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact Release/1.1.0-2.13.9 not signed: https://api.github.com/repos/tek/splain/releases/232975001","Warn: release artifact Release/1.1.0-2.13.8 not signed: https://api.github.com/repos/tek/splain/releases/232974587","Warn: release artifact Release/1.1.0-2.13.7 not signed: https://api.github.com/repos/tek/splain/releases/232974610","Warn: release artifact Release/1.1.0-2.13.16 not signed: https://api.github.com/repos/tek/splain/releases/232976019","Warn: release artifact Release/1.1.0-2.13.15 not signed: https://api.github.com/repos/tek/splain/releases/232976009","Warn: release artifact Release/1.1.0-2.13.9 does not have provenance: https://api.github.com/repos/tek/splain/releases/232975001","Warn: release artifact Release/1.1.0-2.13.8 does not have provenance: https://api.github.com/repos/tek/splain/releases/232974587","Warn: release artifact Release/1.1.0-2.13.7 does not have provenance: https://api.github.com/repos/tek/splain/releases/232974610","Warn: release artifact Release/1.1.0-2.13.16 does not have provenance: https://api.github.com/repos/tek/splain/releases/232976019","Warn: release artifact Release/1.1.0-2.13.15 does not have provenance: https://api.github.com/repos/tek/splain/releases/232976009"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T04:51:06.107Z","repository_id":14580805,"created_at":"2025-08-24T04:51:06.108Z","updated_at":"2025-08-24T04:51:06.108Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278426700,"owners_count":25984920,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","implicits","scala"],"created_at":"2024-09-26T21:05:17.863Z","updated_at":"2025-10-05T08:22:47.119Z","avatar_url":"https://github.com/tek.png","language":"Scala","readme":"# A scala compiler plugin for more concise errors\n\nThis plugin removes some of the redundancy of the compiler output and prints\nadditional info for implicit resolution errors.\n\n# Versions\n\nTL;DR\n\n```\n                 ┌──────────────────────────┐                  \n                 │What's your Scala version?│                  \n                 └─────────┬───────┬────────┘                  \n                           │       │                           \n                           │       └───────────────────┐       \n                           v                           │       \n    ┌─────────────────────────────────────────────┐    │       \n    │                ( \u003e= 2.13.6 )                │    │       \n    │                ─────────────                │    │       \n    │Do you want experimental features \u0026 bugfixes?│    │       \n    └──┬───────────────┬──────────────────────────┘    │       \n       │               │                               │       \n       v               v                               v       \n ┌──────────┐ ┌─────────────────┐ ┌───────────────────────────┐\n │ ( yes )  │ │     ( no )      │ │( 2.12 / 2.13.0 .. 2.13.5 )│\n │ ───────  │ │     ──────      │ ├───────────────────────────┤\n │Splain 1.x│ │Compiler built-in│ │       Splain 0.5.x        │\n └──────────┘ └─────────────────┘ └───────────────────────────┘\n```\n\n### Compiler built-in\n\n(main article: https://docs.scala-lang.org/overviews/compiler-options/index.html#Verbose_Settings)\n\nThe basic Splain features has been integrated into Scala compiler (since 2.13.6, through contributions like [this](https://github.com/scala/scala/pull/7785) and [this](https://github.com/scala/scala/pull/10029)), they can be enabled immediately by using the right compiler options (see **Option** section for detail).\n\n### v1.x (master branch)\n\n(Only available for Scala 2.13.6+)\n\nSplain 1.x is a simplified rewrite that aims to incrementally introduce enhancement to the already integrated Splain features. Additional features and bugfixes will first be released and refined here, then be periodically contributed back into Scala compiler.\n\nEffectively, **Splain 1.x is now a feature preview patch of Scala compiler**, if a relevant compiler built-in option (see **Option** section for detail) malfunctions, it may work with Splain v1.x enabled.\n\nIt is also the only branch under active development.\n\n### v0.5.x (maintenance branch)\n\n(Only available for Scala 2.12 and Scala 2.13.0 .. 2.13.5)\n\nThe latest v0.x will continue to be maintained and published regularly to stay compatible with the latest Scala 2.12.x release (until it's end-of-life), but no newer version will be published for Scala 2.13, **splain 0.5.x will be the last release for Scala 2.13**.\n\nWe strongly recommend you to upgrade to Scala 2.13.6+ to benefit from active support and up-to-date features.\n\n### Build Matrix\n\n| Version                          | Status                                                                                                                                                            | Compatibility                                                                    |\n|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|\n| v1.x \u003cbr\u003e (current) - latest     | [![CI](https://github.com/tek/splain/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/tek/splain/actions/workflows/main.yml)               | ![badge](https://github-actions.40ants.com/tek/splain/matrix.svg?branch=master)  |\n| v1.1.0 \u003cbr\u003e (current)            | [![CI](https://github.com/tek/splain/actions/workflows/main.yml/badge.svg?branch=Release/1.1.0)](https://github.com/tek/splain/actions/workflows/main.yml)               | ![badge](https://github-actions.40ants.com/tek/splain/matrix.svg?branch=Release/1.1.0)               |\n| v1.1.0-RC0 \u003cbr\u003e (current)        | [![CI](https://github.com/tek/splain/actions/workflows/main.yml/badge.svg?branch=Release/1.1.0-RC0)](https://github.com/tek/splain/actions/workflows/main.yml)    | ![badge](https://github-actions.40ants.com/tek/splain/matrix.svg?branch=Release/1.1.0-RC0) |\n| v1.0.3 \u003cbr\u003e (current)            | [![CI](https://github.com/tek/splain/actions/workflows/main.yml/badge.svg?branch=Release/1.0.3)](https://github.com/tek/splain/actions/workflows/main.yml)        | ![badge](https://github-actions.40ants.com/tek/splain/matrix.svg?branch=Release/1.0.3) |\n| v1.0.2 \u003cbr\u003e (current)            | [![CI](https://github.com/tek/splain/actions/workflows/main.yml/badge.svg?branch=Release/1.0.2)](https://github.com/tek/splain/actions/workflows/main.yml)        | ![badge](https://github-actions.40ants.com/tek/splain/matrix.svg?branch=Release/1.0.2) |\n| v1.0.1 \u003cbr\u003e (current)            | [![CI](https://github.com/tek/splain/actions/workflows/main.yml/badge.svg?branch=Release/1.0.1)](https://github.com/tek/splain/actions/workflows/main.yml)        | ![badge](https://github-actions.40ants.com/tek/splain/matrix.svg?branch=Release/1.0.1) |\n| v1.0.0 \u003cbr\u003e (current)            | [![CI](https://github.com/tek/splain/actions/workflows/main.yml/badge.svg?branch=Release/1.0.0)](https://github.com/tek/splain/actions/workflows/main.yml)        | ![badge](https://github-actions.40ants.com/tek/splain/matrix.svg?branch=Release/1.0.0) |\n| v1.0.0-RC2 \u003cbr\u003e (current)        | [![CI](https://github.com/tek/splain/actions/workflows/main.yml/badge.svg?branch=Release/1.0.0-RC2)](https://github.com/tek/splain/actions/workflows/main.yml)    | ![badge](https://github-actions.40ants.com/tek/splain/matrix.svg?branch=Release/1.0.0-RC2) |\n| v1.0.0-RC1 \u003cbr\u003e (current)        | [![CI](https://github.com/tek/splain/actions/workflows/main.yml/badge.svg?branch=Release/1.0.0-RC1)](https://github.com/tek/splain/actions/workflows/main.yml)    | ![badge](https://github-actions.40ants.com/tek/splain/matrix.svg?branch=Release/1.0.0-RC1) |\n| v0.x \u003cbr\u003e (maintenance) - latest | [![CI](https://github.com/tek/splain/actions/workflows/main.yml/badge.svg?branch=Maintenance%2Fmaster)](https://github.com/tek/splain/actions/workflows/main.yml) | ![badge](https://github-actions.40ants.com/tek/splain/matrix.svg?branch=Maintenance%2Fmaster) |\n\n# Usage\n\n### v1.x, v0.x\n\nInclude this line in your `build.sbt` (_not_ `project/plugins.sbt`!!):\n\n```sbt\naddCompilerPlugin(\"io.tryp\" % \"splain\" % \"0.5.8\" cross CrossVersion.patch)\n```\n\nIf you want to support scala versions both newer and older than `2.12.5`, use:\n\n```sbt\nlibraryDependencies += {\n  val v =\n    if (scalaVersion.value.replaceFirst(raw\"\\.(\\d)$$\",\".0$1\") \u003c= \"2.12.04\") \"0.4.1\"\n    else \"0.5.8\"\n  (\"io.tryp\" %% \"splain\" % v cross CrossVersion.patch).withConfigurations(Some(\"plugin-\u003edefault(compile)\"))\n}\n```\n\nIf you are using gradle with scala plugin, include this line under the dependency section of your build.gradle:\n\n```groovy\nscalaCompilerPlugins group: 'io.tryp', name: 'splain_${scalaVersion}', version: '0.5.8'\n```\n\nor build.gradle.kts:\n\n```kotlin\nscalaCompilerPlugins(\"io.tryp:splain_${scalaVersion}:0.5.8\")\n```\n\n### compiler built-in, no plugin declaration required\n\nIts effects however still have to be enabled in your compiler options, in minimal case, by the following 2 options (see Options for details):\n\n```\n-Vimplicits -Vtype-diffs\n```\n\n# Options\n\nThe plugin can be configured via compiler Options with the format:\n\n| v0.x                          | built-in, v1.x       |\n|:----------------------------- | -------------------- |\n| `-P:splain:\u003cparam\u003e[:\u003cvalue\u003e]` | `-\u003cparam\u003e[:\u003cvalue\u003e]` |\n\n`param` can be one of the following:\n\n| v0.x              | built-in, v1.x                            | default value    |\n| ----------------- |-------------------------------------------|------------------|\n| `all`             | `enabled`                                 | true             |\n| `infix`           | (dropped)                                 |                  |\n| `foundreq`        | `Vtype-diffs`                             | false            |\n| `implicits`       | `Vimplicits`                              | false            |\n| `bounds`          | (dropped)                                 | false            |\n| `color`           | (dropped)                                 |                  |\n| `breakinfix`      | (dropped)                                 | 0                |\n| `tree`            | `Vimplicits-verbose-tree`                 |                  |\n| `compact`         | (dropped)                                 | false            |\n| `boundsimplicits` | (dropped)                                 |                  |\n| `truncrefined`    | `Vimplicits-max-refined`                  | 0                |\n| `rewrite`         | (dropped)                                 | (do not rewrite) |\n| `keepmodules`     | (dropped)                                 | 0                |\n| (N/A)             | `P:splain:Vimplicits-diverging`           | false            |\n| (N/A)             | `P:splain:Vimplicits-diverging-max-depth` | 100              |\n| (N/A)             | `P:splain:Vtype-detail`                   | 1                |\n| (N/A)             | `P:splain:Vtype-diffs-detail`             | 1                |\n\n\n`value` can either be `true` or `false`. If omitted, the default is `true` for\nboth value and parameter.\n\nThe parameter `all` can be used to deactivate all features.\n\nThe parameters can be applied like this:\n\n(in sbt)\n\n```sbt\nscalacOptions += \"-P:splain:implicits:false\"\n```\n\n(in gradle with scala plugin)\n\n```kotlin\nwithType\u003cScalaCompile\u003e {\n    scalaCompileOptions.apply {\n        additionalParameters = listOf(\"-P:splain:implicits:false\")\n    }\n}\n```\n\n# infix types\n\nInstead of `shapeless.::[A, HNil]`, prints `A :: HNil`.\n\n# found/required types\n\nRather than printing up to four types, only the dealiased types are shown as a colored diff:\n\n![foundreq](img/foundreq.jpg)\n\nspecial consideration for `shapeless.Record`:\n\n![foundreq_record](img/foundreq_record.jpg)\n\nIn the case of refined types in the form of `Client with Database with\nPublisher`, the types will be matched with each other and a missing or surplus\ntype will be indicated by a `\u003cnone\u003e` label.\n\n# implicit resolution chains\n\nWhen an implicit is not found, only the outermost error at the invocation point\nis printed. This can be expanded with the compiler flag `-Xlog-implicits`, but\nthat also shows all invalid implicits for parameters that have been resolved\nsuccessfully.\nThis feature prints a compact list of all involved implicits:\n![implicits](img/implicits.jpg)\n\nHere, `!I` stands for *could not find implicit value*, the name of the implicit\nparameter is in yellow, and its type in green.\n\nIf the parameter `tree` is set, the candidates will be indented according to their nesting level:\n\n![tree](img/tree.jpg)\n\nIf the parameter `compact` is set, only the first and last implicit in a chain will be printed.\n\nIf the parameter `boundsimplicits` is set to false, any **nonconformant bounds** errors will be suppressed.\n\nFor comparison, this is the regular compiler output for this case (with\nformatted types):\n\n```\n[info] unit/src/basic.scala:35: f is not a valid implicit value for\nsplain.ImplicitChain.T2 because:\n[info] hasMatchingSymbol reported error: could not find implicit value for\nparameter impPar2: (D *** (C *** String)) \u003e:\u003c ((C,D,C) *** D)\n[info]   implicitly[T1]\n[info]             ^\n[info] unit/src/basic.scala:35: g is not a valid implicit value for\nsplain.ImplicitChain.T1 because:\n[info] hasMatchingSymbol reported error: could not find implicit value for\nparameter impPar1: D *** ((C \u003e:\u003c C) *** (D =\u003e Unit))\n[info]   implicitly[T1]\n[info]             ^\n[error] unit/src/basic.scala:35: could not find implicit value for\nparameter e: (C *** D) \u003e:\u003c C with D {type A = D; type B = C}\n[error]   implicitly[T1]\n```\n\n# infix type and type argument line breaking\n\nIf the parameter `breakinfix` is given and greater than 0, types longer than\nthat number will be split into multiple lines:\n\n```\nimplicit error;\n!I e: String\nf invalid because\n!I impPar4: List[\n  (\n    VeryLongTypeName ::::\n    VeryLongTypeName ::::\n    VeryLongTypeName ::::\n    VeryLongTypeName\n  )\n  ::::\n  (Short :::: Short) ::::\n  (\n    VeryLongTypeName ::::\n    VeryLongTypeName ::::\n    VeryLongTypeName ::::\n    VeryLongTypeName\n  )\n  ::::\n  VeryLongTypeName ::::\n  VeryLongTypeName ::::\n  VeryLongTypeName ::::\n  VeryLongTypeName\n]\n```\n\n# truncating refined types\n\nA type of the shape `T { type A = X; type B = Y }` will be displayed as `T {...}` if the parameter `truncrefined` is set\nto a value `/= 0` and the refinement's length is greater than the value.\n\n# truncating module paths\n\nDefault behaviour when printing type names is to omit the whole module path and only print the last segment.\nTwo options modify this behaviour:\n\n## regex rewrite\n\nThe option `rewrite` takes a string that is parsed as a `;`-delimited list of regexes and optional replacements.\n\nFor example:\n\n```\n-P:splain:rewrite:cats\\\\.data/cd;.Type\n```\n\nThis parses as two rewrite items:\n\n* transform `cats.data` into `cd`\n* delete all occurences of `.Type`\n\nIf a slash is present, the string following it will be used as a replacement for the matched text.\nIf it is absent, the empty string is substituted.\n\n## dropping module segments by count\n\nThe option `keepmodules` determines how many segments of the module path before the type name will be displayed, but\nonly if the `rewrite` mechanism hasn't changed anything.\n\nSo with `-P:splain:keepmodules:2`, the qualified type `cats.free.FreeT.Suspend` will be displayed as\n`free.FreeT.Suspend`, keeping the two segments `free.FreeT` before the type name.\nThe default is `0`, so only the type name itself will be displayed\n\n# expanding diverging implicit errors (experimental)\n\nA `diverging implicit error` is thrown by compiler if it cannot decide if an implicit search can terminate in polynomial time (e.g. if the search algorithm encounter a loop or infinite expansion). In most cases, such error will cause the entire search to fail immediately, but there are few exceptions to this rule, for which the search can backtrack and try an alternative path to fulfil the implicit argument. Either way, the Scala compiler error is only capable of showing the entry point of such loop or infinite expansion:\n\n```\ndiverging implicit expansion for type splain.DivergingImplicits.C\nstarting with method f in object Circular\n```\n\nIf the parameter `-P:splain:Vimplicits-diverging` is enabled, it will instruct the compiler to continue its implicit search process until an implicit resolution chain can be correlated with such error(s):\n\n```\nimplicit error;\n!I e: C\nf invalid because\n!I c: C\ndiverging implicit expansion for type C\nstarting with method f in object Endo\n――f invalid because\n  !I c: C\n  diverging implicit expansion for type C\n  starting with method f in object Endo\n```\n\n**EXPERIMENTAL!** sometimes this feature may cause failed implicit resolution to succeed, due to the delay in throwing the diverging implicit error. It may also increase compilation time slightly. If your build has been broken by this feature, please consider simplifying your code base to create a minimal reproducible test case, and submit it with a pull request.\n\n# type detail (experimental)\n\nThe option `-P:splain:Vtype-detail:X` can take an integer from 1 to 6 to attach different kinds of details to type information in any error message.\n\n- `1` (DEFAULT) : type info in short form, by using toString (same as pre-1.1.0)\n- `2` = **long** : type info in long form, by using toLongString\n- `3` = `2` + (**existential** : existential context)\n- `4` = `3` + (**reduction** : explain type reduction process)\n- `5` = `4` + (**position** : type definition position in code)\n- `6` = `5` + (**alias** : explain type aliases, this generally contains duplicate information with `3`, it is only included for completeness)\n\nFor example:\n\n(`-P:splain:Vtype-detail:1`)\n\n```\nXXX.scala:15: error: type mismatch;\n  Test.F[Test.a.type|a.type]\n```\n\n(`-P:splain:Vtype-detail:6`)\n\n![](img/bc959e77.png)\n\nIn addition, multiple names of the detail kind (denoted by bold text in the above list) can be appended to the option value to enable it, e.g. `-P:splain:Vtype-detail:1,reduction,position` can attach type reduction process \u0026 type definition position while bypassing **long** and **existential**.\n\n# type diffs detail (experimental)\n\nThe option `-P:splain:Vtype-diffs-detail:X` can take an integer from 1 to 4 to augment type diff errors with different kinds of details.\n\n- `1` (DEFAULT) : no augmentation (same as pre-1.1.0)\n- `2` = **disambiguation** : augment type info with disambiguation for both sides in `\u003cfound\u003e|\u003crequired\u003e` and infix types (e.g. `A =:= B`, `A \u003c:\u003c B`) in error message\n- `3` = `2` + (**builtIn** : attach built-in found/required errors emitted by Scala compiler IF AND ONLY IF both sides of the error message are identical)\n- `4` = `3` + (**builtInAlways** : ALWAYS attach original found/required error info, even if both sides of the error message are different)\n\nIn addition, multiple names of the detail kind (denoted by bold text in the above list) can be appended to the option value to enable it, e.g. `-P:splain:Vtype-diffs-detail:1,builtIn` can attach built-in errors while bypassing **disambiguation**.\n\nFor example:\n\n(`-P:splain:Vtype-diffs-detail:1`)\n\n```\nXXX.scala:16: error: implicit error;\n!I ev: Long =:= Long\n  Cannot prove that Long =:= Long.\n```\n\n(`-P:splain:Vtype-diffs-detail:4`)\n\n![](img/86df485f.png)\n\n# Development\n\n## Bugs\n\nDue to the nature of the hack that allows _splain_ to hook into the implicit search algorithm, other plugins using the\nsame trick may not work or cause _splain_ to be inactive.\n\nAnother victim of _splain_ is scaladoc – doc comments might disappear when running the task with _splain_ active, so\nmake sure it is disabled before doing so.\n\nUsers are encouraged to submit issues and test cases directly through pull requests, by forking the project and adding new test cases under:\n\n| v0.x                                   | v1.x                                               |\n|:-------------------------------------- | -------------------------------------------------- |\n| `\u003cproject root\u003e/src/test/scala/splain` | `\u003cproject root\u003e/core/src/test/scala/splain/plugin` |\n\nThe bug can thus be identified by the team quickly on our [continuous integration environment](https://github.com/tek/splain/actions). Submission on our GitHub issue tracker is also welcomed, but it generally takes much longer for the team to respond.\n\n## How to compile\n\n### v1.x (from git branch master)\n\nBuilt with the latest [Gradle](https://gradle.org/), to compile and publish locally:\n\n```\n./gradlew clean testClasses publishToMavenLocal\n```\n\nto run all tests:\n\n```\n./gradlew test\n```\n\n\n### v0.x (from git branch Maintenance/master)\n\nBuilt with the latest stable [SBT](https://www.scala-sbt.org/). to compile and publish locally:\n\n```\nsbt clean publishM2\n```\n\nto run all tests:\n\n```\nsbt test\n```\n\n\n## How to edit\n\nMost project contributors uses neovim, IntelliJ IDEA or visual studio code.\n\nThe team strive for a strong discipline in software engineering. All commits (including SNAPSHOTs and PRs) will be compliant with [scalalfmt](https://scalameta.org/scalafmt/) standard.\n\n## Communication\n\n- @tek - reviewer for built-in/v0.x bugfix, new features\n- @tribbloid - reviewer for v1.x bugfix\n- @dwijnand - reviewer for scala compiler integration\n","funding_links":[],"categories":["Table of Contents","Sbt plugins"],"sub_categories":["Sbt plugins"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftek%2Fsplain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftek%2Fsplain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftek%2Fsplain/lists"}