Conflicts with black
See original GitHub issueHi! Thanks for this useful tool!
When I save out new snapshots, they aren’t in the format recognized by Black, which involves running the formatter a second time. This is a little fiddly, and I don’t really care about having the format just so, so I would prefer to automatically ignore these files.
Some possible solutions:
- Add
to the block at the top of the snapshot file. I’ve tested this, it works, and it’s easy.# fmt: off
- Let people decide whether they want this header. I’d turn it on by default – since it’s a good default – and let people turn it off if they really want their files formatted by Black.
- If Black is available, before writing the file, attempt to run the output through Black. Let users disable this behavior in config. I like this option best because it’s a very nice developer experience (even though it would be a little inconvenient for my use case, which sadly is a lib that has Python 2 deps, so I can’t run tests and Black in the same env).
- Try to modify the output to cohere to Black’s demands. I expect this is impractical.
With some guidance about which way to go, I’d be happy to contribute this.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Black-White Conflict Isn't Society's Largest
Blacks, in particular, consistently see more social conflict than do other demographic groups. But not even blacks believe that racial conflict ...
Read more >Black Korean Relations in an American City - JSTOR
Black consumers, and looting and burning of targeted Korean businesses during the 1992 Los Angeles uprisings. and economic differences between these two groups ......
Read more >Conflict Resolution in the African American
Based on a literature review, this study examines variables that contribute to interpersonal conflicts in the African- American adolescent population.
Read more >Why the trope of Black-Asian conflict in the face of anti-Asian ...
A recent survey shows that more than three out of four Asian Americans worry about experiencing hate crimes, harassment, and discrimination ...
Read more >Conflict in Black male/female relationships
Conflict in Black male/female relationships. Debra Colleen Taylor. Marilyn Renee McClain. Follow this and additional works at: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
How about adding a formatter hook to snapshottest and let people choose whatever formatter they like?
Ideally, auto-generated files shouldn’t be formatted, so adding a
# fmt: off
line seems like a very simple solution to this problem compared to adding a formatting hook.@syrusakbary would you accept a PR adding a
# fmt: off
line?