Skip to content

Releases: zkat/miette

v2.0.0

08 Sep 00:38
52c98da
Compare
Choose a tag to compare

This release overhauls the toplevel/main experience for miette. It adds a
new Report type based on eyre::Report and overhauls various types to fit
into this model, as well as prepare for some future changes in
Rust
that will make it possible to
integrate miette directly with crates like eyre instead of having to use
this specific Report.

On top of that, it includes a couple of nice new features, such as
#[diagnostic(transparent)], which should be super useful when wrapping other
diagnostics with your own types!

Breaking Changes

  • report: anyhow-ify DiagnosticReport (#35) (3f9da04b)
    • DiagnosticReport is now just Report, and is a different, eyre::Report-like type.
    • DiagnosticResult is now just Result.
    • .into_diagnostic() now just transforms the error into a Report.
    • DiagnosticReportPrinter has been replaced with ReportHandler
    • set_printer has been replaced by set_hook
    • code is now optional.
    • .into_diagnostic() no longer takes a code argument.
    • #[diagnostic] is now optional when deriving Diagnostic.

Features

  • derive: Add #[diagnostic(transparent,forward)] (#36) (53f5d6d1)
  • Source: impl Source for str, &str (make &'static str usable for testing) (#40) (50c7a883)
  • source: Remove bound T: Clone from Source implementation for Cow. (#42) (0427c9f9)

Bug Fixes

  • reporter: Only inc the line count if we haven't already done so with '\n' or '\r\n' (#37) (5a474370)
  • printer: Show snippet message for unnamed sources (#39) (84219f6c)

v1.1.0

08 Sep 00:39
5d5e33d
Compare
Choose a tag to compare

This is a small release of patches entirely not my own!

The exciting new feature is the ability to do thiserror-style
#[diagnostic(transparent)] when using the derive macro, which will defer
diagnostics to a Diagnostic referred to by the struct/enum!

Big thanks to @cormacrelf and
@felipesere for your contributions!

Features

  • derive: Add #[diagnostic(transparent,forward)] (#36) (53f5d6d1)

Bug Fixes

  • reporter: Only inc the line count if we haven't already done so with '\n' or '\r\n' (#37) (5a474370)

1.0.1

23 Aug 15:07
96ca3cc
Compare
Choose a tag to compare

This is a (literally) small release. I noticed that the crate's size had
increased significantly before I realized cargo was including the images/
folder. This is not needed, as these images are just hosted on GitHub.

miette should be smaller now, I hope :)

Bug Fixes

  • crate: reduce crate size by removing images (5f74da67)

1.0.0

23 Aug 02:38
aa755bf
Compare
Choose a tag to compare

...you know what? I'm just gonna tag 1.0.0, because I don't want sub-1.0
versions anymore, but the Cargo ecosystem buries pre-releases pretty
thoroughly. Integers are cheap!

So here we are! We made it to 1.0, and with some really nice goodies to boot.

Most fun is the fact that the default printer now has clickabble url linking
support. A new Diagnostic::url() method has been added to the protocol that,
is used to figure out what URL to send folks to! This should work on most
"modern" terminals, but more thorough support checking will be done in the
future. And of course, the narrated reporter prints them out too.

I also took the time to completely redo how messages, labels, and filenames
are handled in the system, and this is a pretty big change you might run into.
Godspeed!

Last but not least, we got our first external contribution! Thank you to
@martica for the bug fix!

Anyway, here's to 1.0, and to many more after that. Enjoy! :)

Breaking Changes

  • snippets: Overhauled how snippets handle labels, sources, and messages, including the derive macro (61283e9e

Features

  • links: added URL linking support and automatic docs.rs link generation (7e76e2de)
  • theme: Add an initial rgb style with nicer colors (3546dcec) - @martica

Bug Fixes

  • printer: clamp highlight length to at least 1 (#32) (9d601599)

1.0.0-beta.1

22 Aug 06:34
196ef51
Compare
Choose a tag to compare
1.0.0-beta.1 Pre-release
Pre-release

It's happening, folks! miette is now working towards stability and is now in
beta! We'll keep it like this for a little while until a few more people have
tried it out and given feedback. New features may still be added, and breaking
changes may still happen, but miette is now considered "good enough to use",
and breaking changes are expected to be more rare.

Oh, and as part of this release, the docs were overhauled, particularly the
README, so you might want to take a gander at them!

Breaking Changes

  • printer: rename default printer and consistify some naming conventions with printing (aafa4a3d, breaks #)
  • into_diagnostic: .into_diagnostic() is now generic across any impl fmt::Display instead of expecting a dyn (c1da4a0d)

Features

  • error: diagnostic-ify MietteError (e980b723)

Bug Fixes

  • derive: #[diagnosic(severity)] works for named and unnamed variants/structs now (adf0bc93)
  • protocol: oops, missed a spot after a rename (5c077d30)

0.13.0

21 Aug 22:42
729ccd3
Compare
Choose a tag to compare
0.13.0 Pre-release
Pre-release

This release includes some accessibility improvements: miette now includes a "narratable" printer that formats diagnostics like this:

Error: Received some bad JSON from the source. Unable to parse.
    Caused by: missing field `foo` at line 1 column 1700

Begin snippet for https://api.nuget.org/v3/registration5-gz-semver2/json.net/index.json starting
at line 1, column 1659

snippet line 1: gs":["json"],"title":"","version":"1.0.0"},"packageContent":"https://api.nuget.o
    highlight starting at line 1, column 1699: last parsing location

diagnostic help: This is a bug. It might be in ruget, or it might be in the source you're using,
but it's definitely a bug and should be reported.
diagnostic error code: ruget::api::bad_json

This style is the default in a number of situations:

  1. The NO_COLOR env var is present and set, and not 0.
  2. The CLICOLOR env var is present and not set to 1.
  3. stdout or stderr are not TTYs.
  4. A CI environment is detected.

You can override and customize this behavior any way you want by using the
miette::set_reporter() function at the toplevel of your application, but we
encourage you to at least make the narratable printer an option for your
users, since miette's default printer is exceptionally bad for screen
readers.

Our hope is that this release is only the starting point towards making
miette's error reporting not just really fancy and cool, but friendly and
accessible to everyone.

Features

  • printer: added (and hooked up) an accessible report printer (5369a942)

0.12.0

21 Aug 07:34
a65cfc7
Compare
Choose a tag to compare
0.12.0 Pre-release
Pre-release

This is a SUPER EXCITING release! With this, miette now has a full-featured
pretty-printer that can handle cause chains, snippets, help text, and lots
more!

Check out the serde_json
example

to see a "real-world" case!

This release also adds support for full thiserror-style format strings to
the help() diagnostic derive attribute!

We're rapidly approaching a 1.0-beta release. One more extra-fun treat left
and we can start stabilizing!

Features

  • derive: format string support for help() (8fbad1b1)
  • printer: lots of small improvements to printer (5fbcd530)
  • reporter: fancy new reporter with unicode, colors, and multiline (#23) (d675334e)

0.11.0

21 Aug 07:33
3ed9705
Compare
Choose a tag to compare
0.11.0 Pre-release
Pre-release

BIG changes this time. The whole end-to-end experience for tossing around
Diagnostics in your code has been overhauled, printing reports is easier than
ever, and we even have an eyre::Report-style wrapper you can pass around in
app-internal returns!

Features

  • reporter: Overhauled return type/main/DiagnosticReport experience. (29c1403e)

0.10.0

21 Aug 07:33
4d45884
Compare
Choose a tag to compare
0.10.0 Pre-release
Pre-release

Lots of goodies in this release! I'm working hard on the 1.0.0
Roadmap
, so things are changing
pretty quick, and I thought it would be nice to release this checkpoint.

Bug Fixes

  • protocol: keep the owned spans (49151bb0)

Features/Breaking Changes

  • derive: Allow anything Clone + Into to be used as a Span (385171eb)
  • offsets:
    • nice utility function to get an offset from a Rust callsite (26f409c5)
    • utility function for converting from line/col to offset (75c23127)
    • more utility From impls for SourceSpan (95200366)
  • protocol:
    • add Source impls for Cow and Arc (53074d34)
    • reference-based DiagnosticReport! (f390520b)

0.9.0

21 Aug 07:32
f79aee6
Compare
Choose a tag to compare
0.9.0 Pre-release
Pre-release

Yay new version already! A pretty significant API change, too! ��

Breaking Changes

SourceSpans have changed a bit: for one, they're based on offset/length now,
instead of start/end. For two, they have a new Option<String> field,
label, which is meant to be used by reporters in different contexts. For
example, highlight snippets will use them as the labels for underlined
sections of code, while the snippet context will use the label as the "file
name" for the Source they point to.

  • protocol: new SourceSpans with labels (acfeb9c5)

Bug Fixes

  • derive: allow unused variables for the snippets method (f704d6a9)

Features

  • protocol: implement From<(usize, usize)> for SourceSpan (36b86df9)