{"id":13502949,"url":"https://github.com/zesterer/ariadne","last_synced_at":"2025-05-12T13:14:26.585Z","repository":{"id":37368787,"uuid":"385751793","full_name":"zesterer/ariadne","owner":"zesterer","description":"A fancy diagnostics \u0026 error reporting crate","archived":false,"fork":false,"pushed_at":"2025-04-17T15:34:41.000Z","size":214,"stargazers_count":1938,"open_issues_count":65,"forks_count":83,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-12T13:14:15.235Z","etag":null,"topics":["compiler","diagnostics","error","error-messages","error-reporting","parser","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/ariadne","language":"Rust","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/zesterer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["zesterer"]}},"created_at":"2021-07-13T22:37:03.000Z","updated_at":"2025-05-11T23:06:36.000Z","dependencies_parsed_at":"2023-02-19T16:45:30.962Z","dependency_job_id":"348f0011-3c48-4783-b7ca-9f416b32103f","html_url":"https://github.com/zesterer/ariadne","commit_stats":{"total_commits":66,"total_committers":17,"mean_commits":"3.8823529411764706","dds":0.303030303030303,"last_synced_commit":"ccd465160129d2546d67f7ee78727a4098a64330"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fariadne","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fariadne/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fariadne/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fariadne/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zesterer","download_url":"https://codeload.github.com/zesterer/ariadne/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745197,"owners_count":21957319,"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","diagnostics","error","error-messages","error-reporting","parser","rust"],"created_at":"2024-07-31T22:02:31.472Z","updated_at":"2025-05-12T13:14:26.548Z","avatar_url":"https://github.com/zesterer.png","language":"Rust","readme":"# Ariadne\n\n[![crates.io](https://img.shields.io/crates/v/ariadne.svg)](https://crates.io/crates/ariadne)\n[![crates.io](https://docs.rs/ariadne/badge.svg)](https://docs.rs/ariadne)\n[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](https://github.com/zesterer/ariadne)\n![actions-badge](https://github.com/zesterer/ariadne/workflows/Rust/badge.svg?branch=main)\n\nA fancy compiler diagnostics crate.\n\n## Example\n\n\u003ca href = \"https://github.com/zesterer/ariadne/blob/main/examples/multiline.rs\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/zesterer/ariadne/main/misc/example.png\" alt=\"Ariadne supports arbitrary multi-line spans\"/\u003e\n\u003c/a\u003e\n\n```rust,ignore\nfn main() {\n    use ariadne::{Color, ColorGenerator, Fmt, Label, Report, ReportKind, Source};\n\n    let mut colors = ColorGenerator::new();\n\n    // Generate \u0026 choose some colours for each of our elements\n    let a = colors.next();\n    let b = colors.next();\n    let out = Color::Fixed(81);\n\n    Report::build(ReportKind::Error, (\"sample.tao\", 12..12))\n        .with_code(3)\n        .with_message(format!(\"Incompatible types\"))\n        .with_label(\n            Label::new((\"sample.tao\", 32..33))\n                .with_message(format!(\"This is of type {}\", \"Nat\".fg(a)))\n                .with_color(a),\n        )\n        .with_label(\n            Label::new((\"sample.tao\", 42..45))\n                .with_message(format!(\"This is of type {}\", \"Str\".fg(b)))\n                .with_color(b),\n        )\n        .with_label(\n            Label::new((\"sample.tao\", 11..48))\n                .with_message(format!(\n                    \"The values are outputs of this {} expression\",\n                    \"match\".fg(out),\n                ))\n                .with_color(out),\n        )\n        .with_note(format!(\n            \"Outputs of {} expressions must coerce to the same type\",\n            \"match\".fg(out)\n        ))\n        .finish()\n        .print((\"sample.tao\", Source::from(include_str!(\"sample.tao\"))))\n        .unwrap();\n}\n```\n\nSee [`examples/`](https://github.com/zesterer/ariadne/tree/main/examples) for more examples.\n\n## Usage\n\nFor each error you wish to report:\n* Call `Report::build()` to create a `ReportBuilder`.\n* Assign whatever details are appropriate to the error using the various\n  methods, and then call the `finish` method to get a `Report`.\n* For each `Report`, call `print` or `eprint` to write the report\n  directly to `stdout` or `stderr`. Alternately, you can use\n  `write` to send the report to any other `Write` destination (such as a file).\n\n## About\n\n`ariadne` is a sister project of [`chumsky`](https://github.com/zesterer/chumsky/). Neither are dependent on\none-another, but I'm working on both simultaneously and like to think that their features complement each other. If\nyou're thinking of using `ariadne` to process your compiler's output, why not try using `chumsky` to process its input?\n\n## Features\n\n- Inline and multi-line labels capable of handling arbitrary configurations of spans\n- Multi-file errors\n- Generic across custom spans and file caches\n- A choice of character sets to ensure compatibility\n- Coloured labels \u0026 highlighting with 8-bit and 24-bit color support (thanks to\n  [`yansi`](https://github.com/SergioBenitez/yansi))\n- Label priority and ordering\n- Compact mode for smaller diagnostics\n- Correct handling of variable-width characters such as tabs\n- A `ColorGenerator` type that generates distinct colours for visual elements.\n- A plethora of other options (tab width, label attach points, underlines, etc.)\n- Built-in ordering/overlap heuristics that come up with the best way to avoid overlapping \u0026 label crossover\n\n## Cargo Features\n\n- `\"concolor\"` enables integration with the [`concolor`](https://crates.io/crates/concolor) crate for global color output\n  control across your application\n- `\"auto-color\"` enables `concolor`'s `\"auto\"` feature for automatic color control\n\n`concolor`'s features should be defined by the top-level binary crate, but without any features enabled `concolor` does\nnothing. If `ariadne` is your only dependency using `concolor` then `\"auto-color\"` provides a convenience to enable\n`concolor`'s automatic color support detection, i.e. this:\n```TOML\n[dependencies]\nariadne = { version = \"...\", features = [\"auto-color\"] }\n```\nis equivalent to this:\n```TOML\n[dependencies]\nariadne = { version = \"...\", features = [\"concolor\"] }\nconcolor = { version = \"...\", features = [\"auto\"] }\n```\n\n## Planned Features\n\n- Improved layout planning \u0026 space usage\n- Non-ANSI terminal support\n- More accessibility options (screenreader-friendly mode, textured highlighting as an alternative to color, etc.)\n- More color options\n- Better support for layout restrictions (maximum terminal width, for example)\n\n## Stability\n\nThe API (should) follow [semver](https://www.semver.org/). However, this does not apply to the layout of final error\nmessages. Minor tweaks to the internal layout heuristics can often result in the exact format of error messages changing\nwith labels moving slightly. If you experience a change in layout that you believe to be a regression (either the change\nis incorrect, or makes your diagnostics harder to read) then please open an issue.\n\n## Credit\n\nThanks to:\n\n- `@brendanzab` for their beautiful [`codespan`](https://github.com/brendanzab/codespan) crate that inspired me to try\n  pushing the envelope of error diagnostics.\n\n- `@estebank` for showing innumerable people just how good compiler diagnostics can be through their work on Rust.\n","funding_links":["https://github.com/sponsors/zesterer"],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesterer%2Fariadne","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzesterer%2Fariadne","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesterer%2Fariadne/lists"}