[Recurring] Keep exercises up to date with problem specifications
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- elixir
- 领域
- documentation, testing, tooling
调研方向
从 ./bin/fetch_configlet 和 ./bin/configlet sync 开始,以确定不同步的练习。阅读 CONTRIBUTING.md 和所有 exercises/practice//.meta/design.md,然后检查受影响的文档、元数据、tests.toml、canonical-data.json 以及 Elixir 测试文件。选定的练习符合问题规范,并且 ./bin/test_exercises.sh 执行通过,即表示完成。
由索引模型根据 Issue 内容生成。
描述
This is a recurring task that has to be done from time to time. Do not reference this issue by writing resolves/fixes #XXX in your PR because that will close it.
We want to keep the track up to date with problem specifications, which means regularly checking if anything changes and needs updating.
How to do this task:
Step 1: fetch configlet
Run:
./bin/fetch_configlet
Step 2: check which exercises need updating and in which way
Run:
./bin/configlet sync
The output will list all Elixir exercises that are out of sync in some way. Example output:
[warn] docs: instructions unsynced: affine-cipher
[warn] docs: instructions unsynced: all-your-base
[warn] metadata: unsynced: acronym
[warn] metadata: unsynced: armstrong-numbers
[warn] collatz-conjecture: missing 2 test cases
- zero is an error (2187673d-77d6-4543-975e-66df6c50e2da)
- negative value is an error (ec11f479-56bc-47fd-a434-bcd7a31a7a2e)
Choose one or more problems and attempt to fix it. Metadata and doc updates can be all done together for many exercises in a single PR, but please create separate PRs per exercise when changing tests.
Step 3.1: Sync all docs
Run this command to update all exercise docs (introductions):
./bin/configlet sync --docs --update
Press y when asked sync the above docs ([y]es/[n]o)?.
Step 3.2: Sync all metadata
Run this command to update all exercise metadata:
./bin/configlet sync --metadata --update
Press y when asked sync the above metadata ([y]es/[n]o)?.
Step 3.3: Update tests for an exercise
The general goal is that all Elixir practice exercises follow problem specifications, except for when it doesn't make any sense in Elixir.
Important:
- Get familiar with the problem specifications repository and the
canonical-data.jsonformat it uses for describing tests cases. - Read
CONTRIBUTING.mdfor the general rules of this repository. - Read
exercises/practice/<exercise>/.meta/design.mdif it exists to learn about design decision that we took in the past for this exercise (e.g. to drop a required function fromresistor-color). Create this file if you're making unexpected decisions yourself! - Please create separate a PR per exercise when changing tests.
Step 3.3.1 Update tests.toml
Update tests.toml by running this command for a chosen exercise:
$ ./bin/configlet sync --exercise <exercise-slug> --tests include --update
This command assumes that we want to implement all the new tests, and that is our default approach, but it still needs verifying on a test-by-test base.
Step 3.3.2 Analyze the new test cases and update the Elixir tests files accordingly
Find all the test cases affected by the previous step in the exercise's canonical-data.json file in the problem specifications repository. Analyze what the changes actually are.
You might need to delete a test. You might need to add a new test. You might also need to replace an existing test with a new one (you'll see in tests.toml that it "reimplements" another).
If you believe a new test case shouldn't be implemented, add include = false to it in tests.toml and document why in exercises/practice/<exercise>/.meta/design.md.
When editing the Elixir tests, make sure to:
- Follow the coding style used in the existing test file.
- Use the test description from the
tests.tomlfile as texts ofdescribeandtestblocks (unless that would invalidate the first rule). - Keep the order of the tests in the Elixir test file the same as they are in the
tests.tomlfile (unless that would invalidate the first rule). - "Translate" problem specification requirements into Elixir idioms. E.g. when problem specifications say "returns an error", you probably want to use a
{:ok, result} | {:error, error}return type (not raise errors!).
Step 3.3.3 Check that the example solution works with new test cases
After modifying the Elixir tests, run this command:
./bin/test_exercises.sh <exercise-slug>
If it fails, double-check if the new tests are correct. If they are, that means our example solution for this exercise is no longer valid for the new tests and needs to be updated!
When adding a completely new function that students need to implement, or when changing the return types of an existing one, make sure to also update the stub file.
Need help?
- Configlet docs
- General track docs
- Don't hesitate to ask here in case you can't find answers to your questions!
- 主要语言
- Elixir
- 星标
- 665
- 派生
- 415
- 平均合并
- 13 小时 3 分钟
- 30 天内合并 PR
- 12
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
exercism/elixir 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
48in24 Approaches for Raindrops可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 5/5 一周以上 新手友好度 25/100
exercism/elixir#1420 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
exercism/elixir#1162 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
exercism/elixir#1133 · 2 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
intellij-elixir/intellij-elixir#4782 ·
维护者通常 1 天内回复
-
level 2 wocs
难度 1/5 1 小时以内 新手友好度 90/100
phravins/QuantumBilling#51 ·
-
fix(ocr): compile the Tesseract-free pipeline with Tokio runtime可能已有人在做 @Goldziher 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
carverauto/serviceradar#6898 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
elixir-ecto/myxql#221 ·