exercism / scheme

Exercism exercises in Scheme.
https://exercism.org/tracks/scheme
MIT License
35 stars 46 forks source link

Configlet fmt config.json files #292

Closed BNAndras closed 10 months ago

BNAndras commented 10 months ago

The latest configlet beta extends fmt to also work on the track config.json. I also patched the relative path for example.scm so sync puts it in the expected location inside .meta and not the root of the exercise.

guygastineau commented 10 months ago

Did you need to pass special arguments to configlet fmt to get it to handle the config.json? We generate the config from track.ss, although the existing one is loaded first from GitHub if it isn't already present in an untracked directory called closet. that means, it is okay to add things like you are adding to it here directly to the json file, but the track specific information is all added based on file data in sexp format. If we should have configlet fmt handle the formatting of the config.json file, then we should probably have make-config in code/track.ss call configlet fmt to ensure we don't accidentally make horrible noise in PRs. Let me know if my explanation has made any sense. I am just reviewing during short work breaks right now.

BNAndras commented 10 months ago

./bin/configlet fmt warns if the config.json is broken. ./bin/configlet fmt -u or ./bin/configlet fmt -uy will format the track config, but that seems a bit dangerous since it'll also format other unformatted exercise configs. There doesn't seem to be a good way to format just the track config.

guygastineau commented 10 months ago

That makes sense. We should just put that in some part of the Makefile, I think, but we don't need that for this PR to go through.

guygastineau commented 10 months ago

Please make an issue about it if you wish, or I can make one later. Thanks for your work on this PR!