pdoc3 / pdoc3/pdoc

Unable to get argument checking to work?

Open
#107 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.2k
Forks
146
PR merge metrics
No merged PRs in 30d

Description

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
  1. Alter the definition of a function, ensuring it's conflicting with the args declaration
  2. run pdoc3
  3. 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with the mdy_to_ymd_str function and its Args docstring using the pdoc3 command-line entry point. Compare the homepage's argument-checking description with pdoc version 0.6.3; done means a conflicting parameter name is reported or the documented behavior is clarified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.