-
Notifications
You must be signed in to change notification settings - Fork 529
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
Normalize the config file to minimize noise later #369
Conversation
We will be scripting a number of changes to the track configuration. This runs configlet fmt, which ensures that any further changes can be minimized.
@@ -1,820 +1,818 @@ | |||
{ | |||
"language": "Rust", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems too important to shunt to the bottom of the file. I have evidence in exercism/bash@6fabd6f and exercism/bash#91 that this caused a mistaken assumption that the language
attribute was absent. If this should indeed move, I need to hear a way to prevent others from making the same mistake.
] | ||
"println" | ||
], | ||
"unlocked_by": null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be the case that unlocked_by and core are next to each other? They seem too closely related to separate in this manner.
"difficulty": 1, | ||
"slug": "hello-world", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slug seems important. it seems like it should come first or second (behind uuid)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get it, I should not expect in JSON to have any sort of ordering among my keys, and so "might as well pick alphabetical it's as good as any".
I counter that the JSON has been serialised to a file and presumably this file is at least partially for human consumption: we ask humans to make changes to config.json when adding a new exercise, for example, and do not provide any tooling to do so!
As a result, it is my obligation to defend the humans and say that, as represented in the JSON files in the repository, we should not accept a change that impairs the human's ability to understand.
The claim of this PR is that it will make scripted changes easier. Well, what I'm going to do in such an instance is the equivalent of:
- run
configlet fmt
, record the diff. - make the desired scripted change
- revert the diff from
configlet fmt
, leaving only the scripted change in place.
I accept the cost of doing this myself for the tracks that I maintain, instead of reformatting config files.
There's a discussion happening in exercism/meta#95 about how this normalization degrades the readability of the configs. That discussion has some good suggestions for improvements to the serializer. Meanwhile, I'm going to close this and wait for that discussion to play out. I'm sorry about the noise, and any extra work that I've caused you. |
We will be scripting a number of changes to the track configuration.
This runs configlet fmt, which ensures that any further changes can be minimized.
See exercism/meta#95