Skip to content

Commit 36a07d8

Browse files
authored
lint(track_config): disallow a difficulty of 0 (#447)
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
1 parent ecc2245 commit 36a07d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lint/track_config.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ proc isValidPracticeExercise(data: JsonNode; context: string;
9292
hasString(data, "slug", path, context, maxLen = 255, checkIsKebab = true),
9393
hasString(data, "name", path, context, maxLen = 255),
9494
hasString(data, "uuid", path, context, checkIsUuid = true),
95-
hasInteger(data, "difficulty", path, context, allowed = 0..10),
95+
hasInteger(data, "difficulty", path, context, allowed = 1..10),
9696
hasArrayOfStrings(data, "practices", path, context,
9797
allowedArrayLen = 0..int.high, checkIsKebab = true,
9898
uniqueValues = true),

0 commit comments

Comments
 (0)