Currently the option -scr works as follows:
- --skip-checking-raises (shortform: -scr, default: False)
If True, pydoclint won’t report DOC501 or DOC502 if there are raise statements in the function/method but there aren’t any “raises” sections in the docstring (or vice versa).
The vice versa part means that
def my_func():
"""Simple func
Raises:
Exception: underlying function might raise
"""
might_raise_exception()
the above will fail pydoclint with skip-checking-raises=false.
I understand that pydoclint doesn't want to add dynamic or dynamic-ish checks to keep performance, so its unlikely for a feature like "capture all possible exceptions from the source code up and force documentation" to exist, however with the all or nothing approach, -scr option somewhat disincentivizes documenting pass-through exceptions as it would require wrapping logic in try-except-raise.
It would be nice to allow a one way option, where pydoclint forces you to document exceptions you raise in the body, but also allows you to mention any other exception.
Currently the option
-scrworks as follows:The
vice versapart means thatthe above will fail
pydoclintwithskip-checking-raises=false.I understand that
pydoclintdoesn't want to add dynamic or dynamic-ish checks to keep performance, so its unlikely for a feature like "capture all possible exceptions from the source code up and force documentation" to exist, however with the all or nothing approach,-scroption somewhat disincentivizes documenting pass-through exceptions as it would require wrapping logic in try-except-raise.It would be nice to allow a one way option, where
pydoclintforces you to document exceptions you raise in the body, but also allows you to mention any other exception.