You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# repro_DOC.pydefmy_func(arg: int) ->int:
"""Doer of things. Args: arg (int): The number to be doubled. Returns: int: The doubled number. Raises: TypeError: If arg cannot be multiplied by 2. """try:
returnarg*2exceptTypeError:
print("arg should be an integer")
raise
pydoclint correctly detects the exception is re-reraised:
$ pydoclint --style=google repro_DOC.pyLoading config from user-specified .toml file: pyproject.tomlNo config found in pyproject.toml.Skipping files that match this pattern: \.git|\.toxrepro_DOC.py🎉 No violations 🎉
Ruff does not
$ ruff check --select DOC repro_DOC.pyrepro_DOC.py:12:1: DOC502 Raised exception is not explicitly raised: `TypeError` | 7 | arg (int): The number to be doubled. 8 | 9 | / Raises:10 | | TypeError: If arg cannot be multiplied by 2.11 | | """ | |____^ DOC50212 | try:13 | return arg * 2 |
The text was updated successfully, but these errors were encountered:
edgarrmondragon
changed the title
[pydoclint
[pydoclint] DOC502 should detect re-raised exceptions
Aug 2, 2024
Consider
pydoclint
correctly detects the exception is re-reraised:Ruff does not
The text was updated successfully, but these errors were encountered: