Skip to content

pydocstring extra-arguments lint rule #20346

@blackmad-cradle

Description

@blackmad-cradle

Summary

I noticed when adding in pydocstring lint rules that ruff doesn't have a rule to warn when there's an argument definition in a docstring that isn't in the function parameters. This would be good to have when refactoring code.

Here's a minimal repro with the pydocstring rules turned on: https://play.ruff.rs/0f9db152-4bdf-4c4f-a4e9-8b3ccba1848c

I couldn't find another issue tracking this, so I'm starting a new one. If this is a dupe, apologies.

`"""example."""
def fibonacci(n):
"""Compute the nth number in the Fibonacci sequence.

Args:
n: number
x: extra arg
"""
pass`

I would like/expect to see an error for "x: extra arg"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions