wins1ey / LibreSplit

Free speedrun timer with auto splitting and load removal for Linux.
GNU General Public License v3.0
20 stars 6 forks source link

Show a helpful popup for malformed json #49

Closed Drayux closed 3 months ago

Drayux commented 3 months ago

Short little pull request (and admittedly my first to a public repo so hopefully I've done alright!)

image

I found this repo awhile back and really looked forward to trying it out once I had the rest of my setup together for speedrunning again. Finally with the chance to poke at it today, I found myself stumped for quite some time trying to make a splits file. Little did I know that proper JSON could have extraneous commas!

Alas, I only figured this out after digging through the source and a bit of "print statement debugging." I figured while I was in there, might as well extend that out to a proper GUI popup instead.

If you'd be interested to merge such a thing but have any reservations, please let me know and I'd be happy to try and resolve them!

wins1ey commented 3 months ago

Looks good, thanks for contributing.

I'd suggest having it also specify the name of the split file in the popup by adding the file string to the error_popup string. I think this will make it clearer that the error is caused by the split file and not something else in LibreSplit.

Also as long as you have clang-format installed you can run make format to automatically format the code and that'll make the failed GitHub workflow pass.

Drayux commented 3 months ago

That's a great idea, I'll make the tweak! Thanks for the pointer on formatting as well!