Change8

0.9.3

📦 ruffView on GitHub →
12 features🐛 9 fixes🔧 33 symbols

Summary

This release introduces several new preview features across various linters, including PEP 695 generics support and new Ruff rules. It also includes numerous bug fixes and improvements to existing rule logic, particularly around import handling and code generation.

Migration Steps

  1. If you were using the DAG argument `fail_stop`, rename it to `fail_fast`.

✨ New Features

  • ["airflow"] Argument `fail_stop` in DAG has been renamed as `fail_fast` (AIR302).
  • ["airflow"] Extend `AIR303` with more symbols.
  • ["flake8-bandit"] Report all references to suspicious functions (S3).
  • ["flake8-pytest-style"] Do not emit diagnostics for empty `for` loops (PT012, PT031).
  • ["flake8-simplify"] Avoid double negations (SIM103).
  • ["pyflakes"] Fix infinite loop with unused local import in `__init__.py` (F401).
  • ["pylint"] Do not report methods with only one `EM101`-compatible `raise` (PLR6301).
  • ["pylint"] Implement `redefined-slots-in-subclass` (W0244).
  • ["pyupgrade"] Add rules to use PEP 695 generics in classes and functions (UP046, UP047).
  • ["refurb"] Implement `for-loop-writes` (FURB122).
  • ["ruff"] Implement `needless-else` clause (RUF047).
  • ["ruff"] Implement `starmap-zip` (RUF058).

🐛 Bug Fixes

  • ["flake8-bandit"] Add missing single-line/dotall regex flag (S608).
  • ["flake8-import-conventions"] Fix infinite loop between `ICN001` and `I002` (ICN001).
  • ["flake8-simplify"] Do not emit diagnostics for expressions inside string type annotations (SIM222, SIM223).
  • ["pyflakes"] Treat arguments passed to the `default=` parameter of `TypeVar` as type expressions (F821).
  • ["pyupgrade"] Avoid syntax error when the iterable is a non-parenthesized tuple (UP028).
  • ["ruff"] Exempt `NewType` calls where the original type is immutable (RUF009).
  • Preserve raw string prefix and escapes in all codegen fixes.
  • Fix bracket spacing for single-element tuples in f-string expressions in Formatter.
  • Fix unstable f-string formatting for expressions containing a trailing comma in Formatter.

🔧 Affected Symbols

airflow.DAGflake8_bandit.S3flake8_pytest_style.PT012flake8_pytest_style.PT031flake8_simplify.SIM103pyflakes.F401pylint.EM101pylint.PLR6301pylint.W0244pyupgrade.UP046pyupgrade.UP047refurb.FURB122ruff.RUF047ruff.RUF058flake8_bugbear.B903flake8_comprehensions.C401flake8_pytest_style.PT027flake8_simplify.SIM201flake8_simplify.SIM202flake8_type_checking.TC006flake8_type_checking.TC008isort.I001pydoclint.DOCpyflakes.F811ruff.RUF055flake8_bandit.S608flake8_import_conventions.ICN001flake8_simplify.SIM222flake8_simplify.SIM223pyflakes.F821pyupgrade.UP028ruff.RUF009TypeVar.default