Change8

0.16.1

📦 ruffView on GitHub →
5 features🐛 8 fixes🔧 13 symbols

Summary

This release introduces new preview features, bug fixes, and rule changes across various linters. It also includes improvements to the LSP server and documentation.

✨ New Features

  • Add an option to opt out of human-readable names ([#27160](https://github.com/astral-sh/ruff/pull/27160))
  • Make `flake8-pytest-style` fixes safe by default and unsafe only when comments are present (`PT018`) ([#27201](https://github.com/astral-sh/ruff/pull/27201))
  • Skip `pyupgrade` fix when a defaulted `TypeVar` precedes a non-defaulted one (`UP040`, `UP040`, `UP047`) ([#27133](https://github.com/astral-sh/ruff/pull/27133))
  • Fix false positive with unpacked arguments (`RUF065`) ([#26959](https://github.com/astral-sh/ruff/pull/26959))
  • Lint TOML files in the LSP ([#26862](https://github.com/astral-sh/ruff/pull/26862))

🐛 Bug Fixes

  • Bump `gen-lsp-types` to gracefully handle unknown enumeration values in LSP messages ([#27230](https://github.com/astral-sh/ruff/pull/27230))
  • Mark `range` as immutable (`B008`) ([#27247](https://github.com/astral-sh/ruff/pull/27247))
  • NFKC-normalize keyword names in `C408` fix ([#26813](https://github.com/astral-sh/ruff/pull/26813))
  • Fix false positive when variable is read in `finally` clause (`RET504`) ([#25441](https://github.com/astral-sh/ruff/pull/25441))
  • Skip section detection inside RST directive bodies (`D214`, `D405`, `D413`) ([#23635](https://github.com/astral-sh/ruff/pull/23635))
  • Parenthesize `yield` arguments in the `FURB192` fix ([#27192](https://github.com/astral-sh/ruff/pull/27192))
  • Fix indexing of excluded nested Ruff workspaces ([#27303](https://github.com/astral-sh/ruff/pull/27303))
  • Reduce syntax error noise by swallowing dedents like indents ([#27170](https://github.com/astral-sh/ruff/pull/27170))

Affected Symbols