-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
auto-sort and format library.json after a push #115
Conversation
Feel free to close this if you have a different approach in mind. I'm hoping this is enough to get the automation working, since it looks like device submissions are really taking off! |
Thanks for your continued interest in this, I will have a look at this soon, the sorting will be useful as I'm hitting a lot of PR's that don't come sorted. |
Little improvement suggestion: As "battery_quantity" is optional I expect some PRs to introduce a json error in which "battery_type" has a superfluous or missing comma. Could your script default to name the "battery_type" last? @andrew-codechimp wdyt? |
@ThomDietrich I'm not seeing too many people having an extra last comma |
One thing I have noticed is that some JSON characters are being automatically escaped that are not escaped by some folks who contribute manually. |
I do a trial json load before updating the library so they will at least be caught if they were going to cause a problem. |
Now that I've done with the large features I may get some time to look at this more. |
This reverts commit 4b2e7aa.
In merging main back into my branch here, I overwrote what I had in my library file with what you have in main in case I had messed anything up during testing. |
It should be all ready for a merge, although I didn't add the new script folder you made: I'm happy to do it, but figured this way that commit could come from you as the author. |
I've just added the scripts and merged. I'm leaving the other repo hanging about so I can test stuff in future, if you want to test any changes feel free to over there. |
Parses json, sorts by manufacturer+model, and writes back to file (eliminating trailing whitespace, fixing alphabetizing, and other jank)