-
-
Notifications
You must be signed in to change notification settings - Fork 23
WIP: starting to restructure fixtures and modify track config struct #187
base: v3-upgrades
Are you sure you want to change the base?
Conversation
The code changes for linting should be fairly straightforward, but I'm concerned about the scope of the repercussions to the rest of the features (fmt, tree, generate). This is not yet an informed opinion, but my gut says that it might be faster and easier to essentially rewrite these tools using json-schema (or maybe joi) as suggested in #152. For your consideration, @ErikSchierboom. |
"uuid": "2CE9984C-64C1-41F3-AEBA-037F8C06616F", | ||
"slug": "aluminum", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for consistency with the concept exercises:
"uuid": "2CE9984C-64C1-41F3-AEBA-037F8C06616F", | |
"slug": "aluminum", | |
"slug": "aluminum", | |
"uuid": "2CE9984C-64C1-41F3-AEBA-037F8C06616F", |
"topics": [], | ||
"teaches": [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the topics
property is only temporary. It will be used to help with filling the prerequisites
key:
"topics": [], | |
"teaches": [], | |
"topics": ["conditionals", "optional_values", "text_formatting"], |
"topics": [], | ||
"teaches": [], | ||
"prerequisites": ["basics", "strings"], | ||
"difficulty": 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that practice exercises can have an optional deprecated
property:
"deprecated": true
type PracticeMetadata struct { | ||
Slug string `json:"slug"` | ||
UUID string `json:"uuid"` | ||
IsCore bool `json:"core"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property will be removed in v3
Slug string `json:"slug"` | ||
UUID string `json:"uuid"` | ||
IsCore bool `json:"core"` | ||
AutoApprove bool `json:"auto_approve,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property will be removed in v3
UUID string `json:"uuid"` | ||
IsCore bool `json:"core"` | ||
AutoApprove bool `json:"auto_approve,omitempty"` | ||
UnlockedBy *string `json:"unlocked_by"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property will be removed in v3
AutoApprove bool `json:"auto_approve,omitempty"` | ||
UnlockedBy *string `json:"unlocked_by"` | ||
Difficulty int `json:"difficulty"` | ||
Topics []string `json:"topics,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prerequisites
field also needs to be added:
Topics []string `json:"topics,omitempty"` | |
Prerequisites []string `json:"prerequisites,omitempty"` | |
Topics []string `json:"topics,omitempty"` |
|
||
// ConceptMetadata contains metadata about an implemented concept exercise. | ||
// The order below determines the order delivered by the API. | ||
type ConceptMetadata struct { | ||
Slug string `json:"slug"` | ||
UUID string `json:"uuid"` | ||
IsCore bool `json:"core"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property does not exist for concept exercises.
|
||
// ConceptMetadata contains metadata about an implemented concept exercise. | ||
// The order below determines the order delivered by the API. | ||
type ConceptMetadata struct { | ||
Slug string `json:"slug"` | ||
UUID string `json:"uuid"` | ||
IsCore bool `json:"core"` | ||
AutoApprove bool `json:"auto_approve,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property does not exist for concept exercises.
|
||
// ConceptMetadata contains metadata about an implemented concept exercise. | ||
// The order below determines the order delivered by the API. | ||
type ConceptMetadata struct { | ||
Slug string `json:"slug"` | ||
UUID string `json:"uuid"` | ||
IsCore bool `json:"core"` | ||
AutoApprove bool `json:"auto_approve,omitempty"` | ||
UnlockedBy *string `json:"unlocked_by"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property does not exist for concept exercises.
Slug string `json:"slug"` | ||
UUID string `json:"uuid"` | ||
IsCore bool `json:"core"` | ||
AutoApprove bool `json:"auto_approve,omitempty"` | ||
UnlockedBy *string `json:"unlocked_by"` | ||
Difficulty int `json:"difficulty"` | ||
Topics []string `json:"topics"` | ||
Topics []string `json:"topics,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The topics
key does not exist. It should be replaced with:
Topics []string `json:"topics,omitempty"` | |
Concepts []string `json:"concepts,omitempty"` | |
Prerequisites []string `json:"prerequisites,omitempty"` |
I like the idea of using JSON schema to validate the track config. |
@ErikSchierboom I wanted to get this PR going early so that you could validate the V3 changes to the
fixtures/lint/valid-track/config.json
before I spend too much time writing code against them.