akiomik / akiomik/nostui

config.yml is not one of the names nostui reads

未关闭
#585 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Rust
星标
71
派生
5
平均合并
4 小时 2 分钟
30 天内合并 PR
31

描述

Split out of [#576](https://github.com/akiomik/nostui/pull/576), which added it on a misreading and took it out again.

## What happens

`Config::new` reads `config.json5`, `config.json`, `config.yaml`, `config.toml` and `config.ini`. A `config.yml` — the spelling most YAML in the wild uses — is not among them, so a directory holding one and nothing else gets `No configuration file found in …`, which is accurate and unhelpful.

The `config` crate does not fill the gap on nostui's behalf, which is worth writing down because it looks as though it might: `FileSourceFile::find_file` does try each extension a format claims, but only after an exact match fails, and it appends `.placeholder` before it starts — so the source built from `config.yaml` probes `config.yaml.yaml` and `config.yaml.yml`, never `config.yml`.

## What it would take

A second name for the YAML format, in the list `Config::new` builds its sources from and in the one the README gives. Two things want deciding with it:

- **Which wins when both exist.** Sources layer, so whichever is added last overrides the other. Silently preferring one is the kind of thing someone loses an afternoon to.
- **What a malformed one costs.** `required(false)` suppresses a missing file, not a parse error, so a half-edited `config.yml` beside a working `config.yaml` would stop nostui starting where it starts today.

## Acceptance

- A directory holding only `config.yml` starts nostui.
- What happens when `config.yaml` and `config.yml` are both present is decided, documented, and asserted.

贡献指南

打开贡献指南

调研方向

Start at Config::new, where the configuration sources are assembled, and compare that list with the README's documented names. Decide and document precedence and malformed-file behavior for config.yaml and config.yml, then add assertions for a directory containing only config.yml and for both names being present.

由索引模型根据 Issue 内容生成。

评估

技术栈
rust
领域
cli
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。