Skip to content
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

Add more docs to add initial exercises doc #571

Merged
merged 2 commits into from
Dec 4, 2024
Merged
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
49 changes: 48 additions & 1 deletion building/tracks/new/add-initial-exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Having selected the exercises you want include in your track, the next step is t
You can quickly scaffold a new Practice Exercise by running the `bin/add-practice-exercise` script ([source](https://github.com/exercism/generic-track/blob/main/bin/add-practice-exercise)) from the track's root directory:

```shell
bin/add-exercise <exercise-slug>
bin/add-practice-exercise <exercise-slug>
```

Optionally, you can also specify the exercise's difficulty (via `-d`) and/or author's GitHub username (via `-a`):
Expand Down Expand Up @@ -149,6 +149,53 @@ Keep in mind, though, that you should tweak the implementation to best fit your
As an example, some tracks do not use classes but only work with functions.
If your track usually works with objects though, you should adapt the implementation to what best fits your track.

#### Add example implementation

To ensure that it is possible to write code that passes the tests, an example implementation needs to be added.

```exercism/note
The code does _not_ have to be idiomatic, it only has to pass the tests.
```

You can verify the example implementation passes all the tests by running the `bin/verify-exercises` script ([source](https://github.com/exercism/generic-track/blob/main/bin/verify-exercises)) from the track's root directory:

```shell
bin/verify-exercises <exercise-slug>
```

Use the output to verify that the example implementation passes all the tests.

```exercism/note
If you're working on a track repo without this file, feel free to copy them into your repo using the above source link.
```

```exercism/advanced
Under the hood, the `bin/verify-exercises` script does several things:

- Copy the exercise to a temporary directory
- Overwrite the stub file(s) with the example implementation file(s)
- If the test file has skipped tests, they will be "unskipped"
- Run the tests
```

### Lint exercise

The final step is to run [the linter](/docs/building/configlet/lint) to check if the track's (configuration) files are properly structured - both syntactically and semantically.

First, make sure you have the latest version of [`configlet`](/docs/building/configlet/) by running:

```shell
bin/fetch-configlet
```

The run [the linter](/docs/building/configlet/lint) by running:

```shell
bin/configlet lint
```

Use the output to verify that all is well.

[problem-specifications-exercises]: https://github.com/exercism/problem-specifications/tree/main/exercises/
[allergies]: https://github.com/exercism/problem-specifications/tree/main/exercises/allergies
[alphametics]: https://github.com/exercism/problem-specifications/tree/main/exercises/alphametics
Expand Down