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

Normalize the config file to minimize noise later #369

Closed
wants to merge 1 commit into from

Conversation

kytrinyx
Copy link
Member

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

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",
Copy link
Member

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,
Copy link
Member

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",
Copy link
Member

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)

Copy link
Member

@petertseng petertseng left a 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.

@kytrinyx
Copy link
Member Author

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.
I'd appreciate it if you would weigh in on that discussion with any suggestions for improving how we handle configs, consistency, and normalization.

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.

@kytrinyx kytrinyx closed this Oct 24, 2017
@petertseng petertseng deleted the normalize-configs branch October 24, 2017 04:35
@petertseng petertseng mentioned this pull request Apr 20, 2018
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.

2 participants