Skip to content
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
44 changes: 44 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,52 @@ Exercises can be tested against the test runner using
bin/verify-exercises-in-docker
```

## Formatting and linting

CI runs the following checks on every pull request, so please run them locally before submitting.

All Zig code — exercise stubs, example solutions and test files — must be formatted with `zig fmt`:

```bash
zig fmt --check .
```

The remaining checks use [configlet], Exercism's track maintenance tool.
Fetch it once before running any `bin/configlet` command — this downloads the binary to `bin/configlet`:

```sh
bin/fetch-configlet
```

Or for Windows:

```sh
bin/fetch-configlet.ps1
```

The track configuration must pass configlet's linter, and the JSON files must be formatted with configlet's formatter:

```bash
bin/configlet lint
bin/configlet fmt --update
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Before these can be ran, configlet should be fetched. Otherwise these commands will both fail, as will the one for the uuid functionality.


When adding an exercise or an approach, generate any new UUIDs with configlet:

```bash
bin/configlet uuid
```

Practice-exercise test files are generated from the canonical data in [`problem-specifications`][problem-specifications]; edit the generator in `generators/exercises/` and regenerate:

```bash
bin/generate <slug>
```

[guidelines]: https://exercism.org/blog/contribution-guidelines-nov-2023
[zig-forum]: https://forum.exercism.org/c/programming/zig/199
[building-tracks]: https://exercism.org/docs/building/tracks
[style]: https://exercism.org/docs/building/markdown/style-guide
[unnecessary-test-runs]: https://exercism.org/docs/building/tracks#h-avoiding-triggering-unnecessary-test-runs
[configlet]: https://github.com/exercism/configlet
[problem-specifications]: https://github.com/exercism/problem-specifications
Loading