Skip to content

Commit d8493c0

Browse files
ErikSchierboomiHiD
andauthored
Document files patterns in config.json (#58)
* Document files patterns in config.json * Update anatomy/tracks/config-json.md Co-authored-by: Jeremy Walker <[email protected]> * Update anatomy/tracks/config-json.md Co-authored-by: Jeremy Walker <[email protected]> * Minor tweak * Update anatomy/tracks/config-json.md Co-authored-by: Jeremy Walker <[email protected]> * Another tweak * Tweak Co-authored-by: Jeremy Walker <[email protected]>
1 parent bb9bf00 commit d8493c0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

anatomy/tracks/config-json.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,24 @@ The following top-level properties contain general track metadata:
1919
- `test_runner`: a `boolean` value indicating if a [test runner](../track-tooling/test-runners/README.md) has been implemented (required)
2020
- `representer`: a `boolean` value indicating if a [representer](../track-tooling/representers/README.md) has been implemented (required)
2121
- `analyzer`: a `boolean` value indicating if an [analyzer](../track-tooling/analyzers/README.md) has been implemented (required)
22+
- `files`: The patterns for the locations of the files used in this exercise. (optional)
23+
- `solution`: stub implementation file(s) pattern (optional)
24+
- `test`: test file(s) pattern (optional)
25+
- `example`: example implementation file(s) pattern (optional
26+
- `exemplar`: exemplar implementation file(s) pattern (optional)
27+
28+
### Files
29+
30+
This key is used to specify track-wide file locations. Rather than maintainers having to manually set the `files` key in the _exercises_' `config.json` files, support will be added to [configlet](./README.md) to use these track-wide patterns to automatically populate the exercises' `files` key.
31+
32+
The file patterns defined in the `files` object support the following placeholders:
33+
34+
- `%{kebab_slug}`: the `kebab-case` exercise slug (e.g. `bit-manipulation`)
35+
- `%{snake_slug}`: the `snake_case` exercise slug (e.g. `bit_manipulation`)
36+
- `%{camel_slug}`: the `camelCase` exercise slug (e.g. `bitManipulation`)
37+
- `%{pascal_slug}`: the `PascalCase` exercise slug (e.g. `BitManipulation`)
38+
39+
Support will be added to [configlet](./README.md) to use these pattern to populate the `files` key in an exercise's `.meta/config.json` file.
2240

2341
### Example
2442

@@ -38,6 +56,12 @@ The following top-level properties contain general track metadata:
3856
"test_runner": true,
3957
"representer": false,
4058
"analyzer": false
59+
},
60+
"files": {
61+
"solution": ["%{pascal_slug}.cs"],
62+
"test": ["%{pascal_slug}Tests.cs"],
63+
"example": [".meta/Example.cs"],
64+
"exemplar": [".meta/Exemplar.cs"]
4165
}
4266
}
4367
```

0 commit comments

Comments
 (0)