Original Source
- Original title: Simple Feature Request: Pretty-Print JSON For Easier Source Control
- Original author: wilg
- Original date: December 27, 2015
- Source thread: https://forums.rpgmakerweb.com/threads/simple-feature-request-pretty-print-json-for-easier-source-control.53773/
- Source forum path: Game Development Engines > Legacy Engine Support > RPG Maker MV Support
Summary
The JSON files RPG Maker generates are almost perfect for source control in something like Git – they're plaintext and easy to understand. The only problem is they're minified JSON so everything is on one line, which makes source control difficult. Source control is so important for large complicated projects like games. It's useful for both one person and multiple contributors. This really quick change would be a night-and-day difference. Hopefully it's a very minor change that can be added without breaking anything.
Archived First Post
The only problem is they're minified JSON so everything is on one line, which makes source control difficult.
Source control is so important for large complicated projects like games. It's useful for both one person and multiple contributors. This really quick change would be a night-and-day difference.
Hopefully it's a very minor change that can be added without breaking anything.
I work around this by running the following Ruby script before committing (works on Mac OS X and Linux only):
#!/usr/bin/env rubyrequire 'json'Dir.glob("./**/*.json").each do |path| txt = File.read(path) struct = JSON.parse(txt) File.write(path, JSON.pretty_generate(struct))endWith this, my diffs all look great and they're really easy to understand:
Protected download
Would love for this to get added!
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadReferenced Images / Attachments
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...
