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

--inline-snapshot=fix/create shouldn't cause the review diff to be printed #128

Closed
samuelcolvin opened this issue Nov 5, 2024 · 4 comments

Comments

@samuelcolvin
Copy link

As per #123, my bad for creating an issue with multiple points.

Currently when I use --inline-snapshot=fix or --inline-snapshot=create I get a massive diff printed. This is the result of a mixture of ruff formatting differing from this library, my preferences and IsNow() replacing datetimes.

As per #123 Is() might solve some of these, but not all.

I'd like (either as the default, or via a config argument) to be able to disable the diff being printed.

Another downside of the big diff is that it means I can't set export INLINE_SNAPSHOT_DEFAULT_FLAGS=create by default.

@alexmojaki
Copy link

--inline-snapshot=fix,short-report works.

When the report is printed, it says underneath:

These changes are not applied.
Use --inline-snapshot=update to apply them, or use the interactive mode with --inline-snapshot=review

It should also suggest short-report in that message, because I only found this in the context of this discussion.

@15r10nk
Copy link
Owner

15r10nk commented Nov 7, 2024

#129 will fix this issue

--inline-snapshot=fix will only report what it has fixed and nothing more.
--inline-snapshot=fix,report will also report other changes which is equivalent to the current behaviour.

@samuelcolvin
Copy link
Author

🎉 thanks so much!

@15r10nk
Copy link
Owner

15r10nk commented Nov 11, 2024

Fixed in 0.14.0. I will work on how inline-snapshot generates code. These huge diffs shouldn't be there in the first place.

@15r10nk 15r10nk closed this as completed Nov 11, 2024
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

No branches or pull requests

3 participants