Skip to content
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

Improve docs for snapshot updates #479

Merged
merged 6 commits into from
May 15, 2024
Merged

Conversation

max-sixty
Copy link
Sponsor Contributor

@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
Sponsor Contributor 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
Sponsor Contributor 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
Sponsor Contributor 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
11 checks passed
@max-sixty max-sixty deleted the snapshot-doc branch May 15, 2024 22:37
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.

None yet

2 participants