Skip to content

test(checker): cover the pipe placeholder shapes the R10 matrix claims - #132

Merged
sims1253 merged 3 commits into
mainfrom
test/pipe-matrix-shapes
Aug 31, 2026
Merged

sims1253 merged 3 commits into
mainfrom
test/pipe-matrix-shapes

Conversation

@sims1253

@sims1253 sims1253 commented Aug 31, 2026 •

Copy link
Copy Markdown
Owner

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

  • Add three cases to r10_pipe_placeholder_matrix_no_panic_deterministic in crates/ry-checker/tests/metamorphic.rs:
    • Native pipe with the _ placeholder (R 4.2+): x <- 1L\ny <- x |> list(y = _)
    • Magrittr pipe with implicit first-argument insertion: x <- 1L\ny <- x %>% sum()
    • Magrittr pipe with the . placeholder: df <- data.frame(a = 1L)\nresult <- df %>% nrow(.)
  • Rewrite the test's doc comment to enumerate the spanned shapes: both pipe forms, both placeholders, implicit insertion. Every claimed shape now has a case, and every case has a claim.
  • Leave the existing cases and labels untouched.

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-checker
  • cargo clippy -p ry-checker --all-targets -- -D warnings
  • cargo test -p ry-checker --test metamorphic (16 passed)

Closes #119

Summary by CodeRabbit

  • Tests
    • Expanded regression coverage for pipe expressions using native and magrittr-style placeholders.
    • Added cases for implicit first-argument insertion and placeholder usage in function calls.
    • Verified that these expressions complete without errors and produce deterministic results.
    • Confirmed consistency between piped and equivalent direct-call expressions across the expanded test matrix.

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
@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 36 minutes.

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: Pro Plus

Run ID: 2459bb99-ba00-4226-bc1f-80dd5c07a1fe

📥 Commits

Reviewing files that changed from the base of the PR and between c029f66 and a62de7b.

📒 Files selected for processing (1)
  • crates/ry-checker/tests/metamorphic.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0cf40e9f-5957-4890-ae6b-4b8eadf3ee25

📥 Commits

Reviewing files that changed from the base of the PR and between d12ab53 and c029f66.

📒 Files selected for processing (1)
  • crates/ry-checker/tests/metamorphic.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The R10 metamorphic test matrix now covers native |> and magrittr %>% forms, including _ and . placeholders and implicit first-argument insertion. Existing determinism and pipe-versus-direct-call assertions remain unchanged.

Changes

R10 pipe coverage

Layer / File(s) Summary
Expand pipe matrix cases
crates/ry-checker/tests/metamorphic.rs
The matrix adds cases for `x

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to c029f

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

A rabbit checks each pipe with care
_ and . now travel there
Native paths and magrittr flow
Keep deterministic results in tow
Three new shapes join the test array

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the test change and the missing pipe placeholder shapes covered by the matrix.
Linked Issues check ✅ Passed The pull request adds all three cases required by issue #119: native |> with _, magrittr %>% with implicit first-argument insertion, and magrittr %>% with ., and updates the coverage documentation.
Out of Scope Changes check ✅ Passed The changes are limited to the R10 regression matrix and its documentation. They directly support issue #119 and do not introduce unrelated code changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/pipe-matrix-shapes

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.

ℹ️ 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).

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

Comment thread crates/ry-checker/tests/metamorphic.rs Resolved
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.

@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 critical issues — minor suggestions inline.

Reviewed changes

  • Mirrored the three new shapes in the equivalence pairs section: 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 pairs doc 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.

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

Comment thread crates/ry-checker/tests/metamorphic.rs Resolved
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.

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

Reviewed changes

  • Gave the equivalence pairs type-level teeth: new inferred_binding helper reads the piped binding's RType through check_with_scope (the same Scope the 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 sum to nchar: nchar's x is a required formal in the base typeshed, so a dropped LHS surfaces as RY091 instead of the sum()/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 nchar was 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.

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.

test(metamorphic): R10 pipe matrix is missing the underscore and magrittr placeholder shapes it claims to cover

1 participant