github astral-sh/ruff 0.5.0

3 days ago

Release Notes

Check out the blog post for a migration guide and overview of the changes!

Breaking changes

See also, the "Remapped rules" section which may result in disabled rules.

  • Follow the XDG specification to discover user-level configurations on macOS (same as on other Unix platforms)
  • Selecting ALL now excludes deprecated rules
  • The released archives now include an extra level of nesting, which can be removed with --strip-components=1 when untarring.
  • The release artifact's file name no longer includes the version tag. This enables users to install via /latest URLs on GitHub.
  • The diagnostic ranges for some flake8-bandit rules were modified (#10667).

Deprecations

The following rules are now deprecated:

Remapped rules

The following rules have been remapped to new rule codes:

Stabilization

The following rules have been stabilized and are no longer in preview:

The following behaviors have been stabilized:

Removals

The following deprecated settings have been removed:

  • output-format=text; use output-format=concise or output-format=full
  • tab-size; use indent-width

The following deprecated CLI options have been removed:

  • --show-source; use --output-format=full
  • --no-show-source; use --output-format=concise

The following deprecated CLI commands have been removed:

  • ruff <path>; use ruff check <path>
  • ruff --clean; use ruff clean
  • ruff --generate-shell-completion; use ruff generate-shell-completion

Preview features

  • [ruff] Add assert-with-print-message rule (#11981)

CLI

  • Use rule name rather than message in --statistics (#11697)
  • Use the output format full by default (#12010)
  • Don't log syntax errors to the console (#11902)

Rule changes

  • [ruff] Fix false positives if gettext is imported using an alias (RUF027) (#12025)
  • [numpy] Update trapz and in1d deprecation (NPY201) (#11948)
  • [flake8-bandit] Modify diagnostic ranges for shell-related rules (#10667)

Server

  • Closing an untitled, unsaved notebook document no longer throws an error (#11942)
  • Support the usage of tildes and environment variables in logFile (#11945)
  • Add option to configure whether to show syntax errors (#12059)

Bug fixes

  • [pycodestyle] Avoid E203 for f-string debug expression (#12024)
  • [pep8-naming] Match import-name ignores against both name and alias (N812, N817) (#12033)
  • [pyflakes] Detect assignments that shadow definitions (F811) (#11961)

Parser

  • Emit a syntax error for an empty type parameter list (#12030)
  • Avoid consuming the newline for unterminated strings (#12067)
  • Do not include the newline in the unterminated string range (#12017)
  • Use the correct range to highlight line continuation errors (#12016)
  • Consider 2-character EOL before line continuations (#12035)
  • Consider line continuation character for re-lexing (#12008)

Other changes

  • Upgrade the Unicode table used for measuring the line-length (#11194)
  • Remove the deprecation error message for the nursery selector (#10172)

Contributors

Install ruff 0.5.0

Install prebuilt binaries via shell script

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

Install prebuilt binaries via powershell script

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

Download ruff 0.5.0

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.