Releases: zkat/miette
v2.0.0
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 justReport
, and is a different,eyre::Report
-like type.DiagnosticResult
is now justResult
..into_diagnostic()
now just transforms the error into aReport
.DiagnosticReportPrinter
has been replaced withReportHandler
set_printer
has been replaced byset_hook
code
is now optional..into_diagnostic()
no longer takes acode
argument.#[diagnostic]
is now optional when derivingDiagnostic
.
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
fromSource
implementation forCow
. (#42) (0427c9f9)
Bug Fixes
v1.1.0
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
Bug Fixes
1.0.1
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
...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
1.0.0-beta.1
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
0.13.0
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:
- The
NO_COLOR
env var is present and set, and not0
. - The
CLICOLOR
env var is present and not set to1
. stdout
orstderr
are not TTYs.- 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
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
0.11.0
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
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:
- protocol:
0.9.0
Yay new version already! A pretty significant API change, too! ��
Breaking Changes
SourceSpan
s 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)