Repository navigation
docs: document CLI flags, config gotchas and library tuning in README - #60
Conversation
Bring the README back in line with the crate as it stands after the builder-API and monorepo-init work: - install from crates.io first, git as the fallback; state the 1.85.0 MSRV - add a watch-options flag table (-d/-c/-i/--bin_path/--bin_arg/--cfg/--monitor) - add a "things that surprise people" section covering the behaviours that are easy to get wrong: ignore replaces the defaults rather than extending them, a cmd list runs in parallel, commands need no cd prefix, relative bin_path resolves against the workspace dir, env_file's leading slash means project root, only data-modification events reload, config beats CLI flags - document the monitor keybindings and that it matches processes against rustywatch.yaml - cover extend_ignore, up-front validation and debounce tuning in the library section, plus the full list of supported re-exports - use --force for the update instruction, and list the init-detected languages with their marker files Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughREADME.md documents project setup, configuration, watch mode, monitoring, library usage, language detection, and package upgrades. ChangesREADME documentation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying rustywatch with
|
| Latest commit: |
cce34a8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0923a080.rustywatch.pages.dev |
| Branch Preview URL: | https://docs-readme-refresh.rustywatch.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 264-267: Update the validation wording in the README around
builder(), from_config(), and from_config_file(): state that builder().build()
reports builder validation errors, while from_config() and from_config_file()
return constructor-time validation errors before run(). Preserve the listed
validation cases and distinguish the timing for each construction path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| safe to embed in a larger application. `builder()`, `from_config()` and | ||
| `from_config_file()` all validate up front (non-empty workspaces, non-blank | ||
| `dir`, non-empty `cmd`, ignore patterns compile as globs), so a bad config fails | ||
| at `build()` rather than mid-run. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "## README surrounding lines"
sed -n '240,285p' README.md | cat -n
echo
echo "## Files mentioning builder/from_config/from_config_file/run/build"
rg -n "builder\\(|from_config\\(|from_config_file\\(|func .*build|\\.build\\(|\\.run\\(" -S .Repository: ak9024/rustywatch
Length of output: 7734
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "## Candidate Go files"
fd -e go . | sort | head -100
echo
echo "## Read likely implementation files around relevant symbols"
for f in $(rg -l "func (builder|from_config|from_config_file|.*build|.*run)|type .*Config|struct .*Config|Validate|non-empty workspaces|non-blank|non-empty cmd" -S .); do
echo "### $f"
wc -l "$f"
rg -n "func (builder|from_config|from_config_file|.*build|.*run)|type .*Config|struct .*Config|Validate|non-empty workspaces|non-blank|non-empty cmd|build\\(|run\\(" "$f" -C 2
doneRepository: ak9024/rustywatch
Length of output: 8451
Clarify when each constructor returns validation errors.
from_config_file(...) and from_config(...) return before .run() in the documented examples, so “fails at build()” is incorrect for those paths. Split the wording: builder().build() reports builder validation, while from_config() and from_config_file() report constructor-time validation for the same errors.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@README.md` around lines 264 - 267, Update the validation wording in the
README around builder(), from_config(), and from_config_file(): state that
builder().build() reports builder validation errors, while from_config() and
from_config_file() return constructor-time validation errors before run().
Preserve the listed validation cases and distinguish the timing for each
construction path.
Summary
The README had drifted behind the crate — it still pointed at a git-only install, listed no watch flags, and said nothing about the behaviours that most often trip people up. This brings it back in line with the code as it stands after the builder-API and monorepo-init work.
-d/-c/-i/--bin_path/--bin_arg/--cfg/--monitor), with the note that--cmdis required in flags-only mode.ignorereplaces the defaults rather than extending them, acmdlist runs in parallel, commands need nocdprefix, a relativebin_pathresolves against the workspacedir,env_file's leading/means project root (not filesystem-absolute), only data-modification events reload, and the config file wins over CLI flags.rustywatch.yaml.extend_ignore, the up-front validation inbuilder()/from_config*(), debounce tuning viadebounce_delay/max_debounce_delay, and the full list of supported re-exports.cargo install rustywatch --forcefor updates (the plain form is a no-op when already current).Test plan
cargo test --docpasses (7 tests). The README itself is not wired into doctests, so the snippets were checked against the source instead:extend_ignoreatsrc/config/schema.rs:131,debounce_delay/max_debounce_delayatsrc/watcher.rs:181,190, and the flag table againstWatchArgsinsrc/args.rs.Note: a stale local branch
docs/update-readmestill exists from #51 (already merged asf430ff6), which is why this one is nameddocs/readme-refresh.🤖 Generated with Claude Code
Summary by CodeRabbit