feat(discovery): explain skipped files and support build-ignore exceptions - #448
feat(discovery): explain skipped files and support build-ignore exceptions#448sims1253 wants to merge 3 commits into
Conversation
|
Warning Review limit reachedNext included review available in 15 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (9)
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 |
There was a problem hiding this comment.
Important
One behavior regression to resolve before merge: the new ancestor scan makes ry check <build-ignored-dir> silently discover zero files where base checked the subtree (exit code flips 1 → 0). Details inline, plus one docs nit.
Reviewed changes
ry check --explain-files: new clap flag;rescanprintsry: include/ry: skip (reason)lines plus an omitted-count note per search root on stderr, keeping stdout (including JSON) clean; watch-mode polls stay quiet.SkippedPathsreport in shared discovery: every prune site (symlink,ry.tomlexclude,.Rbuildignore, hidden/generated directory, package support directory, test fixture) records a reason; non-source files are filtered, entries are capped atindex.max-fileswith anomittedcounter, and sorted.include-build-ignoredconfig key: globs validated at load (InvalidIncludePattern), anchored at the config root, matched withrequire_literal_separator; threaded throughConfigdefault/merge so CLI and LSP both honor it..Rbuildignorematching reworked to an ancestor scan plus aninherited_buildignoreflag: ignored directories are entered when include patterns exist, children inherit the ignored state across nested-package boundaries, and each file is checked against the includes; excludes, fixture rules, and hidden-directory rules still take precedence.- Tests: three
shared_testspinning narrow includes, nested-package inheritance, and the bounded report, plus an e2e test pinning valid JSON on stdout and explanation content on stderr;docs/configuration.mdanddocs/usage.mdupdated; CHANGELOG### Addedentry citing #363.
Verified locally: cargo fmt --check, clippy with -D warnings, and cargo test for ry-workspace --lib (43), ry-config --lib (34), and ry-cli --test config_e2e (41) all pass, plus empirical CLI probes of the include/explain behavior against both this branch and reverted base sources.
openai-compatible/glm-5.3 | 𝕏
There was a problem hiding this comment.
✅ No new issues found — both threads from the prior review are addressed cleanly.
Reviewed changes
- Bounded the
.Rbuildignoreancestor scan at the walk root (crates/ry-workspace/src/discovery.rs):ry check <ignored-dir>again checks the subtree instead of silently discovering nothing and exiting 0, whileinherited_buildignorestill carries ignore state below entered directories so nested-package semantics and narrow includes are unchanged. - Added the e2e regression test
explicitly_requested_build_ignored_directory_still_gets_checked, pinning a non-zero exit, anRY000diagnostic on stdout as valid JSON, and theincludeexplanation on stderr for an explicitly requested build-ignored directory — it fails on the pre-fix commit and passes here (verified both). - Documented the directory-versus-subtree distinction for
include-build-ignoredindocs/configuration.md(vignettes/**for the whole subtree;vignettesalone matches only the directory).
Verified locally: cargo fmt --check, cargo clippy -p ry-workspace -p ry-cli -- -D warnings, cargo test -p ry-workspace --lib (43 passed), and cargo test -p ry-cli --test config_e2e (42 passed) all green.
openai-compatible/glm-5.3 | 𝕏

ry check . --explain-filesnow lists included files and skipped paths on stderr. This explains cases such as dtplyr's ignored vignette while keeping JSON diagnostics valid on stdout.include-build-ignored = ["vignettes/benchmark.R"]adds a persistent exception to.Rbuildignorefor CLI discovery and editor indexing. It preserves explicit config excludes, fixture settings, hidden/generated directory rules, symlink handling, and discovery caps. A skipped directory represents its subtree; explanations are bounded byindex.max-files.Validation: a fresh workspace build, workspace tests, Clippy with warnings denied, and formatting pass. Tests cover ignored ancestors across nested packages, narrow exceptions, config-exclude precedence, report limits, invalid globs, and the CLI's JSON output. The existing LSP protocol and discovery tests pass through the same shared walker.
Closes #363.