mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
## Summary I think `division-by-zero` is a low-value diagnostic in general; most real division-by-zero errors (especially those that are less obvious to the human eye) will occur on values typed as `int`, in which case we don't issue the diagnostic anyway. Mypy and pyright do not emit this diagnostic. Currently the diagnostic is prone to false positives because a) we do not silence it in unreachable code, and b) we do not implement narrowing of literals from inequality checks. We will probably fix (a) regardless, but (b) is low priority apart from division-by-zero. I think we have many more important things to do and should not allow false positives on a low-value diagnostic to be a distraction. Not opposed to re-enabling this diagnostic in future when we can prioritize reducing its false positives. References https://github.com/astral-sh/ty/issues/443 ## Test Plan Existing tests.
9 lines
213 B
TOML
9 lines
213 B
TOML
#:schema ../ty.schema.json
|
|
# Configuration overrides for the mypy primer run
|
|
|
|
# Enable off-by-default rules.
|
|
[rules]
|
|
possibly-unresolved-reference = "warn"
|
|
unused-ignore-comment = "warn"
|
|
division-by-zero = "warn"
|