Selaa lähdekoodia

Merge pull request #1415 from FridaTveit/ContributingGuideAddNewSections

Add updating readmes and checking tests sections to contributing guide
Sam Warner 8 vuotta sitten
vanhempi
commit
cf5c72ba3f
No account linked to committer's email
1 muutettua tiedostoa jossa 33 lisäystä ja 1 poistoa
  1. 33
    1
      CONTRIBUTING.md

+ 33
- 1
CONTRIBUTING.md Näytä tiedosto

@@ -9,6 +9,8 @@
9 9
 * [Advanced: Complete Local Setup](#advanced-complete-local-setup)
10 10
   * [Tip: `gradle clean` before `exercism fetch`](#tip-gradle-clean-before-exercism-fetch)
11 11
 * [Adding a New Exercise](#adding-a-new-exercise)
12
+* [Updating the READMEs](#updating-the-readmes)
13
+* [Checking tests are up to date](#checking-tests-are-up-to-date)
12 14
 
13 15
 ## Overview
14 16
 
@@ -166,7 +168,7 @@ The `build.gradle` file can just be copied from any other exercise submodule.
166 168
 The `README.md` file can be generated using [configlet](https://github.com/exercism/configlet/releases).
167 169
 You can do this by:
168 170
 
169
-  1. Download configlet and put it somewhere in your PATH
171
+  1. Download configlet and put it somewhere in your [PATH](https://en.wikipedia.org/wiki/PATH_(variable))
170 172
 
171 173
   2. Clone [the problem-specifications repository](https://github.com/exercism/problem-specifications).
172 174
 
@@ -184,3 +186,33 @@ See other exercises, e.g. [acronym](https://github.com/exercism/java/tree/master
184 186
 
185 187
 Hopefully that should be enough information to help you port an exercise to the Java track.
186 188
 Feel free to open an issue or post in the [Gitter exercism/java room](https://gitter.im/exercism/java) if you have any questions and we'll try and answer as soon as we can.
189
+
190
+## Updating the READMEs
191
+
192
+The `README.md` files are generated from the exercise descriptions in [problem specifications](https://github.com/exercism/problem-specifications/tree/master/exercises).
193
+They need to be regenerated regularly so that any changes to the descriptions in problem specifications propagate to our READMEs.
194
+This can be done using [configlet](https://github.com/exercism/configlet/releases):
195
+
196
+  1. Download configlet and put it somewhere in your [PATH](https://en.wikipedia.org/wiki/PATH_(variable))
197
+
198
+  2. Clone [the problem-specifications repository](https://github.com/exercism/problem-specifications).
199
+
200
+  3. Run `configlet generate . --spec-path path_to_problem_specifications` from the root of this repository.
201
+
202
+## Checking tests are up to date
203
+
204
+The tests for each exercise should follow the canonical data in [problem specifications](https://github.com/exercism/problem-specifications/tree/master/exercises) as closely as possible.
205
+The canonical data can change quite regularly, in which case the [canonical data version](https://github.com/exercism/problem-specifications#test-data-versioning) for that exercise will be updated.
206
+
207
+We keep track of which version of the canonical data each exercise implements in a version file, for example: https://github.com/exercism/java/blob/master/exercises/two-fer/.meta/version.
208
+Not all exercises have canonical data in problem specifications.
209
+For those that don't we don't add a version file.
210
+
211
+We have [a script](https://github.com/exercism/java/blob/master/scripts/canonical_data_check.sh) which can check if these version are up to date with the ones in problem specification.
212
+This script can be used to check if any version files, tests and reference implementations need updating.
213
+
214
+To run this script:
215
+
216
+  1. Clone [the problem-specifications repository](https://github.com/exercism/problem-specifications).
217
+
218
+  2. Run `./scripts/canonical_data_check.sh -t . -s --spec-path path_to_problem_specifications` from the root of this repository.