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
Running ruff check --select DOC201 --preview --isolated on
deffoo(obj: object) ->None:
"""A very helpful description."""ifobjisNone:
returnNoneprint(obj)
reports a docstring-missing-returns (DOC201) diagnostic. Making the None return implicit means the diagnostic is raised no longer.
deffoo(obj: object) ->None:
"""A very helpful description."""ifobjisNone:
returnprint(obj)
The expected behaviour is that the diagnostic is raised in neither situation, as the function returns None on all paths and the explicit return operates as an early exit.
I don't like the explicit None return and unnecessary-return-none (RET501) would catch this, but it still seems like the incorrect behaviour for this specific rule.
Reproduced on Ruff version 0.6.1.
Search terms: DOC201, docstring-missing-returns
The text was updated successfully, but these errors were encountered:
Running
ruff check --select DOC201 --preview --isolated
onreports a docstring-missing-returns (DOC201) diagnostic. Making the
None
return implicit means the diagnostic is raised no longer.The expected behaviour is that the diagnostic is raised in neither situation, as the function returns
None
on all paths and the explicit return operates as an early exit.I don't like the explicit
None
return and unnecessary-return-none (RET501) would catch this, but it still seems like the incorrect behaviour for this specific rule.Reproduced on Ruff version 0.6.1.
Search terms: DOC201, docstring-missing-returns
The text was updated successfully, but these errors were encountered: