Hide .snap snapshot files by insta.rs framework#7235
Hide .snap snapshot files by insta.rs framework#7235nyurik wants to merge 1 commit intogithub-linguist:mainfrom
Conversation
See https://insta.rs/docs/snapshot-files/ By default .snap files are stored in the `.../snapshots/*.snap`, but user may modify the location. For now, I marked all `.snap` files as internal, but this may need to be revisited if other common extension is also .snap
There was a problem hiding this comment.
This is too blunt a weapon. Linguist only associates this extension with the Jest Snapshot language. This change will mark all .snap files as generated too which is not correct else they would have been marked as generated at the time language support was added.
@lildude I was concerned about it too tbh... can you suggest a way to limit these files somehow, e.g. maybe by its content? Or only if this is a "rust language" repo? |
There are several things you can do in combination:
You can see examples of all of these in the the linguist/lib/linguist/generated.rb Lines 252 to 261 in 6f97158 |
Description
*.snapare snapshot files stored by the popular Rust Insta framework, and are auto-generated when the test results are accepted. Subsequent test runs just match results against these files.By default .snap files are stored in the
.../snapshots/*.snap, but user may modify the location. For now, I marked all.snapfiles as internal, but this may need to be revisited if other common extension is also .snapExamples of /snapshots/*.snap - 103k instances.
Note that it appears
.snapis often used by other repositories for similar purpose, so I think it might be OK to hide it for them as well. Code search without /snapshots/ prefixChecklist: