ruff/changelogs/0.8.x.md

24 KiB

Changelog 0.8.x

0.8.0

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.

  • Default to Python 3.9

    Ruff now defaults to Python 3.9 instead of 3.8 if no explicit Python version is configured using ruff.target-version or project.requires-python (#13896)

  • Changed location of pydoclint diagnostics

    pydoclint diagnostics now point to the first-line of the problematic docstring. Previously, this was not the case.

    If you've opted into these preview rules but have them suppressed using noqa comments in some places, this change may mean that you need to move the noqa suppression comments. Most users should be unaffected by this change.

  • Use XDG (i.e. ~/.local/bin) instead of the Cargo home directory in the standalone installer

    Previously, Ruff's installer used $CARGO_HOME or ~/.cargo/bin for its target install directory. Now, Ruff will be installed into $XDG_BIN_HOME, $XDG_DATA_HOME/../bin, or ~/.local/bin (in that order).

    This change is only relevant to users of the standalone Ruff installer (using the shell or PowerShell script). If you installed Ruff using uv or pip, you should be unaffected.

  • Changes to the line width calculation

    Ruff now uses a new version of the unicode-width Rust crate to calculate the line width. In very rare cases, this may lead to lines containing Unicode characters being reformatted, or being considered too long when they were not before (E501).

Removed Rules

The following deprecated rules have been removed:

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:

The following fixes have been stabilized:

Preview features

  • `flake8-datetimez`
  • `flake8-pie`
  • `flake8-pyi`
  • `flake8-pyi`
  • `ruff`
  • `ruff`
  • `ruff`
  • `pycodestyle`
  • `pylint`

Rule changes

Configuration

  • Ruff now emits a warning instead of an error when a configuration ignores a rule that has been removed (#14435)
  • Ruff now validates that lint.flake8-import-conventions.aliases only uses valid module names and aliases (#14477)

0.8.1

Preview features

  • Formatter: Avoid invalid syntax for format-spec with quotes for all Python versions (#14625)
  • Formatter: Consider quotes inside format-specs when choosing the quotes for an f-string (#14493)
  • Formatter: Do not consider f-strings with escaped newlines as multiline (#14624)
  • Formatter: Fix f-string formatting in assignment statement (#14454)
  • Formatter: Fix unnecessary space around power operator (**) in overlong f-string expressions (#14489)
  • `airflow`
  • `flake8-builtins`
  • `flake8-pytest-style`
  • `flake8-type-checking`
  • `flake8-type-checking`
  • `flake8-use-pathlib`
  • `pylint`
  • `pylint`
  • `refurb`
  • `ruff`
  • `ruff`
  • `ruff`
  • `ruff`

Rule changes

  • Ignore more rules for stub files (#14541)
  • `pep8-naming`
  • `pyflakes`
  • `ruff`
  • `ruff`

Bug fixes

  • Avoid fixing code to None | None for redundant-none-literal (PYI061) and never-union (RUF020) (#14583, #14589)
  • `flake8-bugbear`
  • `flake8-pyi`, `ruff`
  • `flake8-pyi`
  • `flake8-type-checking`
  • `pylint`
  • `ruff`

0.8.2

Preview features

  • `airflow`
  • `airflow`
  • `ruff`
  • `ruff`
  • `ruff`

Rule changes

  • `airflow`
  • `flake8-pytest-style`
  • `pandas-vet`
  • `pylint`
  • `refurb`

Configuration

  • `flake8-import-conventions`

Bug fixes

  • Revert: [pyflakes] Avoid false positives in @no_type_check contexts (F821, F722) (#14615) (#14726)
  • `pep8-naming`
  • `pycodestyle`
  • `pylint`
  • `refurb`
  • `ruff`

Documentation

  • Improve docs for flake8-use-pathlib rules (#14741)
  • Improve error messages and docs for flake8-comprehensions rules (#14729)
  • `flake8-type-checking`

0.8.3

Preview features

  • Fix fstring formatting removing overlong implicit concatenated string in expression part (#14811)
  • `airflow`
  • `airflow`
  • `flake8-bugbear`
  • `flake8-bugbear`
  • `flake8-use-pathlib`
  • `pylint`
  • `ruff`
  • `ruff`
  • `ruff`
  • `ruff`
  • `ruff`

Rule changes

  • `flake8-bugbear`
  • `flake8-pyi`
  • `pyupgrade`
  • `pyupgrade`

Bug fixes

  • Raise syntax error for mixing except and except* (#14895)
  • `flake8-bugbear`
  • `flake8-bugbear`
  • `flake8-comprehensions`
  • `flake8-pyi`
  • `flake8-pytest-style`
  • `perflint`
  • `pylint`

0.8.4

Preview features

  • `airflow`
  • `airflow`
  • `flake8-use-pathlib`
  • `perflint`
  • `perflint`
  • `pylint`
  • `ruff`
  • `ruff`

Rule changes

  • `flake8-bandit`
  • `flake8-pyi`
  • `pydocstyle`
  • `ruff`

Bug

  • `perflint`

Server

  • Check diagnostic refresh support from client capability which enables dynamic configuration for various editors (#15014)

0.8.5

Preview features

  • `airflow`
  • `airflow`
  • `fastapi`
  • `flake8-type-checking`
  • `pylint`
  • `ruff`
  • `ruff`
  • `ruff`

Rule changes

  • Visit PEP 764 inline TypedDict keys as non-type-expressions (#15073)
  • `flake8-comprehensions`
  • `flake8-pie`
  • `flake8-simplify`
  • `flake8-use-pathlib`
  • `pycodestyle`
  • `pydocstyle`
  • `pyupgrade`

Configuration

  • `flake8-type-checking`
  • `pydocstyle`
  • `ruff`

Bug fixes

  • Fix type subscript on older python versions (#15090)
  • Use TypeChecker for detecting fastapi routes (#15093)
  • `pycodestyle`

Documentation

  • Fix incorrect doc in shebang-not-executable (EXE001) and add git+windows solution to executable bit (#15208)
  • Rename rules currently not conforming to naming convention (#15102)

0.8.6

Preview features

  • `format`
  • `ruff`
  • `ruff`

Rule changes

  • `flake8-todos`
  • `pyflakes`

CLI

  • Show errors for attempted fixes only when passed --verbose (#15237)

Bug fixes

  • `ruff`
  • `pyupgrade`