lint(track_config): warn for empty practices
and Practice Exercise prereqs
#428
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this PR,
configlet lint
now checks that a track-levelconfig.json
file follows the below rules:exercises.practice[].practices
value must be a non-empty arrayof strings if
exercises.practice[].status
is not equal todeprecated
exercises.practice[].prerequisites
value must be a non-emptyarray of strings if
exercises.practice[].status
is not equal todeprecated
The checks are currently implemented as a warning. That is, a violation
does not by itself cause configlet to exit with a non-zero exit code.
@ErikSchierboom How should we approach this? Populating the values in these arrays is a lot of work, and many tracks don't even have concepts to populate them with. Should we maybe enable it as a warning only for tracks that set
status.concept_exercises
totrue
?Currently this PR just prints the count, rather than each slug. I did this to reduce the verbosity, and because a maintainer probably fixes this by searching for "practices", not for each slug. But maybe printing the slugs makes more sense if we somehow warn only for tracks that have a small number of empty
practices
and Practice Exerciseprerequisites
.One issue is that we might want a different timeline for these warnings than that shown in the current warning message:
Aside: the proc that this PR touches now handles Concept and Practice Exercises differently enough that a combined proc doesn't help much to reduce duplication.
This PR currently produces the below diff to the output of
configlet lint
, per track:babashka
bash
c
cfml
clojure
clojurescript
coffeescript
common-lisp
cpp
crystal
csharp
d
dart
delphi
elixir
elm
emacs-lisp
erlang
fortran
fsharp
gleam
go
groovy
haskell
java
javascript
julia
kotlin
lfe
lua
mips
nim
objective-c
ocaml
perl5
pharo-smalltalk
php
plsql
prolog
purescript
python
r
racket
raku
reasonml
ruby
rust
scala
scheme
shen
sml
swift
tcl
typescript
vbnet
vimscript
wren
x86-64-assembly
z3