Discussion: accept `pantry.toml` as the pantry file name (keeping `pantry.conf`)
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start with crates/core/src/context.rs and the pantry edit path at crates/core/src/pantry/mod.rs:1142; inspect how Context::discover and Context::search find pantry files. The proposal is still under discussion, with compatibility questions about other apps and older CookCLI versions unresolved, so first determine whether the change is agreed before attempting implementation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This is a proposal for discussion, not a decided change. Comments are welcome, especially from anyone who maintains another app that reads the pantry file.
Background
A recipe folder can hold two hand-written config files side by side, in two different formats:
| File | Format | Comments |
|---|---|---|
config/aisle.conf |
Cooklang's own format ([aisle], then name | synonym) |
// |
config/pantry.conf |
TOML | # |
Both end in .conf, so nothing tells you which one is which. #687 (reported on Discord) is the result: someone wrote # comments in aisle.conf, the way pantry.conf beside it takes them, and they became ingredients. #688 now warns about those lines, but the cause is still there. The same confusion works in reverse: // note or -- note in pantry.conf is a TOML error, and the web shopping list then ignores the whole pantry.
The spec's conventions.md says the pantry file is TOML, but it doesn't name the file. pantry.conf is a CookCLI convention.
Proposal
Accept pantry.toml as the pantry file's name, and keep reading pantry.conf:
- Look for
pantry.tomlfirst, thenpantry.conf, in./config/and in the global config dir (COOK_CONFIG_DIR,~/.config/cook/, …). All lookups go throughContext::discover/Context::searchincrates/core/src/context.rs, so this is mostly one place. - If both exist, use
pantry.toml.cook doctor pantryand the/pantrypage say thatpantry.confis being ignored. - Edits (the CLI and the
/pantrypage) go back to the file that was read, whatever its name. - When there is no pantry yet, the first edit creates
config/pantry.tomlinstead ofconfig/pantry.conf(crates/core/src/pantry/mod.rs:1142). The exception is if another app turns out to look forpantry.confby name (question 1): then new pantries staypantry.confuntil those apps read both names. Otherwise, new users would still get the two.conffiles side by side. - Docs, README and help texts say "
pantry.toml(orpantry.conf)".
aisle.conf keeps its name and its format. With pantry.toml next to it, the different extensions show that the two files have different formats.
Questions
- Does anything else look for
config/pantry.confby name? For example the Cook mobile apps, cook.md, or the sync service. If one does and a user renames the file, that app loses the pantry without saying why. This is the main question; if the answer is yes, those apps need to readpantry.tomltoo before CookCLI creates it. - Is it worth it? About 60 files on main mention
pantry.conf(tests, docs, the 9 locales, core, server). The alternative is to keep the name and rely on documentation plus the #688-style warnings. - Should the spec name the files?
conventions.mdcould say "pantry.toml(formerlypantry.conf)", so that every app agrees. - When should new pantries become
pantry.toml? Right away, or after one release that reads both names, so that an oldercookon the same folder still finds the pantry?
Not part of this proposal: changing the aisle.conf format. That needs the spec and cooklang-rs, and was option 3 in #687.
- Ngôn ngữ chính
- Rust
- Star
- 1.4k
- Fork
- 120
- Merge trung bình
- 1 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 116
Chuẩn bị môi trường
- Có Dockerfile hoặc 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 cooklang/cookcli
-
Editor save status and save errors are in English whatever the site's languageCó thể đã có người làm @LeMyst đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Shopping list counts a recipe twice when three or more menus reference each other in a ringCó thể đã có người làm @LeMyst đã nhận 3 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feat(server): tag pages, so a recipe can belong to several collectionsCó thể đã có người làm @LeMyst đã nhận 4 ngày trước. Đang mởarea: server feature request
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
wontfix
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
cooklang/cookcli#784 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cooklang/cookcli
Issue tương tự
-
area:docs documentation good first issue priority:low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
rtk-ai/rtk#4900 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement performance rust
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
comp-view potential bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
ClickHouse/ClickHouse#128410 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Save As onto the project's own .snxprj overwrites it with a schematic and the project can no longer openCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea: app data-loss priority: high type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
lan_bot: 13 of 15 tests fail on main (minecraft:dialog entries carry data with the known pack)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởskip-release
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
horizon-rust/horizon#5505 ·
Maintainer thường phản hồi trong vòng 1 ngày