Change8

0.15.6

📦 ruffView on GitHub →
16 features🐛 10 fixes🔧 4 symbols

Summary

This release introduces significant preview features focused on lazy imports, PEP 798 support, and new linter rules across several integrated tools. Numerous bug fixes address issues in the formatter and `--add-noqa` functionality.

✨ New Features

  • Added support for `lazy` import parsing.
  • Added support for star-unpacking of comprehensions (PEP 798).
  • Rejected semantic syntax errors for lazy imports.
  • Dropped a few rules from the preview default set.
  • Added `airflow` rule `AIR003` to flag `Variable.get()` calls outside of task execution context.
  • Added `airflow` rule `AIR304` to flag runtime-varying values in DAG/task constructor arguments.
  • Implemented `flake8-bugbear` rule `B043` (`delattr-with-constant`).
  • Added `flake8-tidy-imports` rule `TID254` to enforce lazy imports.
  • Added configuration option to allow users to ban lazy imports via `TID254`.
  • Added `isort` behavior to retain the `lazy` keyword when sorting imports.
  • Added `pyupgrade` fix `UP006` to automatically add `from __future__ import annotations`.
  • Added `refurb` support for the `newline` parameter in `FURB101` for Python 3.13+.
  • Added `ruff` rule `RUF071` (`os-path-commonprefix`).
  • Added unsafe fix for `ruff` rule `RUF071`.
  • Limited `ruff` rule `RUF036` to typing contexts; made it unsafe for non-typing-only contexts.
  • Used starred unpacking for `ruff` rule `RUF017` in Python 3.15+.

🐛 Bug Fixes

  • Fixed `--add-noqa` creating unwanted leading whitespace.
  • Fixed `--add-noqa` breaking shebang lines.
  • Formatter: Fixed lambda body formatting for multiline calls and subscripts.
  • Formatter: Preserved required annotation parentheses in annotated assignments.
  • Formatter: Preserved type-expression parentheses.
  • Fixed stack overflow in `flake8-annotations` rule `ANN401` on quoted annotations with escape sequences.
  • Fixed `pep8-naming` rules (`N806`, `N815`, `N816`) to check naming conventions in `match` pattern bindings.
  • Fixed comment duplication in fixes for `perflint` rules (`PERF401`, `PERF403`).
  • Fixed `pyupgrade` rule `UP008` to properly trigger `super` change in nested classes.
  • Avoided syntax errors when fixing `ruff` rule `RUF036`.

Affected Symbols