Repository navigation
test(checker): cover the pipe placeholder shapes the R10 matrix claims - #132
Conversation
The R10 matrix relabeling pass (bf48af3) made the case comments match the sources. Three shapes the matrix claims were still absent: the native `_` placeholder, magrittr implicit first-argument insertion, and the magrittr `.` placeholder. Add one case per shape and enumerate the spanned shapes in the doc comment so claims and cases stay in sync. Closes #119
|
Warning Review limit reachedNext included review available in 36 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: Pro Plus Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe R10 metamorphic test matrix now covers native ChangesR10 pipe coverage
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change only expands test coverage for existing pipe placeholder behavior and does not alter production code or interfaces; no actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
- Three new R10 matrix cases: native
|>with the_placeholder, magrittr%>%with implicit first-argument insertion, and magrittr%>%with the.placeholder — exactly the three shapes #119 asked for, inserted next to their related existing cases. Existing cases and labels are untouched. - Doc-comment rewrite on the test: now enumerates the spanned shapes (both pipe forms, both placeholders, implicit insertion) instead of the old generic description. Every claimed shape now has a case and vice versa.
Verification performed in this run: cargo test -p ry-checker --test metamorphic (16 passed, matching the body), cargo fmt --check, and cargo clippy --all-targets -- -D warnings all clean. I also confirmed the body's non-vacuity claim independently — the gate's check_source helper uses .expect("parse") so a parse failure fails the test, and ry dump-types on all three new sources shows each one inferring a real type through a distinct substitution arm of infer_pipe (list<len=1>{y:integer<len=1>}, double<len=1>, integer<len=1>). Skipping a CHANGELOG entry matches the sibling test-only PRs (#118, #120).
openai-compatible/glm-5.3 | 𝕏
Mirror the three new matrix shapes in the equivalence pairs: magrittr %>% with implicit insertion, magrittr %>% with the . placeholder, and native |> with the _ placeholder. Each pairs against its direct call form.
There was a problem hiding this comment.
ℹ️ No critical issues — minor suggestions inline.
Reviewed changes
- Mirrored the three new shapes in the equivalence
pairssection: magrittr implicit first-argument insertion (the prior review's exact suggestion), the magrittr.placeholder, and the native_placeholder — the prior thread is fully addressed and has been resolved. - Generalized the
pairsdoc comment to state the desugaring rule across all three pipe forms instead of the native-only one, and labeled the leading native pair.
Verification in this run: cargo test -p ry-checker --test metamorphic (16 passed), cargo fmt --check, and cargo clippy --all-targets -- -D warnings all clean. I also mutation-checked the new pins: disabling placeholder substitution in infer/pipe.rs fails the test at the _ pair (RY010 divergence), but inverting the implicit-insertion prepend arm leaves the suite green — that asymmetry is the subject of the inline suggestion.
openai-compatible/glm-5.3 | 𝕏
Diagnostic codes alone cannot see a broken implicit insertion: sum() and sum(1L) both infer double<len=1>, so the magrittr pair stayed green with the prepend arm inverted. Compare the piped binding's inferred type too, and switch that pair's RHS to nchar, whose argument is required, so a dropped LHS surfaces as RY091. Verified by mutation: inverting the prepend arm and disabling placeholder substitution both fail the gate now.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Gave the equivalence
pairstype-level teeth: newinferred_bindinghelper reads the piped binding'sRTypethroughcheck_with_scope(the sameScopethe LSP inlay-hint path reads), and every pair now carries its binding name with an equality assertion alongside the diagnostic-code comparison. - Switched the implicit-insertion pair from
sumtonchar:nchar'sxis a required formal in the base typeshed, so a dropped LHS surfaces as RY091 instead of thesum()/sum(1L)both-double<len=1>coincidence — the exact hole the prior review's mutation exposed. - Documented the rationale in the pairs comment: why codes alone cannot see a broken desugaring and why
ncharwas chosen.
Verification in this run: cargo test -p ry-checker --test metamorphic (16 passed), cargo fmt --check, and cargo clippy -p ry-checker --all-targets -- -D warnings all clean. I also independently reproduced the mutation result: inverting the prepend arm at crates/ry-checker/src/infer/pipe.rs:180 — which left the suite green before this commit — now fails the gate at the new type assertion (Opaque/unknown vs integer<len=1>), and confirmed nchar's x is required: true in ry-typeshed/vendor/base/base.json so the RY091 claim is grounded. Both levels of the pin have real teeth.
openai-compatible/glm-5.3 | 𝕏

Summary
The R10 pipe matrix claims to cover pipe placeholder combinations. The relabeling pass in #120 made the case comments match the sources, but three claimed shapes were still absent. This PR adds them.
Changes
r10_pipe_placeholder_matrix_no_panic_deterministicincrates/ry-checker/tests/metamorphic.rs:_placeholder (R 4.2+):x <- 1L\ny <- x |> list(y = _)x <- 1L\ny <- x %>% sum().placeholder:df <- data.frame(a = 1L)\nresult <- df %>% nrow(.)Each new source was verified to parse and infer a real type, so the no-panic gate is not vacuous for them.
Verification
cargo fmt -p ry-checkercargo clippy -p ry-checker --all-targets -- -D warningscargo test -p ry-checker --test metamorphic(16 passed)Closes #119
Summary by CodeRabbit