pdoc
pdoc copied to clipboard
Unable to get argument checking to work?
Pdoc3's homepage indicates the argument checking works.
I took this function:
def mdy_to_ymd_str(mdy):
"""
Convert from mm/dd/yyyy datetime date string to a yyyy-mm-dd string.
Args:
mdy: The DateTime date string (%m-%d-%Y)
Returns:
datetime string in yyyy-mm-dd format
>>> import datetime
>>> test = datetime.datetime(2018,1,1).strftime("%m-%d-%Y")
>>> mdy_to_ymd_str(test)
'2018-01-01'
"""
return datetime.datetime.strptime(mdy, "%m-%d-%Y").strftime("%Y-%m-%d")
and changed the definition to:
def mdy_to_ymd_str(mdy22):
And I did not receive any errors or warnings on the console when I ran pdoc3?
Am I misunderstanding how this should work?
Expected Behavior
mdy22 should be shown to be in conflict with the arguments declared for the function.
Actual Behavior
No warning, error, or other prompting indicating an conflict existed. pdoc3 build the HTML and seems to have just accepted the change without issue.
Steps to Reproduce
- Alter the definition of a function, ensuring it's conflicting with the args declaration
- run pdoc3
- Profit? By changing all the definition headers, and selling our services to restore said applications to functionality.
Additional info
- pdoc version: pdoc3.exe 0.6.3
Currently, only backticked references (i.e. `package.module.identifier`) are checked. :thinking:
Checking arguments in docstrings' Args sections certainly would make an interesting addition. :+1:
Care enough to have a go at it?