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
insta review fails with a hidden snapshot directory (starting with '.') #326
Comments
This is intentional behavior. EDIT: It doesn't look like it was intentional to turn on hidden folders at all. The current logic skips it in the filter even when |
With the next version you will be able to pass |
@mitsuhiko Thanks for the quick reply & fix! |
Hi @mitsuhiko, I just updated to tl;dr I have the same use case as before, which is:
Current behavior1️⃣ When I run 2️⃣ When I run Expected behaviorIn my use case, I would expect 1️⃣ to have the same behavior than 2️⃣. The error message in 1️⃣ should not appear as it advises me to use the flag I did use. |
What happened?
Hi,
I'm using a custom directory for my snapshot located at the root of my project at
$CARGO_MANIFEST_DIR/.snapshots
. When running my tests, snapshots are generated correctly. However,cargo insta review
fails to locate them.Changing the directory to a non-hidden one; removing the
.
prefix; works fine.Theory
After quickly scanning the source I think it may come from these lines:
insta/cargo-insta/src/cargo.rs
Lines 257 to 258 in ab93e8d
From the WalkDir documentation, it seems that the
standard_filters
re-enables thehidden
option. So it might be the case that it's overriding the previoushidden(false)
option in the context of reviewing snapshots.As a side note, my
.snapshots
directory is not git ignored so my issue must come from thehidden
option, and not thegit_ignore
one enabled bystandard_filters
.Reproduction steps
with_settings!
.cargo insta review
.done: no snapshots to review
.Insta Version
No response
rustc Version
No response
What did you expect?
I expect
cargo insta review
to properly locate the snapshot directory.The text was updated successfully, but these errors were encountered: