Skip to content

Commit e0f18e3

Browse files
authored
Missing templates (#537)
* add `bin/missing-templates` utility * added a couple of template.txt files for exercises we don't want to template.
1 parent fe737d7 commit e0f18e3

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

bin/missing-templates

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
#
3+
# find exercises without a generator template (or txt file)
4+
# exclude deprecated exercises
5+
# exclude exercises with no canonical data
6+
7+
filter_deprecated() {
8+
grep -vFxf <(
9+
jq -r '.exercises.practice[] | select(.status == "deprecated") | .slug' config.json
10+
)
11+
}
12+
13+
filter_canonical() {
14+
local probspec="${XDG_CACHE_HOME:-$HOME/.cache}/exercism/configlet/problem-specifications"
15+
if [[ -d $probspec ]]; then
16+
grep -vFxf <(
17+
find "$probspec/exercises" -mindepth 1 -type d \
18+
\! -exec test -f '{}/canonical-data.json' \; \
19+
-exec basename '{}' \;
20+
)
21+
else
22+
cat
23+
fi
24+
}
25+
26+
find exercises/practice/ -mindepth 2 -type d -path '*/.meta' \! -exec bash -c '[[ -f "$0"/template.j2 || -f "$0"/template.txt ]]' '{}' \; -print \
27+
| cut -d / -f 3 \
28+
| filter_deprecated \
29+
| filter_canonical \
30+
| sort
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Honestly, why would you template this one?
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Opting not to template this one.
2+
3+
It is possible (see the Python track), but really messy and complicated.
4+
5+
I (@colinleach) just did a partial template for Julia, and it's more trouble than it's worth.

0 commit comments

Comments
 (0)