Skip to content

Commit

Permalink
lint(track_config): disallow a difficulty of 0 (#447)
Browse files Browse the repository at this point in the history
With this commit, `configlet lint` now produces an error if there is a
Practice Exercise in the track-level `config.json` file that has a
`difficulty` value of `0`.

Typically, exercises with such a value were deprecated exercises.
However, a deprecated exercise still appears on the website for a user
who started that exercise before it was deprecated, and therefore an
exercise's difficulty level should not be changed when it is deprecated.

We have created a PR on every track that had at least one exercise with
a `difficulty` of `0`, updating them to use an allowed value.

See: exercism/docs#290
  • Loading branch information
ee7 committed Oct 22, 2021
1 parent ecc2245 commit 36a07d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lint/track_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ proc isValidPracticeExercise(data: JsonNode; context: string;
hasString(data, "slug", path, context, maxLen = 255, checkIsKebab = true),
hasString(data, "name", path, context, maxLen = 255),
hasString(data, "uuid", path, context, checkIsUuid = true),
hasInteger(data, "difficulty", path, context, allowed = 0..10),
hasInteger(data, "difficulty", path, context, allowed = 1..10),
hasArrayOfStrings(data, "practices", path, context,
allowedArrayLen = 0..int.high, checkIsKebab = true,
uniqueValues = true),
Expand Down

0 comments on commit 36a07d8

Please sign in to comment.