feat: add validate command for note quality checking#101
Closed
leobrival wants to merge 1 commit intoYakitrak:mainfrom
Closed
feat: add validate command for note quality checking#101leobrival wants to merge 1 commit intoYakitrak:mainfrom
leobrival wants to merge 1 commit intoYakitrak:mainfrom
Conversation
Add a new validate command that checks Obsidian vault notes for common issues including frontmatter syntax, deprecated properties, tag formatting, empty notes, and heading hierarchy. Rules implemented: - frontmatter.parse-error (error): invalid YAML frontmatter - frontmatter.missing (warning): note without frontmatter - frontmatter.deprecated-singular (warning): tag/alias/cssclass - frontmatter.list-type (error): tags/aliases/cssclasses as string - frontmatter.tags-hash (warning): hash prefix in YAML tags - structure.empty-note (warning): empty or whitespace-only note - structure.heading-hierarchy (warning): skipped heading levels Supports text/json/summary output, severity filtering, single note validation, and directory exclusions.
Owner
|
Hey thanks for the PR! It is well-written code, but it feels like it belongs in a dedicated vault-linting tool rather than here. If someone wanted serious vault validation, they'd want more rules, configurable rule sets, ignore files, etc., then scope creep would start pulling the project in a different direction. If this gets requested more then I can revisit but otherwise I don't think its the best fit here. Please feel free to contribute on anything else on the issues list if you want to. |
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
Add a new
validatecommand that checks Obsidian vault notes for common quality issues.Usage
Rules implemented
frontmatter.parse-errorfrontmatter.missingfrontmatter.deprecated-singulartag/alias/cssclassshould betags/aliases/cssclassesfrontmatter.list-typetags/aliases/cssclassesmust be listsfrontmatter.tags-hash#prefix in YAMLstructure.empty-notestructure.heading-hierarchyFlags
--vault-v""--format-ftexttext,json,summary--severity-swarningerror,warning,infoArchitecture
cmd/validate.go— Cobra command (registered viainit())pkg/validate/result.go— Types (ValidationResult, Severity, Summary)pkg/validate/config.go— Default config and directory exclusionspkg/validate/validate.go— Orchestrator (walk vault, collect results)pkg/validate/rules/frontmatter.go— 5 frontmatter rulespkg/validate/rules/structure.go— 2 structure rulesReuses existing patterns:
VaultManagerinterface,frontmatter.Parse(),filepath.WalkDir, mock pattern frommocks/vault.go.Exit code 1 when errors are found (useful for CI).
Checklist
go test ./...)