Skip to content
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

Allow Mbed config files to be json5 in addition to json #194

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

multiplemonomials
Copy link
Collaborator

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

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[X] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

I've updated the existing Python tests to test out mbed_app.json and mbed_lib.json being json5 as well.


Reviewers


@multiplemonomials multiplemonomials merged commit 7e9d658 into master Oct 26, 2023
9 checks passed
@multiplemonomials multiplemonomials deleted the dev/mbed-cfgs-json5 branch October 26, 2023 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants