no-delete-statement
Avoid del statements; prefer constructing an immutable replacement value.
Why
Deleting a name, attribute, or collection entry introduces lifetime or in-place mutation semantics that are harder to follow than explicit value construction.
Fix
Remove unused-value deletion markers. Rebuild collections with comprehensions, copies, or immutable value helpers such as dataclasses.replace. When an external API or deliberate lifetime boundary requires deletion, add an exact SARJ442 suppression on the statement and explain why.
Examples
def ready(): def _ready(): unused = None del unused return True
return _ready()def ready(): def _ready(): unused = None
return True
return _ready()Autofix output
def ready(): def _ready(): unused = None
return True
return _ready()payload = dict(raw_payload)del payload["secret"]payload = {key: value for key, value in raw_payload.items() if key != "secret"}Formerly: no-deleted-only-override-parameter