Skip to content

Improve docs for snapshot updates#479

Merged
mitsuhiko merged 6 commits intomitsuhiko:masterfrom
max-sixty:snapshot-doc
May 15, 2024
Merged

Improve docs for snapshot updates#479
mitsuhiko merged 6 commits intomitsuhiko:masterfrom
max-sixty:snapshot-doc

Conversation

@max-sixty
Copy link
Copy Markdown
Collaborator

@max-sixty max-sixty commented May 2, 2024

This attempts to clarify when snapshots are written to pending .snap.new files vs. to overwriting .snap files vs. doing nothing to snapshots.

It also changes .with_extension(...), lmk if you prefer those on a separate PR

This attempts to clarify when snapshots are written to draft `.snap.new` files as opposed to overwriting `.snap` files
@max-sixty
Copy link
Copy Markdown
Collaborator Author

Requires #481 to pass

max-sixty added a commit to max-sixty/insta that referenced this pull request May 2, 2024
In an effort to simplify the configs, this merges the `INSTA_UPDATE` and `INSTA_FORCE_UPDATE`. I don't think it's possible to require these both; 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 changing `insta` at first, but with the future updates to `cargo-insta` commented in the code. I realize that adds a bit of complication; though on balance I think simplifying the configs would be helpful.

It stacks on mitsuhiko#479, which should merge first.

I'd be open to writing some tests for this if that'd be helpful.
max-sixty added a commit to max-sixty/insta that referenced this pull request May 2, 2024
In an effort to simplify the configs, this merges the `INSTA_UPDATE` and `INSTA_FORCE_UPDATE`. I don't think it's possible to require these both; 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 changing `insta` at first, but with the future updates to `cargo-insta` commented in the code. I realize that adds a bit of complication; though on balance I think simplifying the configs would be helpful.

It stacks on mitsuhiko#479, which should merge first.

I'd be open to writing some tests for this if that'd be helpful.
@max-sixty
Copy link
Copy Markdown
Collaborator Author

max-sixty commented May 2, 2024

Starting again, I would change some of the names:

  • new could be review or pending — common terms for this concept in insta. And new sounds like what unseen does
  • always could be accept
  • Is unseen useful?!

...but it would be an annoying backward-compat cycle given we want to support different versions of cargo-insta & the config files.

@max-sixty
Copy link
Copy Markdown
Collaborator Author

max-sixty commented May 14, 2024

This is ready to merge & not controversial

@mitsuhiko mitsuhiko merged commit acb1ce5 into mitsuhiko:master May 15, 2024
@max-sixty max-sixty deleted the snapshot-doc branch May 15, 2024 22:37
max-sixty added a commit that referenced this pull request Sep 15, 2024
In an effort to simplify the configs, this merges the `INSTA_UPDATE` and
`INSTA_FORCE_UPDATE` configs. Conceptually, `INSTA_FORCE_UPDATE`
overwrites `INSTA_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 changing `insta` at first, but with the
future updates to `cargo-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 of `insta`; I think a good approach!

~It stacks on #479, which should
merge first.~ Merged

~I'd be open to writing some tests for this if that'd be helpful.~
Written
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants