fix: reject unknown YAML config keys - #22
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 1 remains after this review. 📝 SummarySummary by CodeRabbit
WalkthroughChanges
Configuration loading
Merge Risk: ⚪ Minimal · up to Configuration loading now rejects unknown fields and trailing YAML documents while preserving defaults for empty or partial configuration. The covered behavior is ready to merge. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Team
Run ID: 9e0bc350-c0a6-44cb-9fa0-d334c3769755
📒 Files selected for processing (2)
internal/config/config.gointernal/config/config_test.go
Included review availability: Your plan provides up to 8 included reviews per hour; 2 remain after this review.
Fixes Applied Successfully\n\nApplied the approved CodeRabbit finding.\n\nChanges:\n- trailing YAML documents are now rejected\n- malformed trailing documents include the config path in the error\n- empty YAML files continue to load defaults\n\nCommit: ad91729\n\nValidation passed: 167 tests, race tests, go vet, format checks, and diff checks. |
Summary\n\n- decode configuration with strict YAML known-field validation\n- report the unknown key together with the config path\n- preserve defaults for partial and empty configuration files\n- add regression coverage for unknown keys and empty YAML\n\nCloses #15\n\n## Validation\n\n- 165 Go tests passed\n- race tests passed\n- go vet passed\n- gofmt and diff checks passed