pdoc3 / pdoc

:snake: :arrow_right: :scroll: Auto-generate API documentation for Python projects
https://pdoc3.github.io/pdoc/
GNU Affero General Public License v3.0
1.14k stars 146 forks source link

Upgrade code reference warnings to errors. #420

Open cchudant opened 1 year ago

cchudant commented 1 year ago

Expected Behavior

I don't know if it's "expected" behavior per say, of feature/change request.

I'd like a way to have ReferenceWarning: Code reference mymodule.erroneous_reference in module "mymodule" does not match any documented object. be an error, so that my CI action catches this sort of problem.

Currently, it seems only import errors are considered "errors", as per --skip-error. I would expect that erroneous references should be errors as well, that can be downgraded to warning using --skip-error.

I can do a quick PR if that's ok with you :)

Actual Behavior

def test() -> "mymodule.erroneous_reference":
  pass

or

def test():
    """Hello world

    Returns:
        mymodule.erroneous_reference
    """
    pass

gives ReferenceWarning: Code reference mymodule.erroneous_reference in module "mymodule" does not match any documented object.

which is a warning, regardless if skip-errors is set.

Steps to Reproduce

def test() -> "mymodule.erroneous_reference":
  pass

Additional info

ERosendo commented 4 months ago

@kernc is Anyone working on a fix for this yet? I'd be happy to take a look.