Skip to content

Commit d71633a

Browse files
Add linting section on practice exercise .meta/config.json validation
1 parent 8ee19e7 commit d71633a

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

building/configlet/lint.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ The `config.json` file should have the following checks:
164164
- The `"authors"` values must not have duplicates
165165
- The `"authors"` values are treated case-insensitively
166166
- The `"contributors"` key is optional
167-
- The `"contributors"` value must be a non-empty array
167+
- The `"contributors"` value must be an array
168168
- The `"contributors"` values must be non-empty, non-blank strings
169169
- The `"contributors"` values must not have duplicates
170170
- The `"contributors"` values are treated case-insensitively
@@ -209,6 +209,34 @@ The `config.json` file should have the following checks:
209209
- The Markdown must conform to the [Markdown standards](../../../contributing/standards/markdown.md)
210210
- Links must be absolute (relative links are not allowed)
211211

212+
### Rule: exercises/practice/<slug>/.meta/config.json is valid
213+
214+
- The file must be valid JSON
215+
- The JSON root must be an object
216+
- The `"authors"` key is optional
217+
- The `"authors"` value must be an array
218+
- The `"authors"` values must be non-empty, non-blank strings
219+
- The `"authors"` values must not have duplicates
220+
- The `"authors"` values are treated case-insensitively
221+
- The `"contributors"` key is optional
222+
- The `"contributors"` value must be an array
223+
- The `"contributors"` values must be non-empty, non-blank strings
224+
- The `"contributors"` values must not have duplicates
225+
- The `"contributors"` values are treated case-insensitively
226+
- Users can only be listed in either the `"authors"` or `"contributors"` array (no overlap)
227+
- The `"files.solution"` key is required
228+
- The `"files.solution"` value must be a non-empty array
229+
- The `"files.test"` key is required
230+
- The `"files.test"` value must be a non-empty array
231+
- The `"files.example"` key is required
232+
- The `"files.example"` value must be a non-empty array
233+
- The files listed in the `"files.solution"` must exist
234+
- The files listed in the `"files.test"` must exist
235+
- The files listed in the `"files.example"` must exist
236+
- Files can only be listed in either the `"files.solution"`, `"files.test"` or `"files.example` array (no overlap)
237+
- The `"language_versions"` key is optional
238+
- The `"language_versions"` value must be a string
239+
212240
### Rule: exercises/shared/.docs/cli.md is valid
213241

214242
- The Markdown must conform to the [Markdown standards](../../../contributing/standards/markdown.md)

0 commit comments

Comments
 (0)