feat: add hive config validate command#7
Merged
Merged
Conversation
Add comprehensive configuration validation that checks: - File access (config file, git path, data directory) - Template syntax for spawn commands and keybinding shell commands - Regex patterns for hooks (with glob pattern detection) - Keybinding configuration (action/sh exclusivity, valid actions) Supports text and JSON output formats. Exits with code 1 on errors. Closes #3
- Use io.Discard instead of custom nopWriter - Add JSON tags to validation structs for consistent output - Sort keybinding keys for deterministic validation order - Remove glob pattern detection (just validate regex) - Fix comment to reflect regex usage instead of glob
- Replace custom ValidationResult with criterio.FieldErrors - Add Warnings() method for non-fatal issues - Improve CLI output with grouped errors/warnings - Add FatalError support for criterio.FieldErrors in printer - Add validate:invalid task for testing error output
- ValidateDeep now calls Validate first for basic structural checks - Add recycle command template validation (was missing) - Simplify validateKeybindingTemplates to only check templates - Add RecycleTemplateData type with field documentation - Add field documentation to SpawnTemplateData and KeybindingTemplateData - Add nil check for Config in validate command - Rename context variable to errContext to avoid shadowing - Add validConfig test helper and recycle template tests
- Merge validateSpawnCommands and validateRecycleCommands into generic validateTemplates helper - Extract extractFieldErrors helper to unify error extraction in outputJSON and outputText
Add extensible health check system with styled output. Config validation is now the first check under `hive doctor`.
4d41b38 to
242be3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hive config validatecommand to test configuration files before execution--format jsonfor tooling integrationValidation Checks
Example Output
Test plan
Closes #3