Highlighting for unhandled exceptions from docstrings #12628
Labels
docstring
Related to docstring linting or formatting
type-inference
Requires more advanced type inference.
Thanks for your work and the awesome tool ❤️
Problem
Some docstring formats support raise blocks for describing potential exceptions a function may throw. However, neither LSP (pyright) nor IDEs (PyCharm) can suggest handling these exceptions when a function is called. This limitation often leads to two bad practices:
except Exception
block, which can mask specific issues and make debugging more difficult.Is it possible to create a rule for highlighting unhandled exceptions? Most related feature in PHP Storm - https://blog.jetbrains.com/phpstorm/2017/11/bring-exceptions-under-control/#unhandled-exception
But there can be problem (may be, I didn't read a whole ruff code to understand how parser and semantic work):
Also there could be cases when we use
assert
statements without docstring, likeIs it possible to implement such a rule at all? Because my concern is that is job for LSP, not for linter.
Possible limitations
requests
.The text was updated successfully, but these errors were encountered: