ruff/crates/ruff_linter/resources/test/fixtures
Roman Kitaev b0f01ba514
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-instrumented (push) Blocked by required conditions
CI / benchmarks-walltime (push) Blocked by required conditions
[ty Playground] Release / publish (push) Waiting to run
[flake8-blind-except] Change BLE001 to correctly parse exception tuples (#19747)
## Summary

This PR enhances the `BLE001` rule to correctly detect blind exception
handling in tuple exceptions. Previously, the rule only checked single
exception types, but Python allows catching multiple exceptions using
tuples like `except (Exception, ValueError):`.

## Test Plan

It fails the following (whereas the main branch does not):

```bash
cargo run -p ruff -- check somefile.py --no-cache --select=BLE001
```

```python
# somefile.py

try:
    1/0
except (ValueError, Exception) as e:
    print(e)
```

```
somefile.py:3:21: BLE001 Do not catch blind exception: `Exception`
  |
1 | try:
2 |     1/0
3 | except (ValueError, Exception) as e:
  |                     ^^^^^^^^^ BLE001
4 |     print(e)
  |

Found 1 error.
```
2025-08-04 21:12:45 +00:00
..
airflow [airflow] Add unsafe fix for module moved cases (AIR312) (#18363) 2025-05-30 09:36:20 -04:00
control-flow-graph
eradicate Don't flag pyrefly pragmas as unused code (ERA001) (#19731) 2025-08-04 10:15:37 +02:00
fastapi [fastapi] Avoid false positive for class dependencies (FAST003) (#18271) 2025-06-02 14:34:50 -04:00
filesystem
flake8_2020
flake8_annotations
flake8_async [flake8-async] Mark autofix for ASYNC115 as unsafe if the call expression contains comments (#18753) 2025-06-19 13:01:33 +02:00
flake8_bandit Disallow implicit concatenation of t-strings and other string types (#19485) 2025-07-27 12:41:03 +00:00
flake8_blind_except [flake8-blind-except] Change BLE001 to correctly parse exception tuples (#19747) 2025-08-04 21:12:45 +00:00
flake8_boolean_trap
flake8_bugbear [flake8-bugbear] Fix B017 false negatives for keyword exception arguments (#19217) 2025-07-11 16:43:09 +00:00
flake8_builtins [flake8-builtins] Ignore variables matching module attribute names (A001) (#16454) 2025-03-03 11:10:23 +01:00
flake8_commas [flake8-commas] Add support for trailing comma checks in type parameter lists (COM812,COM819) (#19390) 2025-07-28 10:53:04 -04:00
flake8_comprehensions [flake8-comprehensions] Fix C420 to prepend whitespace when needed (#18616) 2025-06-30 12:38:26 -04:00
flake8_datetimez [flake8-datetime] Ignore .replace() calls while looking for .astimezone (#16050) 2025-02-09 15:48:59 +00:00
flake8_debugger [flake8-debugger] Also flag sys.breakpointhook and sys.__breakpointhook__ (T100) (#16191) 2025-02-16 14:50:16 -05:00
flake8_django [flake8_django] Fix DJ008 false positive for abstract models with type-annotated abstract field (#19221) 2025-07-11 16:50:59 +00:00
flake8_errmsg [flake8-errmsg] Exclude typing.cast from EM101 (#19656) 2025-08-01 13:37:44 -04:00
flake8_executable [flake8-executable] Allow uvx in shebang line (EXE003) (#18967) 2025-06-30 09:38:18 -04:00
flake8_fixme
flake8_future_annotations
flake8_gettext Add t-string fixtures for rules that do not need to be modified (#19146) 2025-07-14 09:46:31 -05:00
flake8_implicit_str_concat Add Autofix for ISC003 (#18256) 2025-05-28 09:30:51 +02:00
flake8_import_conventions [flake8-import-conventions] Add import numpy.typing as npt to default flake8-import-conventions.aliases (#17133) 2025-04-02 09:25:46 +02:00
flake8_logging [flake8-logging] Avoid false positive for exc_info=True outside logger.exception (LOG014) (#18737) 2025-06-20 14:43:08 -04:00
flake8_logging_format Add t-string fixtures for rules that do not need to be modified (#19146) 2025-07-14 09:46:31 -05:00
flake8_no_pep420
flake8_pie Fix F701 to F707 errors in tests (#19125) 2025-07-04 13:43:18 -05:00
flake8_print
flake8_pyi [flake8-pyi] Preserve inline comment in ellipsis removal (PYI013) (#19399) 2025-07-29 15:06:04 -04:00
flake8_pytest_style Add t-string fixtures for rules that do not need to be modified (#19146) 2025-07-14 09:46:31 -05:00
flake8_quotes Implement template strings (#17851) 2025-05-30 15:00:56 -05:00
flake8_raise [flake8-raise] Make fix unsafe if it deletes comments (RSE102) (#18788) 2025-06-21 19:09:40 +02:00
flake8_return [flake8-return] Fix false-positive for variables used inside nested functions in RET504 (#18433) 2025-07-10 16:10:22 -04:00
flake8_self [flake8-self] Ignore attribute accesses on instance-like variables (SLF001) (#16149) 2025-02-23 10:00:49 +00:00
flake8_simplify [flake8-simplify] Fix raw string handling in SIM905 for embedded quotes (#19591) 2025-08-03 11:31:28 -05:00
flake8_slots
flake8_tidy_imports
flake8_todos
flake8_type_checking [flake8-type-checking, pyupgrade, ruff] Add from __future__ import annotations when it would allow new fixes (TC001, TC002, TC003, UP037, RUF013) (#19100) 2025-07-16 08:50:52 -04:00
flake8_unused_arguments Add t-string fixtures for rules that do not need to be modified (#19146) 2025-07-14 09:46:31 -05:00
flake8_use_pathlib [flake8-use-pathlib] Expand PTH201 to check all PurePath subclasses (#19440) 2025-07-31 22:18:07 -04:00
flynt
isort fix missing-required-imports introducing syntax error after dosctring ending with backslash (#19505) 2025-07-30 12:12:46 -04:00
mccabe
numpy
pandas_vet
pep8_naming [pep8-naming] Fix N802 false positives for CGIHTTPRequestHandler and SimpleHTTPRequestHandler (#19432) 2025-07-23 12:04:11 -04:00
perflint [perflint] Ignore rule if target is global or nonlocal (PERF401) (#19539) 2025-07-28 17:03:22 -04:00
pycodestyle [pycodestyle] Handle brace escapes for t-strings in logical lines (#19358) 2025-07-15 14:48:48 +00:00
pydoclint
pydocstyle [pydoclint] Fix SyntaxError from fixes with line continuations (D201, D202) (#19246) 2025-07-14 13:31:36 -04:00
pyflakes [pyflakes] Mark F504/F522/F523 autofix as unsafe if there's a call with side effect (#18839) 2025-06-26 08:48:29 +00:00
pygrep_hooks [pygrep_hooks] Add AsyncMock methods to invalid-mock-access (PGH005) (#18547) 2025-06-24 17:27:21 -04:00
pylint [pylint] Handle empty comments after line continuation (PLR2044) (#19405) 2025-07-23 11:56:49 -04:00
pyupgrade [pyupgrade] Fix UP030 to avoid modifying double curly braces in format strings (#19378) 2025-07-29 18:35:54 +00:00
refurb [refurb] Mark int and bool cases for Decimal.from_float as safe fixes in FURB164 tests (#19468) 2025-07-28 14:21:38 +00:00
ruff [ruff] Parenthesize generator expressions in f-strings (RUF010) (#19434) 2025-07-30 15:02:31 +00:00
syntax_errors [semantic-syntax-tests] Add test fixtures for AwaitOutsideAsyncFunction (#17785) 2025-05-05 14:02:06 -04:00
tryceratops
__init__.py