The no-configuration error names one file, and four others are readable
- 主要语言
- Rust
- 星标
- 71
- 派生
- 5
- 平均合并
- 4 小时 2 分钟
- 30 天内合并 PR
- 31
描述
Split out of [#576](https://github.com/akiomik/nostui/pull/576), which carried this and then removed it.
## What is there now
The error tells a fresh install to write `config.json`, and shows what to put in it. `Config::new` also reads `config.json5`, `config.yaml`, `config.toml` and `config.ini`. The README lists all five; the error names one.
## Why #576 stopped naming the rest
It did name them, and that list was where the change spent itself. Five reviews in a row found something in it:
- the four sat directly under `{"key": "nsec1..."}`, and two of them reject it — `config.toml` with that text is a parse error, `config.ini` answers `missing configuration field "key"`, which reads as having named the key wrong rather than having chosen the wrong file;
- splitting them into "take the same text" and "want their own syntax" left nothing asserting which name landed on which line, so swapping the two lists passed the whole suite;
- the predicate doing the splitting was itself unasserted — claiming TOML reads JSON passed too;
- its documentation described TOML as answering the way only INI does.
Each fix was right. Each one grew the thing that produced the next, and none of it was what #113 asked for.
## What would make it worth carrying
Not the names by themselves. A reader who wants YAML is already served by the README, and the error's job on a fresh install is to get one file written. What a list would have to add is the part the README does not: that the text shown does not travel between them.
That is a message-design question — whether the error is the place to say it, and what it costs in lines a first run has to read — rather than a bug. Worth answering before the code comes back, since the code is what kept being wrong about it.
## Acceptance
- If the error names more than one format, which of them accept the text it shows is asserted, and the assertion fails when the classification is wrong.
- The first run still reads in four lines or so.
贡献指南
调研方向
Start at Config::new and the current no-configuration error, then compare the README’s five formats with the text shown on a fresh install. Decide whether the error should explain which formats accept that text; if it names more than one, assert each classification and keep the first-run message to about four lines.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust
- 领域
- cli
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100