strip-none-return
FormattingDrops a redundant -> None return annotation, since an omitted one already reads as returning nothing.
An unannotated parameter is a legibility gap, leaving the reader to meet the function without knowing what it takes, whereas 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 | Toggles 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 annotation reads as a function returning nothing.
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 annotation already present.
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.
Drops a redundant -> None return annotation, since an omitted one already reads as returning nothing.
Normalizes function signatures to one line or one parameter per line, gated by line length and inline-parameter count.
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.