From 36a07d833c42b2c702ba6a94f5d91c82b7498594 Mon Sep 17 00:00:00 2001 From: ee7 <45465154+ee7@users.noreply.github.com> Date: Fri, 22 Oct 2021 13:35:14 +0200 Subject: [PATCH] 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: https://github.com/exercism/docs/pull/290 --- src/lint/track_config.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lint/track_config.nim b/src/lint/track_config.nim index 4ad06bfa..12c66256 100644 --- a/src/lint/track_config.nim +++ b/src/lint/track_config.nim @@ -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),