[configlet] Version 4.0.0-beta.18 released (support for creating exercises)

We’ve release version 4.0.0-beta.18 of configlet: Release 4.0.0-beta.18 · exercism/configlet · GitHub This release extends the configlet create command to allow creating the basic structure and files of a concept or practice exercise! You can use it as follows:

configlet create --concept-exercise foo
configlet create --practice-exercise foo
configlet create --practice-exercise foo --offline

The command will create the file corresponding files as specified in the files templates in the track’s config.json file. For practice exercises that are defined in prob-specs, it will also sync the docs and metadata. Finally, it also creates an entry in the track’s config.json exercises.practice or exercises.concept array.

I expect this to be remove some of the less fun parts of adding a new exercise and hopefully can makes some existing exercise creation scripts simpler.

Thanks to @ee7 for the review.

2 Likes

Some tracks have their own tooling set up for exercise creation like Scheme and it’d be pretty hard to switch to using this setup… Could configlet be extended to allow custom exercise creation functionality to be run? Perhaps configlet could read an optional setting in config.json that points to a script file that configlet runs if present. That file can then execute the custom logic a track already has present.

1 Like

I don’t think that needs to be added to configlet. If maintainers want to continue to use the handmade creation script, then just don’t use configlet.

My impression is this new configlet feature has been bubbling at the back of Erik and ee7’s brains for a while, aggregating lessons learned from recent new tracks.

Basically this. I envisioned configlet create replacing existing scripts or else replace parts of existing scripts, where those scripts can then build on what configlet create does. This is what I’ll do for C#, where parts of my existing logic can be replaced with configlet create, after which I’ll do some post-processing (like generating the tests).

But you don’t have to use it of course if you existing tooling is working well!

configlet create -e <slug> --approach <name> created an entry in the approaches config.json, but after I filled in the information, configlet fmt said the config.json wasn’t formatted.

The problem I had encountered was that the authors array for an approach was created as "authors": [] so I inadvertently added my name like "authors": ["BNAndras"]. However configlet fmt wanted something like this:

"authors": [
  "BNAndras"
]

Can we have configlet create set up the authors array like this? Then, we won’t need to clean it up later with configlet fmt.

"authors": [
]