From bbd4269144ab51052aaa1a6eb1703603ad32e4bf Mon Sep 17 00:00:00 2001 From: Eric Willigers Date: Fri, 11 Sep 2026 19:27:00 +1000 Subject: [PATCH 1/3] CONTRIBUTING: formatting and linting --- CONTRIBUTING.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e4f604f..33ae3529 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,8 +26,38 @@ 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 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 +[problem-specifications]: https://github.com/exercism/problem-specifications From a94d5027bd35468ba17c4c87ed28292da99f0c31 Mon Sep 17 00:00:00 2001 From: Eric Willigers Date: Fri, 11 Sep 2026 19:52:18 +1000 Subject: [PATCH 2/3] CONTRIBUTING: fetch configlet before using it Address review feedback: bin/configlet does not exist until bin/fetch-configlet has downloaded it, so document that step before the lint/fmt/uuid commands. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_018FofXff2tkMmirA1Cr6aRT --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33ae3529..a4fc9bb3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,6 +36,13 @@ All Zig code — exercise stubs, example solutions and test files — must be fo 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`: + +```bash +bin/fetch-configlet # bin/fetch-configlet.ps1 on Windows +``` + The track configuration must pass configlet's linter, and the JSON files must be formatted with configlet's formatter: ```bash @@ -60,4 +67,5 @@ bin/generate [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 From e585b8cb79be9211c20e05b884e1228cbc48b26b Mon Sep 17 00:00:00 2001 From: Eric Willigers Date: Fri, 11 Sep 2026 20:25:05 +1000 Subject: [PATCH 3/3] tidy --- CONTRIBUTING.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a4fc9bb3..3f7210fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,8 +39,14 @@ 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`: -```bash -bin/fetch-configlet # bin/fetch-configlet.ps1 on Windows +```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: