-
-
Notifications
You must be signed in to change notification settings - Fork 23
Additional linting + JSON Schema for config.json #152
Comments
@sshine Thank you so much for tackling this question and helping tease out all of these ambiguities. This is a massive help.
They indicate different things.
I'd actually prefer not to have the key present if
Yes. I think I managed to get rid of any reference to
Agreed.
Yes, 100% yes. JSON schema is the obvious choice here.
At the moment this is true, though we've been back and forth on it. For now we've concluded that the additional complexity is unnecessary. |
Per exercism/haskell#790 the additional linting described in this issue would also include ensuring that the
This behavior should be behind a flag so that we can release the new tool without all the tracks failing. |
Came to this repo to report a bug that |
Per exercism/v3#2272 and exercism/v3#2279. We "could" order the exercise concept list by slug alphabetically |
In exercism/haskell#790 we discuss the order of exercises in config.json.
To automatically re-arrange exercises in config.json I started building a tool, not realizing that #117 existed and requests for this to be added as part of
configlet
; a more noble effort.While building this tool I wrote a typed model of config.json that led me to the following corners:
"topics"
can either be a list of strings ornull
, which presumably means the same as[]
. Doesnull
make sense over[]
?"auto_approve"
is optional and defaults tofalse
. Does it make sense to allow explicitfalse
?"deprecated"
is optional and defaults tofalse
. Does it make sense to allow explicitfalse
?"unlocked_by"
is mandatory, but can benull
or a string.The combination of
"core": true/false
and"unlocked_by": "something"/null
creates four combinations:"core": true
+"unlocked_by": null
appears to mean "core exercise"."core": false
+"unlocked_by": "something"
appears to mean "side exercise"."core": false
+"unlocked_by": null
appears to mean "always available side exercise"? (Unless"deprecated": true
.)"core": true
+"unlocked_by": "something"
is not used, since core exercises unlock by order.I propose that we:
Revise the specification (linked to from
configlet
's README.md): I think "problems
" is deprecated and it's now called "exercises
"?Address the ambiguities highlighted above; ideally, resolve them in a way that provides a canonical form (e.g. "Don't allow
"auto_approve": false
, leave it out." and ""topics"
is always a list.") and clarify the meaning of"core"
+"unlocked_by"
or disallow certain combinations. Express the formatting rules as a JSON Schema for config.json so that we can programmatically validate the specification withconfiglet
.Expand on
configlet
's high-level constraints (ones not easily encoded as JSON Schema) that we assume, e.g. that side exercises can't unlock other exercises (I don't know if this is true, or if the opposite is intended, but it's not clear that it is or should eventually be possible), or that exercises must be ordered a certain way in the file (as discussed in Decide whether the exercises in config.json should follow any specific order haskell#790), or that"unlocked_by"
must point to an actual exercise. (Again, I'm not sure exactly what linting rules currently apply.)The text was updated successfully, but these errors were encountered: