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
@jsh9 I don't think those check the exception types. For example, if I have a function like this, which sometimes raises a ValueError, but incorrectly document that it raises a ZeroDivisionError, darglint will report the problem while pydoclint won't:
def_str_to_bool(informal_bool: str) ->bool:
""" Translate a commonly used boolean ``str`` into a real ``bool``. Args: informal_bool: A boolean represented as ``str``, like ``"true"``, ``"no"``, ``"off"``, etc. Returns: ``True`` or ``False`` to match the intent of ``informal_bool``. Raises: ZeroDivisionError: This doesn't look like enough like a ``bool`` to translate. """ifinformal_bool.lower() in ('true', 't', 'yes', 'y', 'on', '1'):
returnTrueifinformal_bool.lower() in ('false', 'f', 'no', 'n', 'off', '0'):
returnFalseraiseValueError(f"{informal_bool} doesn't look like a boolean") # pragma: no cover
$ darglint nt2
nt2/casters.py:_str_to_bool:29: DAR401: -r ValueError
nt2/casters.py:_str_to_bool:39: DAR402: +r ZeroDivisionError
$ pydoclint nt2
Loading config from user-specified .toml file: pyproject.toml
No config found in pyproject.toml.
Skipping files that match this pattern: \.git|\.tox
nt2/__init__.py
nt2/casters.py
nt2/converters.py
nt2/dumpers.py
nt2/ui.py
nt2/yamlpath_tools.py
🎉 No violations 🎉
The text was updated successfully, but these errors were encountered:
This is mentioned in: astral-sh/ruff#458 (comment)
The text was updated successfully, but these errors were encountered: