-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Align inine snapshot handling with file snapshots #510
Comments
I agree on the complexity. I'm really mentally going more and more back to the discussion in #456. I think that part of the challenge here really is that these two features (inline and non inline) just came at different times and in the wrong order. If you treat the primary goal of the crate to just update snapshots in locations, then how that happens can be simplified. Say we have a But I agree that this should be aligned between the two modes. |
I'm finding the crate is getting increasingly complicated, to the extent that as the second contributor (albeit far behind @mitsuhiko...) I'm sometimes scratching my head in how things work. Features such as #489 are great but will continue to make the main path more complicated.
Potentially some unnecessary complication comes from how differently inline & file snapshots are handled:
.pending-snap
files, "pending" file snapshots write to.snap.new
filesCould we instead use
.snap.new
files for both file and pending snapshots, with a marker in their metadata indicating which is which? We'd read the old value from the rust file itself, wouldn't need to track run-id, and so collapse a lot of code in our main path. (We'd need to think about how line numbers change as code is updated, maybe other things I haven't thought of). As well as making the crate simpler, we also make its explanation simpler — when writing docs we often have to give footnotes like this:insta/insta/src/lib.rs
Lines 171 to 172 in 58daea1
We'd need to handle both for a while, and so somewhat dependent on a mechanism such as #509 to ensure we don't have to handle both forever
The text was updated successfully, but these errors were encountered: