mitsuhiko / insta

A snapshot testing library for rust
https://insta.rs
Apache License 2.0
2.07k stars 93 forks source link

Find a different syntax for inline snapshot so that cargo fmt can work #499

Open tisonkun opened 3 weeks ago

tisonkun commented 3 weeks ago

Currently, @r###"..."### the inline snapshot syntax is invalid during cargo fmt analyze and cannot be formatted.

Perhaps a different syntax (e.g. i=r"") can be used for helping in this case.

max-sixty commented 3 weeks ago

Check out https://github.com/mitsuhiko/insta/issues/456, both this:

Would be great for inline snapshots to work with rustfmt, but don't think there's a way — if the inline snapshot is a normal expression without special syntax (such as @), it's not possible to discriminate between (name, value) and (value, snapshot)

...and the broader discussion.

I agree that it would be great to allow rustfmt to work, though lots of other tradeoffs...