strip-none-return
FormattingProse drops a redundant -> None return
An unannotated parameter is a legibility gap. The reader meets the function without knowing what it takes, while the annotated form lays out cleanly through the
and columns. reports a parameter that carries no type annotation, leaving a method'sself, a classmethod's cls, and the *args and **kwargs variadics outside the rule.The rule also reports a function whose body returns a value yet carries no return annotation. A procedure that returns nothing stays silent, so in a clean file a signature without a return annotation reads as a function that returns nothing. The companion
rule enforces the other side of that convention, dropping an explicit-> None the omission already reads as visual weight.Because Prose reads source rather than resolving types, the rule never synthesizes an annotation for the author. When a confident local signal exists, a literal default (threshold=0.8 suggesting float) or in-module call sites passing only literals, the report carries a suggestion the reader applies by hand. A bare = None default contributes its | None arm only alongside another signal, and conflicting or non-literal signals leave the report unsuggested. The suggestion rides as a display-only fix, recorded for the reader but never applied.
| Key | Type | Default | Meaning |
|---|---|---|---|
enabled | bool | true | Toggle the rule on or off |
An unannotated parameter draws the report, and a literal default rides a display-only type suggestion the formatter records but never applies.
def scale(factor=2.0):
return factor * 2
A parameter defaulting to None carries no suggestion on its own, yet a literal-only call site passing a str lifts it to a str | None suggestion, the None riding as the optional arm.
A function whose body returns a value draws the missing-return report, whereas a procedure that returns nothing stays silent, so the absent
An annotated parameter and a return-annotated function draw no report, so only the unannotated count surfaces, the rule flagging the gap rather than the
A parameter that one call site passes an int and another a str reports without a suggestion, because the conflicting signals leave no confident type to offer.
An unannotated parameter whose in-module call sites pass only int literals draws a display-only int suggestion, resolved through the call-resolution machinery the reorder rules already share.
A method's self, a classmethod's cls, and the *args and **kwargs variadics sit outside the parameter report, leaving only the genuinely annotatable parameters flagged.
Prose drops a redundant -> None return
Prose normalizes function signatures to one line or one parameter per line, gated by line length and inline-parameter count.
Prose surfaces Union[A, B] and Optional[T] patterns that should read as modern A | B and T | None.
For per-line opt-outs, the Suppression chapter covers the # prose: ignore[signature-annotations] directive.