{"id":20007408,"url":"https://github.com/mystpi/report","last_synced_at":"2026-02-06T14:17:24.133Z","repository":{"id":259099880,"uuid":"874983616","full_name":"MystPi/report","owner":"MystPi","description":"Create informative \u0026 beautiful source code reports in Gleam.","archived":false,"fork":false,"pushed_at":"2024-11-20T16:29:18.000Z","size":87,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-18T18:52:26.301Z","etag":null,"topics":["diagnostics","error-reporting","gleam","programming-languages","source-code"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/report","language":"Gleam","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/MystPi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-10-18T20:44:24.000Z","updated_at":"2025-03-26T18:55:59.000Z","dependencies_parsed_at":"2025-06-25T18:20:11.156Z","dependency_job_id":null,"html_url":"https://github.com/MystPi/report","commit_stats":null,"previous_names":["mystpi/report"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MystPi/report","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MystPi%2Freport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MystPi%2Freport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MystPi%2Freport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MystPi%2Freport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MystPi","download_url":"https://codeload.github.com/MystPi/report/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MystPi%2Freport/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29164848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T12:44:37.655Z","status":"ssl_error","status_checked_at":"2026-02-06T12:44:13.991Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["diagnostics","error-reporting","gleam","programming-languages","source-code"],"created_at":"2024-11-13T06:16:25.518Z","updated_at":"2026-02-06T14:17:24.115Z","avatar_url":"https://github.com/MystPi.png","language":"Gleam","funding_links":[],"categories":[],"sub_categories":[],"readme":"# report\n\n[![Package Version](https://img.shields.io/hexpm/v/report)](https://hex.pm/packages/report)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/report/)\n\nCreate informative \u0026 beautiful source code reports.\n\n\u003e Note: this package is not ready for production yet.\n\n![example report output](./assets/example_output.png)\n\n## Usage\n\nInstall with the `gleam` CLI. This package works on all targets!\n\n```sh\ngleam add report\n```\n\nThe following code will display the demo report found in the image above.\n\n```gleam\nimport gleam/io\nimport report\n\n/// The source code to be annotated in the report.\nconst source = \"fizz₂ : Nat -\u003e String\nfizz₂ num =\n    case (mod num 5) (mod num 3) of\n        0 0 =\u003e \\\"FizzBuzz\\\"\n        0 _ =\u003e \\\"Fizz\\\"\n        _ 0 =\u003e \\\"Buzz\\\"\n        _ _ =\u003e num\"\n\npub fn main() {\n  let file = \"FizzBuzz.fun\"\n  let message = \"`case` clauses have incompatible types\"\n\n  // Labels add annotations to the source code. There is normally one primary\n  // label and any number of secondary and context labels.\n  let labels = [\n    report.primary_label(\n      message: \"expected `String`, found `Nat`\",\n      from: #(7, 16),\n      to: #(7, 19),\n    ),\n    report.context_label(\n      message: \"`case` clauses have incompatible types\",\n      from: #(3, 5),\n      to: #(7, 19),\n    ),\n    report.secondary_label(\n      message: \"this is found to be of type `String`\",\n      from: #(4, 16),\n      to: #(4, 26),\n    ),\n    report.secondary_label(\n      message: \"this is found to be of type `String`\",\n      from: #(5, 16),\n      to: #(5, 22),\n    ),\n    report.secondary_label(\n      message: \"this is found to be of type `String`\",\n      from: #(6, 16),\n      to: #(6, 22),\n    ),\n    report.secondary_label(\n      message: \"expected type `String` found here\",\n      from: #(1, 16),\n      to: #(1, 22),\n    ),\n  ]\n\n  // Additional information can be added to the end of a report.\n  let info = [\n    report.Rows(\n      rows: [#(\"expected type\", \"String\"), #(\"found type\", \"Nat\")],\n      divider: \" = \",\n    ),\n    report.Text(\n      \"All `case` clauses must evaluate to the same type, but the indicated branch does not have the same type as the others.\",\n    ),\n  ]\n\n  // Create an error report. This could also be `report.warning` or `report.info`.\n  report.error(file:, source:, message:, labels:, info:)\n  // Finally, turn the report into a string with styling enabled then log the\n  // result to the console.\n  |\u003e report.to_string(style: True)\n  |\u003e io.println_error\n}\n```\n\nDocumentation can be found at \u003chttps://hexdocs.pm/report\u003e.\n\n## Versioning\n\nThis package follows semver, but stylistic changes such as tweaking colors are not covered by a major version. There will be no breaking changes to the actual API without a major bump.\n\n## Development\n\n```sh\ngleam run   # Run the project\ngleam test  # Run the tests\n```\n\n## Inspiration\n\nThis package is inspired by similar projects such as [`hug`](https://hexdocs.pm/hug/), [`diagnose`](https://github.com/Mesabloo/diagnose), and [`codespan-reporting`](https://github.com/brendanzab/codespan). The example above is based on the example in `codespan-reporting`'s README.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmystpi%2Freport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmystpi%2Freport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmystpi%2Freport/lists"}