Skip to content

Document key for exercise files #407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions building/configlet/lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ The `config.json` file should have the following checks:
- The `"forked_from"` values must not have duplicates
- The `"language_versions"` key is optional
- The `"language_versions"` value must be a string
- The `"representer.version"` key is optional
- The `"representer.version"` value must be an integer >= 1
- The `"icon"` key is optional
- The `"icon"` value must be a kebab-case string²

Expand Down Expand Up @@ -321,6 +323,8 @@ The `config.json` file should have the following checks:
- The `"language_versions"` value must be a string
- The `"test_runner"` key is optional
- The `"test_runner"` value must be a boolean
- The `"representer.version"` key is optional
- The `"representer.version"` value must be an integer >= 1

### Rule: exercises/shared/.docs/debug.md is valid

Expand Down
5 changes: 5 additions & 0 deletions building/tracks/concept-exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ This file contains meta information on the exercise:
- `blurb`: A short description of this exercise. Its length must be <= 350. Markdown is _not_ supported (required)
- `source`: The source this exercise is based on (optional)
- `source_url`: The URL of the source this exercise is based on (optional)
- `representer`: Meta information related to how the representer processes this file (optional)
- `version`: An integer for the version of the representer to use for the exercise (required if parent key is present)
Copy link
Member Author

@ErikSchierboom ErikSchierboom Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe:

An integer which can be incremented to invalidate representations (required if parent key is present - defaults to 1 downstream if missing, so set to 2 to initially invalidate).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Ah, here was the famous reply-via-overwriting-edit).

Parsing an omitted version property the same as an explicit "version": 1 sounds OK to me.

Note that configlet lint leaned towards not erroring for an empty optional key, though. So maybe "representer": {} shouldn't be an error. But perhaps removed with configlet fmt.

- `icon`: The slug of the icon (see [the full list of icons][exercise-icons]). If not specified, the exercise's slug will be used (optional)

If someone is both an author _and_ a contributor, only list that person as an author.
Expand Down Expand Up @@ -349,6 +351,9 @@ Assume that the user `FSharpForever` has written an exercise called `log-levels`
"blurb": "Learn how to work with strings by processing log lines.",
"source": "Wikipedia",
"source_url": "https://en.wikipedia.org/wiki/Log_file",
"representer": {
"version": 2
},
"icon": "logs"
}
```
Expand Down
2 changes: 2 additions & 0 deletions building/tracks/practice-exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ This file contains meta information on the exercise:
- `source`: The source this exercise is based on (optional)
- `source_url`: The URL of the source this exercise is based on (optional)
- `test_runner`: Indicates if solutions of this exercise should be tested in the test runner. Defaults to `true` if not specified. (optional)
- `representer`: Meta information related to how the representer processes this file (optional)
- `version`: An integer for the version of the representer to use for the exercise (required if parent key is present)
- `icon`: The slug of the icon (see [the full list of icons][exercise-icons]). If not specified, the exercise's slug will be used (optional)

If someone is both an author _and_ a contributor, only list that person as an author.
Expand Down