astral-sh / astral-sh/ruff

Consider extending `suppressible-exception` (`SIM105`) to multi-line `try` blocks

Open
#8,593 9 comments 4 reactions 0 assignees View on GitHub
needs-decision rule
Dominant language
Rust
Stars
49.6k
Forks
2.4k
Avg merge
2d 1h
Merged PRs (30d)
458

Description

```py
try: # error
...
except Exception:
pass

try: # no error
...
...
except Exception:
pass
```
[playground](https://play.ruff.rs/0ae2bc17-7268-450b-b602-298728301078)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two examples in the linked Ruff playground and inspect how SIM105 currently treats each try block. Determine the intended distinction between the one-line and multi-line cases, then add coverage for the agreed behavior and verify the linter output; the issue does not name source files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
devtools, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.