astral-sh
ruff
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
[ty] Clear failed call inference mappings
RasmusNygren:fix-callable-constraint-solving
16 minutes ago
support full-scope bidirectional inference for non-empty collection literals
ibraheem/full-scope-bidi-non-empty
36 minutes ago
[`ruff`] Add `fallible-context-manager` (`RUF075`) (#22844) ## Summary Adds a new rule `RUF075` (preview) that detects `@contextlib.contextmanager` and `@contextlib.asynccontextmanager` decorated functions where `yield` is not protected against exceptions. Closes #15629. ## Details When a context manager yields without exception protection, cleanup code after `yield` won't run if an exception is raised inside the `with` block. ```python # Bad - cleanup won't run on exception @contextmanager def bad(): print("setup") yield print("cleanup") # never runs if exception raised # Good @contextmanager def good(): print("setup") try: yield finally: print("cleanup") # always runs ``` The rule does **not** flag: - Yields inside `try` blocks that have a `finally` or `except` handler - Yields as the last statement of a `with` block (cleanup is delegated to `__exit__`) - Yields in terminal position (last statement in the function body, or immediately before a `return`), where there is no trailing cleanup that could be skipped Terminal position is inherited through `if` / `for` / `while` / `match` branches: a yield that is the last statement of a branch is terminal only when the enclosing statement is itself terminal. The rule is in preview mode. ## Test Plan Tests live in `crates/ruff_linter/resources/mdtest/ruff.md` and are run via: ```sh cargo nextest run -p ruff_mdtest -- mdtest::ruff ```
main
51 minutes ago
[ruff] refactor
anishgirianish:add-rule-b036
1 hour ago
full-scope bidirectional inference for unannotated container literals
ibraheem/full-scope-bidi
2 hours ago
[ruff]: fix false positive
anishgirianish:add-rule-b036
2 hours ago
wip
ibraheem/extended-bidi
3 hours ago
[ruff] : fix formatting
anishgirianish:add-rule-b036
3 hours ago
Latest Branches
CodSpeed Performance Gauge
0%
[ty] Use variance-aware constraint solving for a subset of callables
#25184
27 minutes ago
5844a6a
RasmusNygren:fix-callable-constraint-solving
CodSpeed Performance Gauge
0%
[ty] Full-scope bidirectional inference for non-empty collection literals
#25280
48 minutes ago
f00d05b
ibraheem/full-scope-bidi-non-empty
CodSpeed Performance Gauge
0%
[`ruff`] Add `fallible-context-manager` (`RUF075`)
#22844
1 hour ago
161854e
anishgirianish:add-rule-b036
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs