Skip to content

chore: sweep dead code, collapse PACKAGE_SPECS, repair garbled strings - #157

Merged
sims1253 merged 2 commits into
mainfrom
cleanup/01-dead-code
Sep 2, 2026
Merged

sims1253 merged 2 commits into
mainfrom
cleanup/01-dead-code

Conversation

@sims1253

@sims1253 sims1253 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Cleanup sprint, PR 1 of 7. Net −593 lines (34 files, +213/−806). Everything deleted was verified dead by workspace-wide grep before deletion; the few judgment calls are called out below.

Dead API (ry-checker)

Checker::apply_filter, Project::apply_filter (every real caller uses apply_filter_to_diagnostics; the "kept so apply_filter can run after check()" doc comments were stale and are rewritten), Diagnostic::with_confidence, filter_default_disabled (its doc claimed the LSP uses it — false since #144), and the packages.rs backward-compat shim (nothing imports that path; the one internal user now imports from ry_workspace::packages directly).

Legacy suppression parser (parse_suppressions, parse_ignore_comment, line_before_comment, has_file_suppression, filter_suppressed, ~89 lines): production code reached it zero times — every real entry point uses the _from_comments lexical API; only its own tests kept it alive. The 16 affected tests are ported to parse_suppressions_from_comments via a scan_comments helper that reproduces the parser's Comment semantics (verified against ast.rs/parser.rs); all 29 tests in the module keep their behavioral intent.

Dead code elsewhere

  • editors/zed: the hand-rolled SHA-256 + FIPS test vectors (~110 lines) — its own comment admitted no production path calls it. The NOTE explaining the archive-digest problem stays; real verification is tracked in Zed extension: implement real binary integrity verification #80.
  • editors/code: environment.ts (never-constructed placeholder), the ry.addExecutableToTerminalPath setting (forwarded by settings, applied by nothing — the checkbox did nothing), plus verified-dead helpers (getProjectRoot, pathExists, resolveVariables, showLogs* commands, setCommand, MINIMUM_VERSION alias).
  • ry-core/ry-typeshed/ry-workspace/ry-config: ClassVector::with_class (copy-paste twin of from_slice), FunctionSig::params/return_ accessors over public fields, unconstructible TypeshedError::Json, Default for DiscoveryLimits, never-read TruncationReport.root, unused derives/re-export, hidden duplicate ExplainTypeshed subcommand, ecosystem/diff.sh, .yamllint.yml.
  • r_version config key (the one deliberate schema change): documented "Reserved for future use; accepted but currently ignored", read by nothing. Removed — breaking for ry.toml files that set it (now an unknown-field parse error). CHANGELOG entry added under [Unreleased]. Revert this hunk if you'd rather keep the forward-compat affordance.

PACKAGE_SPECS

The 130-line struct-literal table → a 33-line &[(&str, &str)] tuple list. Programmatically verified: same 32 packages, same order; PackageSpec struct deleted.

Garbled strings

  • RY032: "…current R errors for vectors" → "…R errors at runtime for vector operands". The purrr vendor snapshot (one line) and the Posit corpus ledger (48 RY032 entries) were regenerated via the real posit_messages.py update path; both the PR fast tier and the scheduled full tier of the corpus check pass locally (negative control confirms the harness catches the old drift).
  • dump-types --format error: "expected one of: json" (a list of one) → "only json is supported".
  • ry check with no files: no longer prints Rust Debug of a Vec<PathBuf>.

Gates

cargo test --workspace ×3, clippy -D warnings, fmt, VS Code lint/tsc/compile + unit tests, zed cargo test --locked — all green. VS Code e2e and the zed wasm build run in CI only (need xvfb / wasm target). Independently audited before push (see the ledger catch above).

@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 22 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: Team

Run ID: 7cbc932a-a7f2-4cc5-8628-23a14476b147

📥 Commits

Reviewing files that changed from the base of the PR and between dee0018 and 803dd41.

⛔ Files ignored due to path filters (1)
  • crates/ry-checker/tests/snapshots/vendor_snapshot__purrr_vendor.snap is excluded by !**/*.snap
📒 Files selected for processing (33)
  • .yamllint.yml
  • CHANGELOG.md
  • crates/ry-checker/src/diagnostics.rs
  • crates/ry-checker/src/infer/binop.rs
  • crates/ry-checker/src/infer/mod.rs
  • crates/ry-checker/src/infer/recall.rs
  • crates/ry-checker/src/lib.rs
  • crates/ry-checker/src/packages.rs
  • crates/ry-checker/src/project.rs
  • crates/ry-checker/src/suppress.rs
  • crates/ry-checker/src/tests/diagnostics.rs
  • crates/ry-cli/src/dump.rs
  • crates/ry-cli/src/main.rs
  • crates/ry-cli/tests/dump_types_e2e.rs
  • crates/ry-config/src/baseline.rs
  • crates/ry-config/src/config.rs
  • crates/ry-core/src/types.rs
  • crates/ry-lsp/src/settings.rs
  • crates/ry-typeshed/src/lib.rs
  • crates/ry-workspace/src/lib.rs
  • crates/ry-workspace/src/packages.rs
  • docs/corpus/posit-messages-0.9.json
  • ecosystem/diff.sh
  • editors/code/README.md
  • editors/code/package.json
  • editors/code/src/common/binary.ts
  • editors/code/src/common/commands.ts
  • editors/code/src/common/environment.ts
  • editors/code/src/common/settings.ts
  • editors/code/src/common/status.ts
  • editors/code/src/common/utilities.ts
  • editors/code/src/extension.ts
  • editors/zed/src/lib.rs

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

The full 34-file diff was read end-to-end, and the dead-code and sweep claims were re-verified locally: cargo check --workspace --all-targets is clean, the 29 ported suppression tests pass, the zed crate tests pass, test_posit_messages.py and check-ledger.py both validate, and repo-wide greps find zero lingering references to any deleted symbol or old string.

  • Dead-API removal (ry-checker): the legacy suppression line-scanner (parse_suppressions, parse_ignore_comment, line_before_comment, has_file_suppression, filter_suppressed), both apply_filter variants, with_confidence, filter_default_disabled, and the ry_checker::packages re-export shim — every production caller already used the _from_comments lexical API.
  • Test port: the 16 affected tests moved to parse_suppressions_from_comments via a scan_comments helper whose Comment semantics (0-based line, byte column, body after #) match the parser's collect_comments; the real-parser path itself stays covered by corpus.rs, the LSP, and the CLI.
  • PACKAGE_SPECS collapse: struct-literal table → 32 (&str, &str) tuples, same packages in the same order; PackageSpec, the FunctionSig::params/return_ accessors, and TypeshedError::Json all removed with their call sites rewritten.
  • Garbled-string fixes: RY032 message reword (purrr snapshot + 48 posit-ledger entries regenerated through the real update path), dump-types --format error text, and ry check no longer Debug-printing a Vec<PathBuf> when no files are found.
  • Breaking r-version removal: deny_unknown_fields is real on Config, so the CHANGELOG's parse-failure claim is accurate; the entry sits under ### Removed per convention, and 0.9.0 is unreleased so no shipped schema is affected.
  • Editor cleanup: VS Code dead helpers and the no-op addExecutableToTerminalPath setting removed — the ry.showLogs/ry.showServerLogs commands remain registered via inline lambdas in extension.ts, so package.json and the README stay consistent; the unused zed SHA-256 + FIPS vectors are gone with the archive-digest NOTE intact.

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

Comment thread crates/ry-checker/src/infer/binop.rs Resolved
@sims1253

sims1253 commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

Addressed pullfrog's CHANGELOG note in 803dd41: one ### Fixed bullet under [Unreleased] covering the RY032 reword plus the two CLI message repairs.

@sims1253
sims1253 merged commit 2f573b0 into main Sep 2, 2026
16 checks passed
@sims1253
sims1253 deleted the cleanup/01-dead-code branch September 2, 2026 10:19
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.

1 participant