@@ -615,10 +615,14 @@ def _check_numpydoc_style(obj, doc):
615615 pass
616616 elif inspect .isfunction (obj ):
617617 # Specialized checks for functions
618- def _check_param (param , empty_ok = False , noname_ok = False ):
618+ def _check_param (param , empty_ok = False , noname_ok = False , section = "??" ):
619619 param_desc = "\n " .join (param .desc )
620620 param_name = f"{ name } '{ param .name } '"
621621
622+ # Check for empty section
623+ if param .name == "" and param .type == '' :
624+ _fail (f"Empty { section } section in { name } " )
625+
622626 # Make sure we have a name and description
623627 if param .name == "" and not noname_ok :
624628 _fail (f"{ param_name } has improperly formatted parameter" )
@@ -636,11 +640,13 @@ def _check_param(param, empty_ok=False, noname_ok=False):
636640 _warn (f"{ param_name } description starts with lower case letter" )
637641
638642 for param in doc ["Parameters" ] + doc ["Other Parameters" ]:
639- _check_param (param )
643+ _check_param (param , section = "Parameters" )
640644 for param in doc ["Returns" ]:
641- _check_param (param , empty_ok = True , noname_ok = True )
645+ _check_param (
646+ param , empty_ok = True , noname_ok = True , section = "Returns" )
642647 for param in doc ["Yields" ]:
643- _check_param (param , empty_ok = True , noname_ok = True )
648+ _check_param (
649+ param , empty_ok = True , noname_ok = True , section = "Yields" )
644650 else :
645651 raise TypeError ("unknown object type for {obj}" )
646652
0 commit comments