chore(checker): delete dead state, dedupe closure loop, share the test fixpoint - #142
Conversation
- Replace Project::prev_return_slots with a has_prev_emit bool; the full RType vector was cloned every emit and only tested for presence. - compute_fixpoint_scope now calls with_transitive_callers instead of re-implementing its reverse-caller closure loop. - The shared test helper check_with_scope delegates to the public Checker::check_with_scope instead of replaying collect plus a manual fixpoint. - Drop the unused rationale field from Verdict in rule_evidence.rs; code and verdict are the asserted fields. - Drop the cfg(test) is_package_library_file helper and its single assertion, which re-tested ry-workspace classification. - Rename infer_schema_call's unused span parameter to _span. - State the current constraint in the filter-builder comment instead of the move history.
|
Warning Review limit reachedNext included review available in 26 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 (6)
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 new issues found.
Reviewed changes
This run reviewed the full single-commit cleanup PR (6 files, all internal to crates/ry-checker); every equivalence and deadness claim in the description was verified against the code, and the crate's gates were re-run locally.
prev_return_slots→has_prev_emit— theOption<Vec<RType>>was cloned in full on every emit and only ever tested for presence; the bool now sits at all six former sites with identical semantics, and a workspace grep confirms zero remaining references. Change detection was already name-keyed viaprev_fn_returns/prev_fn_signatures.- Closure-loop dedupe — the removed fixpoint loop in
compute_fixpoint_scopeis line-for-line the body ofwith_transitive_callers(crates/ry-checker/src/project.rs:516), whose other caller is the dirty-set expansion; semantics unchanged. - Shared test fixpoint —
check_with_scopenow delegates to the publicChecker::check_with_scope(crates/ry-checker/src/lib.rs:773), so unit tests run the real pass structure (quoting propagation, discarding flag, parse errors) instead of a private replay that could diverge. Verdict.rationaledropped — the three verdict-enforcing tests stay (every_rule_has_an_executed_verdict,verdicts_use_only_allowed_values,default_off_verdicts_match_the_registry), and the rationale texts are confirmed present indocs/corpus/rule-evidence-0.9.md(RY010/032/034/070/093/099/100/103 spot-checked).- Smaller removals —
is_package_library_file(#[cfg(test)], zero remaining references, re-export kept), thespan→_spanrename ininfer_schema_call(sole positional caller atsrc/infer/call.rs:549unaffected), and the filter-builder comment now correctly states the current dependency direction (ry-checker→ry-configverified inCargo.toml; no reverse dep). - Skipped deletion is sound —
Checker::native_registrationis still read atsrc/infer/call.rs:446, so keeping it out of this PR is right.
Local verification: cargo clippy -p ry-checker --all-targets -- -D warnings clean; cargo test -p ry-checker 591 passed / 0 failed / 9 ignored.
openai-compatible/glm-5.3 | 𝕏

Summary
Internal cleanup in
crates/ry-checker. No behavior change. Net -68 lines.Changes
Project::prev_return_slotswas anOption<Vec<RType>>cloned in full on every emit and only tested for presence. Replaced with thehas_prev_emitbool. The compared values already live inprev_fn_returnsandprev_fn_signatures, keyed by name.compute_fixpoint_scopere-implemented the reverse-caller closure thatwith_transitive_callersprovides 25 lines below. The two loops were line-for-line identical. The method call replaces the copy.check_with_scopereplayedcollect_fnsplus its own fixpoint loop, which skipped quoting propagation and the discarding flag. It now delegates to the publicChecker::check_with_scope, so unit tests run the real pass structure.Verdictintests/rule_evidence.rscarried arationalefield no assertion read. Dropped it and the#[allow(dead_code)].codeandverdictstay; three tests enforce them. The evidence text lives indocs/corpus/rule-evidence-0.9.md.#[cfg(test)]is_package_library_filehelper and its single assertion inscope_resolution.rs. It re-testedry_workspace::package_file_kind, which exercises that classification through its own code paths. The cross-file resolution test itself stays.infer_schema_callsilenced its unusedspanparameter withlet _ = span;. Renamed the parameter to_span. The sole caller lives insrc/infer/call.rs, which this PR does not touch.SeverityFilter, a checker type, and the reverse dependency would be a cycle.Skipped: deleting
Checker::native_registration. The brief called it dead, butsrc/infer/call.rs:446reads it (is_registered_ffi_wrapper(...) && self.native_registration). That file belongs to thesrc/infer/PRs, so the field stays.Verification
cargo fmt -p ry-checker— clean.cargo clippy -p ry-checker --all-targets -- -D warnings— clean.cargo test -p ry-checker— 595 passed, 0 failed, 9 ignored.cargo check -p ry-cli -p ry-lsp— clean.