Skip to content

Commit

Permalink
Add pending deprecation warning for --accept-unseen (#668)
Browse files Browse the repository at this point in the history
Open to this being shot down. If others tend to agree, this is a
low-cost way of figuring out whether anyone is using it
  • Loading branch information
max-sixty authored Feb 1, 2025
1 parent 272d628 commit a3bcd06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to insta and cargo-insta are documented here.
## 1.42.1

- Improved handling of control characters in inline snapshots. #713
- Add pending deprecation warning for `--accept-unseen`. We've left an issue
open at <https://github.com/mitsuhiko/insta/issues/659> eliciting feedback on
whether anyone uses this for a few months. A warning will now be printed when
`--accept-unseen` is used, and we'll eventually remove the feature unless we
get some feedback that it's useful. #668

## 1.42.0

Expand Down
7 changes: 7 additions & 0 deletions cargo-insta/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,13 @@ fn process_snapshots(
fn test_run(mut cmd: TestCommand, color: ColorWhen) -> Result<(), Box<dyn Error>> {
let loc = handle_target_args(&cmd.target_args, &cmd.test_runner_options.package)?;

if cmd.accept_unseen {
eprintln!(
"{} If this option is materially helpful to you, please add a comment at https://github.com/mitsuhiko/insta/issues/659.",
style("`--accept-unseen` is pending deprecation.").bold().yellow()
)
}

// Based on any configs in the config file, update the test command. Default
// is `SnapshotUpdate::Auto`.
match loc.tool_config.snapshot_update() {
Expand Down

0 comments on commit a3bcd06

Please sign in to comment.