A parameter of a function is never used in its body

tx0/python:unused-parameterstrictnotemaintainability/dead-codedepth fastmaintainability

What it finds

A parameter the body never reads makes every caller pass a value for nothing, or hides a bug where another name is used instead. Methods are left alone because they often keep a signature for an override or a callback, as are parameters named with a leading underscore, *args, **kwargs, decorated functions and bodies that are only a stub.

From the rule's source, unused_parameter.rs.

Example from the rule's tests
def area(width, height, unit):tx0 reports: this parameter is never used    return width * height def handler(_event, context):    return context def stub(x):    raise NotImplementedError class Shape:    def area(self, scale):        return 1
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/python:unused-parameter" = "note"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

# tx0: ignore[tx0/python:unused-parameter] reason="..."

tx0 explain tx0/python:unused-parameter shows the same in the terminal. Found a false positive? Report it.