github astral-sh/ruff 0.9.4

14 hours ago

Release Notes

Preview features

  • [airflow] Extend airflow context parameter check for BaseOperator.execute (AIR302) (#15713)
  • [airflow] Update AIR302 to check for deprecated context keys (#15144)
  • [flake8-bandit] Permit suspicious imports within stub files (S4) (#15822)
  • [pylint] Do not trigger PLR6201 on empty collections (#15732)
  • [refurb] Do not emit diagnostic when loop variables are used outside loop body (FURB122) (#15757)
  • [ruff] Add support for more re patterns (RUF055) (#15764)
  • [ruff] Check for shadowed map before suggesting fix (RUF058) (#15790)
  • [ruff] Do not emit diagnostic when all arguments to zip() are variadic (RUF058) (#15744)
  • [ruff] Parenthesize fix when argument spans multiple lines for unnecessary-round (RUF057) (#15703)

Rule changes

  • Preserve quote style in generated code (#15726, #15778, #15794)
  • [flake8-bugbear] Exempt NewType calls where the original type is immutable (B008) (#15765)
  • [pylint] Honor banned top-level imports by TID253 in PLC0415. (#15628)
  • [pyupgrade] Ignore is_typeddict and TypedDict for deprecated-import (UP035) (#15800)

CLI

  • Fix formatter warning message for flake8-quotes option (#15788)
  • Implement tab autocomplete for ruff config (#15603)

Bug fixes

  • [flake8-comprehensions] Do not emit unnecessary-map diagnostic when lambda has different arity (C417) (#15802)
  • [flake8-comprehensions] Parenthesize sorted when needed for unnecessary-call-around-sorted (C413) (#15825)
  • [pyupgrade] Handle end-of-line comments for quoted-annotation (UP037) (#15824)

Documentation

  • Add missing config docstrings (#15803)
  • Add references to trio.run_process and anyio.run_process (#15761)
  • Use uv init --lib in tutorial (#15718)

Contributors

Install ruff 0.9.4

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.9.4/ruff-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.9.4/ruff-installer.ps1 | iex"

Download ruff 0.9.4

File Platform Checksum
ruff-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ruff-x86_64-apple-darwin.tar.gz Intel macOS checksum
ruff-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ruff-i686-pc-windows-msvc.zip x86 Windows checksum
ruff-x86_64-pc-windows-msvc.zip x64 Windows checksum
ruff-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
ruff-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
ruff-powerpc64-unknown-linux-gnu.tar.gz PPC64 Linux checksum
ruff-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
ruff-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
ruff-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum
ruff-armv7-unknown-linux-gnueabihf.tar.gz ARMv7 Linux checksum
ruff-aarch64-unknown-linux-musl.tar.gz ARM64 MUSL Linux checksum
ruff-i686-unknown-linux-musl.tar.gz x86 MUSL Linux checksum
ruff-x86_64-unknown-linux-musl.tar.gz x64 MUSL Linux checksum
ruff-arm-unknown-linux-musleabihf.tar.gz ARMv6 MUSL Linux (Hardfloat) checksum
ruff-armv7-unknown-linux-musleabihf.tar.gz ARMv7 MUSL Linux checksum

Don't miss a new ruff release

NewReleases is sending notifications on new releases.