Skip to content

Add a "watch" mode for continuous validation #458

@kehoecj

Description

@kehoecj

Description

Add a --watch flag that monitors the search path for file changes and re-validates automatically. This is useful during local development when editing config files.

Proposed behavior

# Watch current directory, re-validate on changes
validator --watch .

# Combine with other flags
validator --watch --gitignore --file-types=json,yaml .
  • On startup, run a full validation pass
  • Watch for file create/modify/rename events in the search path
  • On change, re-validate only the changed file(s)
  • Respect all existing filters (--exclude-dirs, --gitignore, --file-types, etc.)
  • Print a separator between runs for readability
  • Exit on Ctrl+C

Implementation notes

  • Use fsnotify for cross-platform file watching (well-maintained, pure Go, used by Hugo/Viper/etc.)

Metadata

Metadata

Assignees

Labels

CLIUpdate to the CLIhas-prThis issue has an associated PRhelp wantedExtra attention is neededvalidator-coreIssues that relate to the core validator functionality

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions