Change8

0.9.7

📦 ruffView on GitHub →
12 features🐛 13 fixes🔧 26 symbols

Summary

Ruff 0.9.7 introduces several preview features, new linting rules, and improvements to the language server and CLI, while fixing numerous bugs across multiple plugins and the formatter.

✨ New Features

  • Consider `__new__` methods as special function type for enforcing class method or static method rules (preview).
  • Airflow: Improve internal logic to differentiate deprecated symbols (`AIR303`).
  • Refurb: Manual timezone monkeypatching (`FURB162`).
  • Ruff: Implicit class variable in dataclass (`RUF045`).
  • Ruff: Skip singleton starred expressions for incorrectly-parenthesized-tuple-in-subscript (`RUF031`).
  • Refurb: Check for subclasses includes subscript expressions (`FURB189`).
  • Flake8-debugger: Also flag `sys.breakpointhook` and `sys.__breakpointhook__` (`T100`).
  • Pycodestyle: Exempt `site.addsitedir(...)` calls (`E402`).
  • Server: Include document‑specific debug info for `ruff.printDebugInformation`.
  • Server: Return the debug info as a string with `ruff.printDebugInformation`.
  • CLI: Warn on invalid `noqa` even when there are no diagnostics.
  • CLI: Provide better error messages while loading configuration `extend`s.

🐛 Bug Fixes

  • Fix unstable formatting of trailing end-of-line comments of parenthesized attribute values.
  • Fix handling of requests received after shutdown message.
  • Ignore `source.organizeImports.ruff` and `source.fixAll.ruff` code actions for a notebook cell.
  • Flake8-comprehensions: Handle trailing comma in `C403` fix.
  • Flake8-pyi: Avoid flagging `custom-typevar-for-self` on metaclass methods (`PYI019`).
  • Pydocstyle: Handle arguments with the same names as sections (`D417`).
  • Pylint: Correct ordering of arguments in fix for `if-stmt-min-max` (`PLR1730`).
  • Pylint: Do not offer fix for raw strings (`PLE251`).
  • Pyupgrade: Do not upgrade functional `TypedDicts` with private field names to the class‑based syntax (`UP013`).
  • Pyupgrade: Handle micro version numbers correctly (`UP036`).
  • Pyupgrade: Unwrap unary expressions correctly (`UP018`).
  • Refurb: Correctly handle lengths of literal strings in `slice-to-remove-prefix-or-suffix` (`FURB188`).
  • Ruff: Skip `RUF001` diagnostics when visiting string type definitions.

🔧 Affected Symbols

__new__AIR303FURB162RUF045RUF031FURB189sys.breakpointhooksys.__breakpointhook__T100site.addsitedirE402C403PYI019D417PLR1730PLE251UP013UP036UP018FURB188RUF001source.organizeImports.ruffsource.fixAll.ruffruff.printDebugInformationnoqaextend