From 4da826f45660967303594d9f46d23ad27e49c7c6 Mon Sep 17 00:00:00 2001 From: BlonyFR Date: Thu, 30 Oct 2025 19:15:22 +0100 Subject: [PATCH 1/7] Update 'Exercise Anatomy' in CONTRIBUTING.md --- docs/CONTRIBUTING.md | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index cf189fe9..3e1be66b 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -77,7 +77,7 @@ clang-format -i $(file) ## Exercise anatomy -Each exercise should be contained in a directory `c/exercises/{exercise-name}`. +Each exercise should be contained in a directory `c/exercises/pactice/{exercise-name}`. See [implement-an-exercise-from-specification][] for in depth details on implementing an exercise that matches the specification The structure of en exercise directory is as follows (note the differing hyphen and underscore usage for directory names and file names respectively): @@ -97,20 +97,32 @@ The structure of en exercise directory is as follows (note the differing hyphen +-- unity_internals.h ``` -* `test` - contains the test file `test_{exercise_name}.c` and a `vendor` directory containing the test harness [Unity][] from [ThrowTheSwitch][]. +```text ++-- {exercise-name} + +-- makefile + +-- srcs + | +-- {exercise-name}.c + | +-- {exercise-name}.h + +-- test + | +-- test_{exercise-name}.c + +-- test-framework + +-- unity.c + +-- unity.h + +-- unity_internals.h +``` + +* `test` - contains the test file `test_{exercise_name}.c` and a `test-framework` directory containing the test harness [Unity][] from [ThrowTheSwitch][]. ThrowTheSwitch has a decent guide on [getting started with Unity][] should you desire a tutorial. The version of Unity used is indicated in [versions][]. The layout of the test file is described in the [style guide][test-file-layout]. Tests should be written that satisfy `canonical-data.json` file for the exercise in the [problem-specifications][] repository -* `src` - contains the example files `example.c` and `example.h`. - These are both skipped by the `exercism` CLI when downloading to the client, so it is imperative that you do not reference the names of the files in your code. - If you need to provide a header file example that is necessary to run your tests it should be named `{my_exercise}.h` instead. - Please also use [include guards][] in your header files. - The exercise tests can be run using `make` from the repository root. - The top-level makefile will rename the `example.{c|h}` files accordingly (use `make help` to learn about individual targets). -* `makefile` - is the makefile for the exercise as it would build using proper filenames (i.e. `{exercise_name}.c` and `{exercise_name}.h` instead of `example.c` and `example.h` respectively). - Makefiles are expected to change very little between exercises so it should be easy to copy one from another exercise. -* `README.md` - is the readme that relates to the exercise. - These can be generated by the [configlet][] tool from `description.md` for the exercise in the [problem-specifications][] repository, or alternatively a custom one can be written. +* `src` - contains the source files `{exercise-name}.c` and `[exercise-name].h`. + Please use [include guards][] in your header files. + The exercise tests can be run using `make test` from the repository root. +* `makefile` - is the makefile for the exercise as it would build. +Two rules are required, +test: compile test_{exercise-name}.c and run it. +memcheck: compile test_{exercise-name} with -fsanitize=addres, -fno-common, -fno-omit-frame-pointer flag and run it +Makefiles are expected to change very little between exercises so it should be easy to copy one from another exercise. **Don't forget** to add the exercise to the track's `config.json`. For this you will need to determine the best place to add the exercise within the order of all other track exercises. You will also need to generate a UUID to add here. For both of these tasks you can use the [configlet][] tool; the tool will even lint and format the `config.json` for you after you've made these changes! From 6e6a49bafbf6bea66797b6f748667c4e656c71f1 Mon Sep 17 00:00:00 2001 From: BlonyFR Date: Thu, 30 Oct 2025 19:19:35 +0100 Subject: [PATCH 2/7] Update 'Exercise Anatomy' in CONTRIBUTING.md --- docs/CONTRIBUTING.md | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 3e1be66b..21effea2 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -82,21 +82,6 @@ See [implement-an-exercise-from-specification][] for in depth details on impleme The structure of en exercise directory is as follows (note the differing hyphen and underscore usage for directory names and file names respectively): -```text -+-- {exercise-name} - +-- makefile - +-- README.md - +-- src - | +-- example.c - | +-- example.h | {exercise_name}.h - +-- test - +-- test_{exercise_name}.c - +-- vendor - +-- unity.c - +-- unity.h - +-- unity_internals.h -``` - ```text +-- {exercise-name} +-- makefile @@ -115,11 +100,11 @@ The structure of en exercise directory is as follows (note the differing hyphen ThrowTheSwitch has a decent guide on [getting started with Unity][] should you desire a tutorial. The version of Unity used is indicated in [versions][]. The layout of the test file is described in the [style guide][test-file-layout]. Tests should be written that satisfy `canonical-data.json` file for the exercise in the [problem-specifications][] repository -* `src` - contains the source files `{exercise-name}.c` and `[exercise-name].h`. +* `srcs` - contains the source files `{exercise-name}.c` and `[exercise-name].h`. Please use [include guards][] in your header files. The exercise tests can be run using `make test` from the repository root. * `makefile` - is the makefile for the exercise as it would build. -Two rules are required, +Two rules are required, test: compile test_{exercise-name}.c and run it. memcheck: compile test_{exercise-name} with -fsanitize=addres, -fno-common, -fno-omit-frame-pointer flag and run it Makefiles are expected to change very little between exercises so it should be easy to copy one from another exercise. From c81d0a1bc238011586891770770d7264d15bdd21 Mon Sep 17 00:00:00 2001 From: Blony Date: Thu, 30 Oct 2025 19:21:32 +0100 Subject: [PATCH 3/7] Update 'Exercise Anatomy' in CONTRIBUTING.md --- docs/CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 21effea2..f02ee08c 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -90,10 +90,10 @@ The structure of en exercise directory is as follows (note the differing hyphen | +-- {exercise-name}.h +-- test | +-- test_{exercise-name}.c - +-- test-framework - +-- unity.c - +-- unity.h - +-- unity_internals.h + | +-- test-framework + | +-- unity.c + | +-- unity.h + | +-- unity_internals.h ``` * `test` - contains the test file `test_{exercise_name}.c` and a `test-framework` directory containing the test harness [Unity][] from [ThrowTheSwitch][]. From 6e3f6e9972fd8e78419b55cc90b7c5da175f44e3 Mon Sep 17 00:00:00 2001 From: Blony Date: Thu, 30 Oct 2025 19:29:31 +0100 Subject: [PATCH 4/7] Update CONTRIBUTING.md Typing Error --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index f02ee08c..2b6d471b 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -77,7 +77,7 @@ clang-format -i $(file) ## Exercise anatomy -Each exercise should be contained in a directory `c/exercises/pactice/{exercise-name}`. +Each exercise should be contained in a directory `c/exercises/practice/{exercise-name}`. See [implement-an-exercise-from-specification][] for in depth details on implementing an exercise that matches the specification The structure of en exercise directory is as follows (note the differing hyphen and underscore usage for directory names and file names respectively): From f47f7f07bf90c4fb258852798af412a2ff42c71b Mon Sep 17 00:00:00 2001 From: Blony Date: Fri, 31 Oct 2025 01:07:30 +0100 Subject: [PATCH 5/7] Update docs/CONTRIBUTING.md Review Co-authored-by: Ryan Hartlage <2488333+ryanplusplus@users.noreply.github.com> --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 2b6d471b..0b908b1c 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -80,7 +80,7 @@ clang-format -i $(file) Each exercise should be contained in a directory `c/exercises/practice/{exercise-name}`. See [implement-an-exercise-from-specification][] for in depth details on implementing an exercise that matches the specification -The structure of en exercise directory is as follows (note the differing hyphen and underscore usage for directory names and file names respectively): +The structure of an exercise directory is as follows (note the differing hyphen and underscore usage for directory names and file names respectively): ```text +-- {exercise-name} From a7b93578ef38ac4795fff2a0e63417093d9fa456 Mon Sep 17 00:00:00 2001 From: Blony Date: Thu, 13 Nov 2025 17:23:13 +0100 Subject: [PATCH 6/7] after review --- docs/CONTRIBUTING.md | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 0b908b1c..49cbbf22 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -85,25 +85,24 @@ The structure of an exercise directory is as follows (note the differing hyphen ```text +-- {exercise-name} +-- makefile - +-- srcs - | +-- {exercise-name}.c - | +-- {exercise-name}.h - +-- test - | +-- test_{exercise-name}.c - | +-- test-framework - | +-- unity.c - | +-- unity.h - | +-- unity_internals.h + +-- {exercise-name}.c + +-- {exercise-name}.h + +-- test_{exercise-name}.c + +-- test-framework + | +-- unity.c + | +-- unity.h + | +-- unity_internals.h ``` -* `test` - contains the test file `test_{exercise_name}.c` and a `test-framework` directory containing the test harness [Unity][] from [ThrowTheSwitch][]. - ThrowTheSwitch has a decent guide on [getting started with Unity][] should you desire a tutorial. - The version of Unity used is indicated in [versions][]. The layout of the test file is described in the [style guide][test-file-layout]. - Tests should be written that satisfy `canonical-data.json` file for the exercise in the [problem-specifications][] repository -* `srcs` - contains the source files `{exercise-name}.c` and `[exercise-name].h`. +`test_{exercise_name}.c` - This file contains all the tests for the exercise. +`test-framework` - directory containing the test harness [Unity][] from [ThrowTheSwitch][]. + ThrowTheSwitch has a decent guide on [getting started with Unity][] should you desire a tutorial. + The version of Unity used is indicated in [versions][]. The layout of the test file is described in the [style guide][test-file-layout]. + Tests should be written to satisfy `canonical-data.json` file for the exercise in the [problem-specifications][] repository +`{exercise-name}.c` / `{exercise-name}.h` - The exercise's source files. Please use [include guards][] in your header files. The exercise tests can be run using `make test` from the repository root. -* `makefile` - is the makefile for the exercise as it would build. +* `makefile` - is the makefile for the exercise as it would build. Two rules are required, test: compile test_{exercise-name}.c and run it. memcheck: compile test_{exercise-name} with -fsanitize=addres, -fno-common, -fno-omit-frame-pointer flag and run it From 6878b3576f8c8b58edcff805aed789be15427913 Mon Sep 17 00:00:00 2001 From: Ryan Hartlage <2488333+ryanplusplus@users.noreply.github.com> Date: Thu, 13 Nov 2025 11:38:14 -0500 Subject: [PATCH 7/7] Update docs/CONTRIBUTING.md --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 49cbbf22..7a4f1d91 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -105,7 +105,7 @@ The structure of an exercise directory is as follows (note the differing hyphen * `makefile` - is the makefile for the exercise as it would build. Two rules are required, test: compile test_{exercise-name}.c and run it. -memcheck: compile test_{exercise-name} with -fsanitize=addres, -fno-common, -fno-omit-frame-pointer flag and run it +memcheck: compile test_{exercise-name} with -fsanitize=address, -fno-common, -fno-omit-frame-pointer flag and run it Makefiles are expected to change very little between exercises so it should be easy to copy one from another exercise. **Don't forget** to add the exercise to the track's `config.json`. For this you will need to determine the best place to add the exercise within the order of all other track exercises. You will also need to generate a UUID to add here. For both of these tasks you can use the [configlet][] tool; the tool will even lint and format the `config.json` for you after you've made these changes!