feat(config): add validation.on-create and validation.on-sync config options (bd-t7jq)
Add .beads/config.yaml support for template validation settings: - validation.on-create: warn|error|none (default: none) - validation.on-sync: warn|error|none (default: none) When set to "warn", issues missing required sections (based on type) show warnings but operations proceed. When set to "error", operations fail. Implementation: - Add validation keys to YamlOnlyKeys in yaml_config.go - Add defaults in config.go - Wire up bd create to check validation.on-create config - Wire up bd sync to run validation before export - Add tests for config loading - Update CONFIG.md documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,11 @@ var YamlOnlyKeys = map[string]bool{
|
||||
|
||||
// Create command settings
|
||||
"create.require-description": true,
|
||||
|
||||
// Validation settings (bd-t7jq)
|
||||
// Values: "warn" | "error" | "none"
|
||||
"validation.on-create": true,
|
||||
"validation.on-sync": true,
|
||||
}
|
||||
|
||||
// IsYamlOnlyKey returns true if the given key should be stored in config.yaml
|
||||
@@ -65,7 +70,7 @@ func IsYamlOnlyKey(key string) bool {
|
||||
}
|
||||
|
||||
// Check prefix matches for nested keys
|
||||
prefixes := []string{"routing.", "sync.", "git.", "directory.", "repos.", "external_projects."}
|
||||
prefixes := []string{"routing.", "sync.", "git.", "directory.", "repos.", "external_projects.", "validation."}
|
||||
for _, prefix := range prefixes {
|
||||
if strings.HasPrefix(key, prefix) {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user