embsim: an unknown --board should list the boards and suggest the closest
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- c
- 领域
- cli, embedded-iot
调研方向
从 tools/embsim/main.c 中未知开发板的错误以及 tools/embsim/boards.c 中的 boards[] 表和 board_find() 开始。查看 tests/golden/embsim*.sh 和 tests/golden/embsim/ 中现有的测试惯例,然后运行针对性的 EmbSim 测试。完成标准是:像 microbt 这样的拼写错误会提示 microbit,无意义的名称会列出开发板但不提供建议,并且退出状态和第一行错误信息保持不变。
由索引模型根据 Issue 内容生成。
描述
Context. EmbSim knows many boards (see embsim --help), but a wrong name only says no:
$ ./embsim --board microbt fw.elf
embsim: unknown board 'microbt'
It should list the boards and suggest the closest, for example did you mean 'microbit'?.
Where.
tools/embsim/main.c, line 221: the error. The name is tried as a board (board_find), then as a part from a device pack (board_part).tools/embsim/boards.c: line 217 hasboards[], the table of every board; line 516 hasboard_find().- Tests: the EmbSim tests live in
tests/golden/embsim*.shandtests/golden/embsim/. Add a small one rather than extending a board's own test.
Steps.
- On an unknown name, print the board names from
boards[], and the closest one if it is within a few edits. EmbSim is a separate program, so a small edit-distance function intools/embsimis fine. - Keep the exit status and the first line as they are; add lines after it.
- Add a test with a typo and with a nonsense name.
Done when --board microbt suggests microbit, a nonsense name lists the boards without a suggestion, and the test passes. Do not run tests/golden/boards.sh for this: it talks to real boards on serial ports.
Before you start: the contributor's guide has the rules. A new test counts only after it has failed against the code before your change, and a commit subject reads area: summary. Questions are welcome in the comments or in Discussions.
- 主要语言
- C
- 星标
- 1
- 派生
- 2
- 平均合并
- 20 小时 55 分钟
- 30 天内合并 PR
- 73
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
EmbLinkOs/EmbCC 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 50/100
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area: test kind: bug preview-effort: small priority: low
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
libsdl-org/SDL#16684 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
Issue-Bug Needs-Triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复