Skip to content

Commit 4afc97f

Browse files
committed
refactor: Don't mistakenly return a 'missing annotation' error
1 parent 8931df8 commit 4afc97f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/pytkdocs/parsers/docstrings/google.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,12 @@ def _parse_parameters_section(self, lines: List[str], start_index: int) -> Tuple
264264
try:
265265
signature_param = self.context["signature"].parameters[name.lstrip("*")] # type: ignore
266266
except (AttributeError, KeyError):
267-
self.error(f"No type annotation for parameter '{name}'")
267+
if annotation is empty:
268+
self.error(f"No type annotation for parameter '{name}'")
268269
else:
269-
# If signature_param.X are empty it doesnt matter as defaults are empty anyway
270270
if annotation is empty:
271271
annotation = signature_param.annotation
272+
# If signature_param.X are empty it doesnt matter as defaults are empty anyway
272273
default = signature_param.default
273274
kind = signature_param.kind
274275

0 commit comments

Comments
 (0)