exercism / configlet

The official tool for managing Exercism language track repositories.
https://exercism.org/docs/building/configlet
GNU Affero General Public License v3.0
22 stars 14 forks source link

lint: should allow omitting keys: `concepts` and `exercises.concept` #831

Closed ee7 closed 1 year ago

ee7 commented 1 year ago

Due to https://github.com/exercism/configlet/commit/66914845a323d2e21ab7d8b00b7219d0777f4c17, fmt removes these key/value pairs when the values are empty. But that causes lint to produce an error.

This behavior was included in 4.0.0-beta.15, which was available for a little less than an hour. But I rolled back (by marking it as a prerelease), so fetch-configlet once again downloads the previous version.

To-do:

Reported by: https://forum.exercism.org/t/configlet-woes-fmt-removed-too-much/7605

@ErikSchierboom what would you prefer here? To change the behavior of lint (and the spec), or change the behavior of fmt?

The lint spec currently says that the keys are required:

ErikSchierboom commented 1 year ago

@ErikSchierboom what would you prefer here? To change the behavior of lint (and the spec), or change the behavior of fmt?

I would prefer changing lint and the spec. It is perfectly fine for tracks to not have concepts or concept exercises I feel, and there is little value in them being empty arrays.

ErikSchierboom commented 1 year ago

And in practice they are optional, as we gracefully handle them not being there.

ErikSchierboom commented 1 year ago

Ideally, add some new integration tests, where we run configlet lint after configlet fmt makes changes to track-level config.json files

That's a great idea.

ee7 commented 1 year ago

I would prefer changing lint and the spec. It is perfectly fine for tracks to not have concepts or concept exercises I feel, and there is little value in them being empty arrays.

OK. Let's go with that. Maybe later we could also check there aren't any other keys that are currently required, but could be optional.