Skip to content

Commit 09d5108

Browse files
lint: add annotation for tags in config.json
If a track's `config.json` file does not have valid tags, the error message will now also show an annotation which explains to the user what exactly is wrong and how to fix it.
1 parent cf70d5f commit 09d5108

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/lint/track_config.nim

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,14 @@ const tags = [
228228
].toHashSet()
229229

230230
proc hasValidTags(data: JsonNode; path: Path): bool =
231+
const errorAnnotation = """
232+
Tracks are annotated with tags to allow searching for tracks with certain tags.
233+
Tags must be chosen from our list of supported tags.
234+
Tags should be selected based on the general usage of their language.
235+
For more information on tags and the list of supported tags see:
236+
https://exercism.org/docs/building/tracks/config-json#h-tags""".unindent()
231237
result = hasArrayOfStrings(data, "tags", path, allowed = tags,
232-
uniqueValues = true)
238+
uniqueValues = true, errorAnnotation = errorAnnotation)
233239

234240
proc satisfiesFirstPass(data: JsonNode; path: Path): bool =
235241
## Returns `true` if `data` passes the first round of checks for a track-level

0 commit comments

Comments
 (0)