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.)
Description
Add a
--watchflag that monitors the search path for file changes and re-validates automatically. This is useful during local development when editing config files.Proposed behavior
--exclude-dirs,--gitignore,--file-types, etc.)Implementation notes