Change8

0.9.5

📦 ruffView on GitHub →
25 features🐛 8 fixes2 deprecations🔧 2 symbols

Summary

Ruff 0.9.5 adds numerous preview features, rule enhancements, and bug fixes while deprecating the `lint.extendIgnore` setting and ruff‑lsp related settings.

Migration Steps

  1. Update imports of `BashOperator` to `airflow.providers.standard.operators.bash.BashOperator`.
  2. Remove any usage of the now‑removed `lint.extendIgnore` configuration setting.
  3. Review and adjust `ruff-lsp` related settings according to the new deprecation warning.

✨ New Features

  • Preview: Recognize all symbols named `TYPE_CHECKING` for `in_type_checking_block`.
  • Preview: `flake8-comprehensions` now handles builtins at top of file correctly for `unnecessary-dict-comprehension-for-iterable` (C420).
  • Preview: `flake8-logging` supports `.exception()` and `exc_info=` outside exception handlers (LOG004, LOG014).
  • Preview: `flake8-pyi` fixes incorrect behaviour of `custom-typevar-return-type` preview‑mode autofix when `typing` is already imported (PYI019).
  • Preview: `flake8-pyi` improves handling of more complex cases for PYI019.
  • Preview: `flake8-pyi` makes PYI019 autofixable for `.py` files in preview mode as well as stubs.
  • Preview: `flake8-pyi` correctly removes type parameter when it is the last (PYI019).
  • Preview: `pylint` fixes missing parentheses in unsafe fix for `unnecessary-dunder-call` (PLC2801).
  • Preview: `pyupgrade` provides better messages and diagnostic range (UP015).
  • Preview: `pyupgrade` renames private type parameters in PEP 695 generics (UP049).
  • Preview: `refurb` now also reports non‑name expressions (FURB169).
  • Preview: `refurb` marks fix as unsafe if there are comments (FURB171).
  • Preview: `ruff` adds support for classes with mixed type variable style (RUF053).
  • Preview: `airflow` moves `BashOperator` to `airflow.providers.standard.operators.bash.BashOperator` (AIR302).
  • Preview: `flake8-pyi` adds autofix for unused‑private‑type‑var (PYI018).
  • Preview: `flake8-pyi` significantly improves accuracy of PYI019 when preview mode is enabled.
  • Rule change: Preserve triple quotes and prefixes for strings.
  • Rule change: `flake8-comprehensions` skips when `TypeError` present from too many (kw)args for C410, C411, and C418.
  • Rule change: `flake8-pyi` renames PYI019 and improves its diagnostic message.
  • Rule change: `pep8-naming` ignores `@override` methods (N803).
  • Rule change: `pyupgrade` reuses replacement logic from UP046 and UP047 to preserve more comments (UP040).
  • Rule change: `ruff` analyzes deferred annotations before enforcing mutable‑(data)class‑default and function‑call‑in‑dataclass‑default‑argument (RUF008, RUF009, RUF012).
  • Rule change: `pycodestyle` exempts `sys.path += ...` calls (E402).
  • Configuration: Config error only when `flake8-import-conventions` alias conflicts with `isort.required-imports` bound name.
  • Configuration: Workaround Even Better TOML crash related to `allOf`.

🐛 Bug Fixes

  • `flake8-comprehensions` now handles extraneous parentheses around list comprehension for unnecessary list comprehension rewrite (C403).
  • `flake8-comprehensions` handles trailing comma in fixes for unnecessary‑generator‑list/set (C400, C401).
  • `flake8-pyi` fixes several correctness issues with `custom-type-var-return-type` (PYI019).
  • `pep8-naming` now considers any number of leading underscores for N801.
  • `pyflakes` visits forward annotations in `TypeAliasType` as types (F401).
  • `pylint` corrects min/max auto‑fix and suggestion for PL1730.
  • `refurb` handles unparenthesized tuples correctly (FURB122, FURB142).
  • `refurb` avoids `None | None` as well as improves detection and fix (FURB168).

🔧 Affected Symbols

BashOperatorTYPE_CHECKING

⚡ Deprecations

  • Removed the non‑existing `lint.extendIgnore` editor setting.
  • Added a deprecation warning for `ruff-lsp` related settings.