pi-lens
Version:
Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo
48 lines (37 loc) • 968 B
YAML
id: rust-todo-unimplemented
name: Unfinished Stub Macro
severity: warning
category: correctness
defect_class: correctness
inline_tier: blocking
language: rust
message: "todo!() / unimplemented!() stub — function was scaffolded but never completed"
description: |
todo!() and unimplemented!() always panic at runtime. They are scaffolding
markers that must be replaced before shipping.
✅ FIX: implement the function body or return an appropriate error.
query: |
(macro_invocation
macro: (identifier) @MACRO
(#match? @MACRO "^(todo|unimplemented)$")) @CALL
metavars:
- MACRO
- CALL
has_fix: false
tags:
- rust
- correctness
- stub
- panic
examples:
bad: |
fn process_payment(amount: f64) -> Result<Receipt> {
todo!()
}
fn legacy_path() -> bool {
unimplemented!()
}
good: |
fn process_payment(amount: f64) -> Result<Receipt> {
stripe_client.charge(amount).map(Receipt::from)
}