Discussion: accept `pantry.toml` as the pantry file name (keeping `pantry.conf`)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 1.4k
- フォーク
- 120
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 116
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cooklang/cookcli のほかの issue
-
Editor save status and save errors are in English whatever the site's language対応中かも @LeMyst が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
メンテナーはふだん 1 日以内に返信
-
Shopping list counts a recipe twice when three or more menus reference each other in a ring対応中かも @LeMyst が 3 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
feat(server): tag pages, so a recipe can belong to several collections対応中かも @LeMyst が 4 日前に担当しました。 オープンarea: server feature request
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
wontfix
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
cooklang/cookcli#784 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
cooklang/cookcli の issue をすべて見る
似ている issue
-
comp-view potential bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
ClickHouse/ClickHouse#128410 ·
メンテナーはふだん 1 日以内に返信
-
Save As onto the project's own .snxprj overwrites it with a schematic and the project can no longer open対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea: app data-loss priority: high type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
lan_bot: 13 of 15 tests fail on main (minecraft:dialog entries carry data with the known pack)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンskip-release
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
horizon-rust/horizon#5505 ·
メンテナーはふだん 1 日以内に返信
-
area: cloud S3: minor
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
manaflow-ai/cmux#29709 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:mem good first issue priority:low type:docs
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信