Skip to content

Conversation

@magnusbaeck
Copy link
Member

Applicable Issues

Fixes #274

Description of the Change

All JSON files are reformatting according to Python and jq. To make sure we don't start to diverge a new Python-based test that's run from tox.ini checks that all .json files are formatted like Python pretty-prints them (which also appears to coincide with how jq wants files to be formatted).

Alternate Designs

None.

Benefits

Formatting the JSON files (primarily the schemas) consistently makes it easier to machine-edit many files with Python or jq without introducing irrelevant and distracting deltas. If machine-editing files with a more primitive tool that isn't JSON-aware inconsistencies can even result in unexpected results.

Possible Drawbacks

None.

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.

Signed-off-by: Magnus Bäck <[email protected]>

Formatting the JSON files (primarily the schemas) consistently makes it
easier to machine-edit many files with Python or jq without introducing
irrelevant and distracting deltas. If machine-editing files with a more
primitive tool that isn't JSON-aware inconsistencies can even result in
unexpected results.

To make sure we don't start to diverge a new Python-based test that's
run from tox.ini checks that all .json files are formatted like Python
pretty-prints them (which also appears to coincide with how jq wants
files to be formatted).
@magnusbaeck magnusbaeck requested a review from a team as a code owner February 7, 2022 13:12
Copy link
Member

@m-linner-ericsson m-linner-ericsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Looks good to me just a question if we need to update the requirements file or not

@m-linner-ericsson m-linner-ericsson merged commit 2d848fa into eiffel-community:master Mar 21, 2022
@magnusbaeck magnusbaeck deleted the jsonformat branch March 24, 2022 11:56
m-linner-ericsson referenced this pull request Mar 25, 2022
Adding prototype scripts for converting the original JSON schemas to
the new format and generating new schemas based on those files as well
as Markdown files.

So far only EiffelCompositionDefinedEvent has been converted. The new
definition YAML file was created with the added convert.py but has been
further refined by hand.

Don't get hung up on minor problems or omissions in the generated files
because there are plenty of them. Perhaps notably we're not able to
generate an .md file for EiffelMetaProperty, nor are we linking to such
a file from EiffelCompositionDefinedEvent.md.

Note that the schema file is unchanged, thus we'll be able to introduce
this change without issuing new event versions across the board.
e-backmark-ericsson pushed a commit to e-backmark-ericsson/eiffel that referenced this pull request Apr 13, 2022
…iffel-community#295)

Formatting the JSON files (primarily the schemas) consistently makes it
easier to machine-edit many files with Python or jq without introducing
irrelevant and distracting deltas. If machine-editing files with a more
primitive tool that isn't JSON-aware inconsistencies can even result in
unexpected results.

To make sure we don't start to diverge a new Python-based test that's
run from tox.ini checks that all .json files are formatted like Python
pretty-prints them (which also appears to coincide with how jq wants
files to be formatted).
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.

Reformat schema files to simplify machine edits

4 participants