Skip to content
Open
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
3 changes: 3 additions & 0 deletions building/configlet/sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Therefore configlet has a `sync` command, which can check that such Practice Exe
There are three kinds of data that can be updated from `problem-specifications`: documentation, metadata, and tests.
There is also one kind of data that can be populated from the track-level `config.json` file: filepaths in exercise config files.

By default, configlet finds the upstream exercise in `problem-specifications` by the Practice Exercise's `slug`.
If the track uses a different slug (for example, to avoid a name collision in the track's language), set the optional [`problem_specifications_slug`](/docs/building/tracks/config-json#practice-exercises) key on that Practice Exercise in the track-level `config.json` file.

We describe the checking and updating of these data kinds in individual sections below, but as a quick summary:

- `configlet sync` only operates on exercises that exist in the track-level `config.json` file.
Expand Down
27 changes: 27 additions & 0 deletions building/tracks/config-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ Each practice exercise is an entry in the `exercises.practice` array. The follow
- `uuid`: a V4 UUID that uniquely identifies the exercise. The UUID must be unique both within the track as well as across all tracks, and must never change
- `slug`: the exercise's slug, which is a lowercased, kebab-case string. The slug must be unique across all concept _and_ practice exercise slugs within the track. Its length must be <= 255.
- `name`: the exercise's name. Its length must be <= 255.
- `problem_specifications_slug` (optional): the slug of the exercise in the [Problem Specifications repo](https://github.com/exercism/problem-specifications) that this exercise implements, when it differs from `slug`. [configlet sync](/docs/building/configlet/sync) uses this value instead of `slug` to find the upstream exercise. Like `slug`, it must be a lowercased, kebab-case string, and its length must be <= 255.
- `practices`: an array of concept slugs that the exercise is helping students practice
- `prerequisites`: an array of concept slugs that must be unlocked before a student can start the exercise
- `difficulty`: a number indicating the difficulty of the exercise. The number must be in the range of 1 (easiest) to 10 (hardest). The website interprets the difficulty as follows:
Expand Down Expand Up @@ -244,6 +245,32 @@ The "Recommended Order" of the Practice Exercises on the website corresponds wit
```
<!-- prettier-ignore-end -->

#### Example of a slug that differs from Problem Specifications

A track might need a different slug from the upstream exercise, for example to avoid a name collision in the track's language.
Here, the track's `binary-chop` exercise implements the `binary-search` exercise from Problem Specifications:

<!-- prettier-ignore-start -->
```json
{
"exercises": {
"practice": [
{
"slug": "binary-chop",
"name": "Binary Search",
"problem_specifications_slug": "binary-search",
"uuid": "12ea7b04-8f6b-480a-a856-a8405dc59c2a",
"practices": [],
"prerequisites": [],
"difficulty": 3
},
...
]
}
}
```
<!-- prettier-ignore-end -->

### Foregone exercises

If a track knows that it doesn't want to implement an exercise defined in the [Problem Specifications repo](https://github.com/exercism/problem-specifications), the slug of that exercise can be added to the `exercises.foregone` key. [configlet](/docs/building/configlet) will ignore foregone exercises when outputting the track's unimplemented exercises.
Expand Down
Loading