Validate command input and handle bad values cleanly
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
Start by reading the command handlers for /shop add, update, delete, sell, and create, plus identifyStore and the tab completer; the issue does not name their files. Run the existing tests that reproduce the first three rows and the sell case, then add coverage for the remaining rows. Done means invalid input leaves state unchanged, duplicate matches use STORE_MULTI_MATCH in commands and completion, and all listed cases are covered.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Several commands accept input they can't handle, or fail with an unhelpful error.
| Input | Result |
|---|---|
/shop add stone NaN NaN -1 1 (also Infinity, and the same through update) |
Accepted. /shop buy on that item then always fails with "Invalid numerical value" |
/shop add stone -3 with shops.update.inf-stock |
Takes 3 from the store's stock, then reports "Invalid number of arguments" |
/shop update location Dup ... when two stores are named Dup |
MultipleStoresMatchedException isn't caught, so "An internal error occurred". The tab completer calls identifyStore unguarded too |
/shop delete abc~ when a store named abc exists |
split("~") leaves no second part, so input[1] throws |
Store names containing ~ |
Created normally, but can't be found by name afterward |
/shop sell notreal all |
Reports "Invalid quantity (0)" instead of an invalid material |
/shop create <name> <player> |
The limit is checked against the sender's stores, not the new owner's |
The first three rows and the sell row were reproduced in tests. The others come from reading the code.
Done when
- Prices must be finite numbers, and negative values are only accepted where they have a meaning.
- A failed command changes nothing.
- Duplicate-name errors show
STORE_MULTI_MATCHeverywhere, including tab completion. - Store names can't contain
~, or the parser handles them. - Tests cover each row.
- Ngôn ngữ chính
- Java
- Star
- 1
- Fork
- 0
- Merge trung bình
- 2 giờ 35 phút
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của BrendonButler/Shops
-
dependencies enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
BrendonButler/Shops#79 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
BrendonButler/Shops#70 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
BrendonButler/Shops#69 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
BrendonButler/Shops#68 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
BrendonButler/Shops#67 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của BrendonButler/Shops
Issue tương tự
-
type: dependency-upgrade
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 61/100
spring-projects/spring-graphql#1556 ·
-
hermes-queue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
chrisalunlloyd2-sudo/mindpalace#373 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug priority: lowest
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
SkriptLang/Skript#8953 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
quality-assurance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#228 ·
Maintainer thường phản hồi trong vòng 1 ngày