Skip to content

chore: satisfy nightly clippy::question-mark#131

Merged
avrabe merged 2 commits intomainfrom
chore/ci-green-prep
Apr 21, 2026
Merged

chore: satisfy nightly clippy::question-mark#131
avrabe merged 2 commits intomainfrom
chore/ci-green-prep

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 20, 2026

Summary

Unblocks CI: nightly clippy (what the CI workflow uses) has clippy::question-mark warn-by-default, which -D warnings promotes to an error. Three pre-existing sites fail:

  • crates/spar-hir-def/src/item_tree/lower.rs:1979 (range-property lowering)
  • crates/spar-render/src/lib.rs:169 (ancestor-walk in render hierarchy)
  • crates/spar-cli/src/lsp.rs:1902 (connection-line arrow matching)

Each was an if let Some / else return None pattern. Rewritten with ? per clippy's own suggestion. No behavior change.

Why this is its own PR

#130 is blocked on CI being green. Main is also red (these lints are pre-existing), so rebasing #130 wouldn't help. Landing this first lets #130 merge on green CI as originally intended.

Test plan

  • cargo test --workspace — 2,443 pass, 0 fail
  • rustup run nightly cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo fmt --check — clean

🤖 Generated with Claude Code

CI runs `cargo clippy --workspace --all-targets -- -D warnings` on
nightly Rust (1.97.0-nightly at writing), which enables
`clippy::question-mark`. Three pre-existing sites in `spar-hir-def`,
`spar-render`, and `spar-cli` triggered it — each an `if let Some / else
return None` pattern that clippy wants rewritten with `?`.

No behavior change; nightly clippy now clean, 2,443 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spar-cli/src/lsp.rs 94.28% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Adds three focused unit tests for the LSP swap-connection quick-fix:
the unidirectional `->` path, the bidirectional `<->` path (the new
`?` branch introduced in the clippy::question-mark rewrite), and the
no-arrow fallback that returns None. Raises patch coverage past the
codecov/patch gate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avrabe avrabe force-pushed the chore/ci-green-prep branch from c68f1b3 to d6b691c Compare April 20, 2026 19:15
@avrabe avrabe merged commit fdddc3b into main Apr 21, 2026
11 checks passed
@avrabe avrabe deleted the chore/ci-green-prep branch April 21, 2026 04:12
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