From 3c6e571d62ddc5a07900e8b35fe75c8da4b2c235 Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Wed, 13 Sep 2023 08:21:16 +0200 Subject: [PATCH 1/2] Symlink problem-specifications for easy reference This is handy when referring to `canonical-data.json` of an exercise, while creating / updating the test template for it. It's all available in the same spot. --- .gitignore | 1 + bin/symlink_problem_specifications.sh | 12 ++++++++++++ docs/CONTRIBUTING.md | 5 +++++ 3 files changed, 18 insertions(+) create mode 100755 bin/symlink_problem_specifications.sh diff --git a/.gitignore b/.gitignore index edcc454ae..5af0f3619 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tmp exercises/*/*/Cargo.lock exercises/*/*/clippy.log .vscode +.prob-spec diff --git a/bin/symlink_problem_specifications.sh b/bin/symlink_problem_specifications.sh new file mode 100755 index 000000000..bf86ebaa9 --- /dev/null +++ b/bin/symlink_problem_specifications.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -eo pipefail + +cd "$(git rev-parse --show-toplevel)" + +for exercise in exercises/practice/*; do + name="$(basename "$exercise")" + if [ -d "problem-specifications/exercises/$name" ]; then + [ -e "$exercise/.prob-spec" ] && rm "$exercise/.prob-spec" + ln -s "../../../problem-specifications/exercises/$name" "$exercise/.prob-spec" + fi +done diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index eef87865c..7d2e57e05 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -101,6 +101,11 @@ Find some tips about writing tera templates [in the next section](#tera-template The full documentation for tera templates is [here][tera-docs]. Following are some approaches that have worked for our specific needs. +You will likely want to look at the exercise's `canonical-data.json` +to see what structure your input data has. +You can use `bin/symlink_problem_specifications.sh` to have this data +symlinked into the actual exercise directory. Handy! + The name of the input property is different for each exercise. The default template will be something like this: From b6a897e3ae4ce23d8f9f98b1f0fabb39b5ae9d2f Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Sat, 16 Sep 2023 19:16:58 +0200 Subject: [PATCH 2/2] doubly-linked-list: Fix inaccurate instructions closes #1376 --- exercises/practice/doubly-linked-list/.docs/instructions.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/exercises/practice/doubly-linked-list/.docs/instructions.md b/exercises/practice/doubly-linked-list/.docs/instructions.md index 4132785db..c8cf7898f 100644 --- a/exercises/practice/doubly-linked-list/.docs/instructions.md +++ b/exercises/practice/doubly-linked-list/.docs/instructions.md @@ -3,11 +3,7 @@ Write a doubly linked list using unsafe Rust, including an iterator over the list and a cursor for efficient mutation. -The doubly linked list is a fundamental data structure in computer science, -often used in the implementation of other data structures. They're -pervasive in functional programming languages, such as Clojure, Erlang, -or Haskell, but far less common in imperative languages such as Ruby or -Python. +The doubly linked list is a fundamental data structure in computer science. Each node in a doubly linked list contains data and pointers to the next and previous node, if they exist.