anthropics / anthropics/skills

Sub-Issue 2: Implement Config Hierarchy (User > Repo)

未关闭
#108 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
176k
派生
20.9k
平均合并
7 小时 21 分钟
30 天内合并 PR
5

描述

**Parent Issue:** #84
**Estimated Time:** ~30 minutes
**Phase:** 2 (Sequential after Phase 1)

## Goal
Implement two-tier config loading where user config (`~/.config/vipunen/config.yaml`) overrides repo defaults (`.workspace/config.yaml`).

## Files
- Modify: `.workspace/scripts/config.py:1-45`
- Test: `.workspace/tests/test_config_hierarchy.py` (new file)

## Dependencies
**Requires:** Sub-Issue 1 (vault_location field) completed
**Phase:** Phase 2 (sequential after Phase 1)

## Implementation Steps

See full implementation steps in issue #84 under "Sub-Issue 2: Implement Config Hierarchy (User > Repo)"

### Summary
1. Write failing tests for config hierarchy (4 tests)
2. Implement `_deep_merge()` helper function
3. Update `load_config()` to support user/repo paths
4. Run tests to verify they pass
5. Test backward compatibility
6. Run type checker
7. Commit changes
8. Verify no regressions
9. Close this sub-issue

## Acceptance Criteria
- [ ] User config overrides repo defaults (deep merge)
- [ ] Missing user config falls back to repo defaults
- [ ] Missing repo config raises error
- [ ] Deep merge works for nested dictionaries
- [ ] Backward compatible (no args still works)
- [ ] All tests pass
- [ ] Type checking passes

## Testing Commands
```bash
uv run pytest .workspace/tests/test_config_hierarchy.py -v
uv run python -c "from workspace.scripts.config import load_config; c = load_config(); print(f'✓ Loaded: {c.paths}')"
uv run pyright .workspace/scripts/config.py
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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