Skip to content

Commit

Permalink
Fix D417 false positive (#3596)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanPlasse committed Mar 18, 2023
1 parent 16a350c commit c21eb06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions crates/ruff/resources/test/fixtures/pydocstyle/D417.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,13 @@ def f(x, *args, **kwargs):
**kwargs: keyword arguments
"""
return x


class Test:
def f(self, /, arg1: int) -> None:
"""
Some beauty description.
Args:
arg1: some description of arg
"""
4 changes: 2 additions & 2 deletions crates/ruff/src/rules/pydocstyle/rules/sections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,9 @@ fn missing_args(checker: &mut Checker, docstring: &Docstring, docstrings_args: &
// Look for arguments that weren't included in the docstring.
let mut missing_arg_names: FxHashSet<String> = FxHashSet::default();
for arg in arguments
.args
.posonlyargs
.iter()
.chain(arguments.posonlyargs.iter())
.chain(arguments.args.iter())
.chain(arguments.kwonlyargs.iter())
.skip(
// If this is a non-static method, skip `cls` or `self`.
Expand Down

0 comments on commit c21eb06

Please sign in to comment.