Skip to content

feat(discovery): explain skipped files and support build-ignore exceptions - #448

Open
sims1253 wants to merge 3 commits into
mainfrom
feat/discovery-explanations
Open

feat(discovery): explain skipped files and support build-ignore exceptions#448
sims1253 wants to merge 3 commits into
mainfrom
feat/discovery-explanations

Conversation

@sims1253

Copy link
Copy Markdown
Owner

ry check . --explain-files now 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 .Rbuildignore for 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 by index.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.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: af741927-0081-494e-9812-f85b85c44aaf

📥 Commits

Reviewing files that changed from the base of the PR and between 92c822a and e26979c.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • crates/ry-cli/src/check.rs
  • crates/ry-cli/src/main.rs
  • crates/ry-cli/tests/config_e2e.rs
  • crates/ry-config/src/config.rs
  • crates/ry-workspace/src/discovery.rs
  • crates/ry-workspace/src/lib.rs
  • docs/configuration.md
  • docs/usage.md

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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; rescan prints ry: 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.
  • SkippedPaths report in shared discovery: every prune site (symlink, ry.toml exclude, .Rbuildignore, hidden/generated directory, package support directory, test fixture) records a reason; non-source files are filtered, entries are capped at index.max-files with an omitted counter, and sorted.
  • include-build-ignored config key: globs validated at load (InvalidIncludePattern), anchored at the config root, matched with require_literal_separator; threaded through Config default/merge so CLI and LSP both honor it.
  • .Rbuildignore matching reworked to an ancestor scan plus an inherited_buildignore flag: 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_tests pinning 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.md and docs/usage.md updated; CHANGELOG ### Added entry 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.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using openai-compatible/glm-5.3𝕏

Comment thread crates/ry-workspace/src/discovery.rs
Comment thread docs/configuration.md

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found — both threads from the prior review are addressed cleanly.

Reviewed changes

  • Bounded the .Rbuildignore ancestor 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, while inherited_buildignore still 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, an RY000 diagnostic on stdout as valid JSON, and the include explanation 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-ignored in docs/configuration.md (vignettes/** for the whole subtree; vignettes alone 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.

Pullfrog  | View workflow run | Using openai-compatible/glm-5.3𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package traversal silently skips vignettes/*.R, hiding real syntax errors (dtplyr benchmark.R)

1 participant