Skip to content

Commit 9aa4123

Browse files
committed
Special case args and kwargs in numpy/google arg list
1 parent 8a7ed3c commit 9aa4123

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

flake8_rst_docstrings.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,28 @@ def run(self):
10901090
assert 0 < code < 100, code
10911091
code += 100 * rst_error.level
10921092
msg = "%s%03i %s" % (rst_prefix, code, msg)
1093+
if code == 213:
1094+
if "\nArgs:\n" in unindented and unindented.find(
1095+
"\nArgs:\n"
1096+
) < unindented.find(" *args:"):
1097+
# Ignore special case used in Google docstring style
1098+
continue
1099+
if "\nParameters\n----------\n" in unindented and unindented.find(
1100+
"\nParameters\n----------\n"
1101+
) < unindented.find("\n*args\n"):
1102+
# Ignore special case used in NumPy docstring style
1103+
continue
1104+
if code == 210:
1105+
if "\nArgs:\n" in unindented and unindented.find(
1106+
"\nArgs:\n"
1107+
) < unindented.find(" **kwargs:"):
1108+
# Ignore special case used in Google docstring style
1109+
continue
1110+
if "\nParameters\n----------\n" in unindented and unindented.find(
1111+
"\nParameters\n----------\n"
1112+
) < unindented.find("\n**kwargs\n"):
1113+
# Ignore special case used in NumPy docstring style
1114+
continue
10931115

10941116
# This will return the line number by combining the
10951117
# start of the docstring with the offet within it.

0 commit comments

Comments
 (0)