embsim: an unknown --board should list the boards and suggest the closest

Đang mở Phù hợp với người mới
#191 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
cli, embedded-iot

Hướng nghiên cứu

Bắt đầu với lỗi bo mạch không xác định trong tools/embsim/main.c và bảng boards[] cùng board_find() trong tools/embsim/boards.c. Kiểm tra các quy ước kiểm thử hiện có trong tests/golden/embsim*.sh và tests/golden/embsim/, sau đó chạy bài kiểm thử EmbSim tập trung. Công việc hoàn tất khi lỗi chính tả như microbt gợi ý microbit, tên vô nghĩa liệt kê các bo mạch mà không đưa ra gợi ý nào, và mã thoát cùng dòng lỗi đầu tiên vẫn giữ nguyên.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement good first 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 has boards[], the table of every board; line 516 has board_find().
  • Tests: the EmbSim tests live in tests/golden/embsim*.sh and tests/golden/embsim/. Add a small one rather than extending a board's own test.

Steps.

  1. 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 in tools/embsim is fine.
  2. Keep the exit status and the first line as they are; add lines after it.
  3. 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.

Ngôn ngữ chính
C
Star
1
Fork
2
Merge trung bình
20 giờ 55 phút
Pull request đã merge (30 ngày)
73

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của EmbLinkOs/EmbCC

Tất cả issue của EmbLinkOs/EmbCC

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.