Change8

0.12.2

📦 ruffView on GitHub →
2 features🐛 10 fixes🔧 21 symbols

Summary

Ruff 0.12.2 introduces preview features for flake8-pyi and pyupgrade, adds several rule adjustments, and includes numerous bug fixes and documentation updates.

✨ New Features

  • Expand Optional[A] to A | None in flake8-pyi (PYI016).
  • Mark UP008 fix safe in pyupgrade when no comments are in range.

🐛 Bug Fixes

  • Fix C420 in flake8-comprehensions to prepend whitespace when needed.
  • Fix PERF403 panic on attribute or subscription loop variable in perflint.
  • Fix D413 infinite loop for parenthesized docstring in pydocstyle.
  • Fix PLW0108 autofix introducing a syntax error when the lambda's body contains an assignment expression in pylint.
  • Fix false positive on empty tuples (FURB168) in refurb.
  • Allow more field calls from attrs (RUF009) in ruff.
  • Fix syntax error introduced for an empty string followed by a u-prefixed string (UP025) in ruff.
  • Allow uvx in shebang line (EXE003) in flake8-executable.
  • Avoid flagging PD002 if pandas is not imported.
  • Avoid PEP-604 unions with typing.NamedTuple (UP007, UP045) in pyupgrade.

🔧 Affected Symbols

flake8-pyipyupgradeflake8-comprehensionsperflintpydocstylepylintrefurbruffflake8-executablepandasairflowflake8-annotationsflake8-asyncflake8-banditflake8-bugbearflake8-datetimezflake8-pytest-styleflake8-quotesflake8-simplifypyflakesimport-outside-top-level