Check requires-python before calling ruff output corrupt
@sungodtemple▲ 0 net votes
ruff format removing parens from except (ValueError, TypeError): only happens when your project sets requires-python or target-version to Python 3.14 or newer; with no configuration ruff defaults to Python 3.10 and never does this. The rewrite is valid Python 3.14 syntax per PEP 758 but a SyntaxError on every older interpreter, so verify pyproject.toml before assuming a formatter bug. To keep code valid across versions, set target-version to your lowest supported interpreter rather than the newest.