ruff/crates
Carl Meyer d098118e37
Some checks are pending
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
[ty Playground] Release / publish (push) Waiting to run
[ty] disable division-by-zero by default (#18220)
## 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.
2025-05-20 14:47:56 -04:00
..
ruff add full option name in formatter warning (#18217) 2025-05-20 16:26:47 +02:00
ruff_annotate_snippets Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_benchmark [ty] Reduce size of the many-tuple-assignments benchmark (#18131) 2025-05-16 15:28:23 +02:00
ruff_cache Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_db Update salsa (#18212) 2025-05-20 09:19:34 +02:00
ruff_dev Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_diagnostics Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
ruff_formatter Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_graph Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_index Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_linter Remove Checker::report_diagnostics (#18206) 2025-05-20 10:00:06 -04:00
ruff_macros Unify Message variants (#18051) 2025-05-19 13:34:04 -04:00
ruff_notebook Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_options_metadata [ty] Document configuration schema (#17950) 2025-05-09 10:47:45 +02:00
ruff_python_ast Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_ast_integration_tests Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_codegen Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_formatter Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_index Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_literal Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_parser Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_resolver Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_semantic Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_stdlib Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_trivia Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_trivia_integration_tests Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_server Unify Message variants (#18051) 2025-05-19 13:34:04 -04:00
ruff_source_file Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_text_size Add rustfmt.toml file (#18197) 2025-05-19 11:40:58 -04:00
ruff_wasm Unify Message variants (#18051) 2025-05-19 13:34:04 -04:00
ruff_workspace Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ty [ty] disable division-by-zero by default (#18220) 2025-05-20 14:47:56 -04:00
ty_ide Update salsa (#18212) 2025-05-20 09:19:34 +02:00
ty_project [ty] Raise invalid-exception-caught even when exception is not captured (#18202) 2025-05-19 18:13:34 -04:00
ty_python_semantic [ty] disable division-by-zero by default (#18220) 2025-05-20 14:47:56 -04:00
ty_server [ty] Avoid panicking when there are multiple workspaces (#18151) 2025-05-20 20:53:23 +05:30
ty_test Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ty_vendored Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ty_wasm Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00