Allow Mbed config files to be json5 in addition to json #194
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
Too long we have suffered under the heel of the oppressive JSON parser and its hatred of comments! Mbed OS has loads of config files with all sorts of complicated settings in them. I'm sure that there are very good reasons why these settings are how they are, but much of this information has been lost to time because these JSON config files didn't allow comments.
No longer! Starting today, we have the option to write any and all JSON config files in the JSON5 standard instead. JSON5 is similar to JSON, except that it allows C-style comments in the code! So, we can now write comments for target, library, and application settings. Truly this is the beginning of a new era!
Impact of changes
mbed_lib.json, mbed_app.json, and custom_targets.json may now optionally be written as json5. The file extension is used to determine the format, and if the file is json5, it may have comments in it!
targets.json has now been permanently renamed to targets.json5.
Migration actions required
Documentation
None
Pull request type
Test results
I've updated the existing Python tests to test out mbed_app.json and mbed_lib.json being json5 as well.
Reviewers