Skip to content

signature-annotations

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's self, 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.

Configuration

KeyTypeDefaultMeaning
enabledbooltrueToggle the rule on or off

The Canonical Case

An unannotated parameter draws the report, and a literal default rides a display-only type suggestion the formatter records but never applies.

python
def scale(factor=2.0):
    return factor * 2

More Examples

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.

For per-line opt-outs, the Suppression chapter covers the # prose: ignore[signature-annotations] directive.