diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e4f604f..3f7210fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 +``` + +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 +``` + [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