Skip to content

Commit 754d5e0

Browse files
Add more docs to add initial exercises doc (#571)
* Add example implementation document * Add lint exercise docs
1 parent 3e995b5 commit 754d5e0

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

building/tracks/new/add-initial-exercises.md

+48-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Having selected the exercises you want include in your track, the next step is t
109109
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:
110110

111111
```shell
112-
bin/add-exercise <exercise-slug>
112+
bin/add-practice-exercise <exercise-slug>
113113
```
114114

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

152+
#### Add example implementation
153+
154+
To ensure that it is possible to write code that passes the tests, an example implementation needs to be added.
155+
156+
```exercism/note
157+
The code does _not_ have to be idiomatic, it only has to pass the tests.
158+
```
159+
160+
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:
161+
162+
```shell
163+
bin/verify-exercises <exercise-slug>
164+
```
165+
166+
Use the output to verify that the example implementation passes all the tests.
167+
168+
```exercism/note
169+
If you're working on a track repo without this file, feel free to copy them into your repo using the above source link.
170+
```
171+
172+
```exercism/advanced
173+
Under the hood, the `bin/verify-exercises` script does several things:
174+
175+
- Copy the exercise to a temporary directory
176+
- Overwrite the stub file(s) with the example implementation file(s)
177+
- If the test file has skipped tests, they will be "unskipped"
178+
- Run the tests
179+
```
180+
181+
### Lint exercise
182+
183+
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.
184+
185+
First, make sure you have the latest version of [`configlet`](/docs/building/configlet/) by running:
186+
187+
```shell
188+
bin/fetch-configlet
189+
```
190+
191+
The run [the linter](/docs/building/configlet/lint) by running:
192+
193+
```shell
194+
bin/configlet lint
195+
```
196+
197+
Use the output to verify that all is well.
198+
152199
[problem-specifications-exercises]: https://github.com/exercism/problem-specifications/tree/main/exercises/
153200
[allergies]: https://github.com/exercism/problem-specifications/tree/main/exercises/allergies
154201
[alphametics]: https://github.com/exercism/problem-specifications/tree/main/exercises/alphametics

0 commit comments

Comments
 (0)