Closed max-sixty closed 2 weeks ago
I think this makes sense in general. I do want to run this first though so I will hold on merging until the next release.
The latest commit:
cargo-insta
...I would merge this but could you resolve the conflicts?
OK, done. The prior commit actually caught a semantic conflict when running --force-update-snapshots
on inline snapshots, so made a small change to make that work.
This PR ends up being a lot of additional code for a "simplification" PR. But in retrospect I think in the long-long term it does get simpler, and there's some nice machinery here for making insta
& cargo-insta
work together nicely (+ our ability to test that).
Missed the release so changed the 1.39->1.40, 1.40->1.41
Will merge in the next week without more feedback, given the note above, to keep things moving.
Lmk if that's too aggressive, both for this PR and the principle
In an effort to simplify the configs, this merges the
INSTA_UPDATE
andINSTA_FORCE_UPDATE
configs. Conceptually,INSTA_FORCE_UPDATE
overwritesINSTA_UPDATE
; they naturally fit into the same config setting.I realized after starting this that we want to be careful about supporting new & old versions of
cargo-insta
. So this takes a conservative approach, ~only changinginsta
at first, but with the future updates tocargo-insta
commented in the code. I realize that adds a bit of complication; though on balance I think simplifying the configs would be helpful and this makes a step towards that.~ Adjusted to use the underlying version ofinsta
; I think a good approach!~It stacks on https://github.com/mitsuhiko/insta/pull/479, which should merge first.~ Merged
~I'd be open to writing some tests for this if that'd be helpful.~ Written