ruff/changelogs/0.9.x.md

36 KiB
Raw Permalink Blame History

Changelog 0.9.x

0.9.0

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

Breaking changes

Ruff now formats your code according to the 2025 style guide. As a result, your code might now get formatted differently. See the formatter section for a detailed list of changes.

This release doesnt remove or remap any existing stable rules.

Stabilization

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

The following behaviors have been stabilized:

The following fixes or improvements to fixes have been stabilized:

Formatter

This release introduces the new 2025 stable style (#13371), stabilizing the following changes:

  • Format expressions in f-string elements (#7594)
  • Alternate quotes for strings inside f-strings (#13860)
  • Preserve the casing of hex codes in f-string debug expressions (#14766)
  • Choose the quote style for each string literal in an implicitly concatenated f-string rather than for the entire string (#13539)
  • Automatically join an implicitly concatenated string into a single string literal if it fits on a single line (#9457)
  • Remove the ISC001 incompatibility warning (#15123)
  • Prefer parenthesizing the assert message over breaking the assertion expression (#9457)
  • Automatically parenthesize over-long if guards in match case clauses (#13513)
  • More consistent formatting for match case patterns (#6933)
  • Avoid unnecessary parentheses around return type annotations (#13381)
  • Keep the opening parentheses on the same line as the if keyword for comprehensions where the condition has a leading comment (#12282)
  • More consistent formatting for with statements with a single context manager for Python 3.8 or older (#10276)
  • Correctly calculate the line-width for code blocks in docstrings when using max-doc-code-line-length = "dynamic" (#13523)

Preview features

  • `flake8-bugbear`
  • `flake8-type-checking`
  • `pylint`
  • `pyupgrade`
  • `ruff`
  • `ruff`

Rule changes

  • `flake8-builtins`
  • `flake8-return`

Server

  • Improve the observability by removing the need for the "trace" value to turn on or off logging. The server logging is solely controlled using the logLevel server setting which defaults to info. This addresses the issue where users were notified about an error and told to consult the log, but it didnt contain any messages. (#15232)
  • Ignore diagnostics from other sources for code action requests (#15373)

CLI

  • Improve the error message for --config key=value when the key is for a table and its a simple value

Bug fixes

  • `eradicate`
  • `flake8-django`
  • `pycodestyle`
  • `pydocstyle`
  • `pyflakes`
  • `refurb`
  • `ruff`
  • `ruff`

0.9.1

Preview features

  • `pycodestyle`
  • `ruff`

Rule changes

  • `flake8-bugbear`

Formatter

  • Preserve trailing end-of line comments for the last string literal in implicitly concatenated strings (#15378)

Server

  • Fix a bug where the server and client notebooks were out of sync after reordering cells (#15398)

Bug fixes

  • `flake8-pie`
  • `pyupgrade`

0.9.2

Preview features

  • `airflow`
  • `airflow`
  • `fastapi`
  • `flake8-pytest-style`
  • `flake8-pytest-style`
  • `flake8-type-checking`

Rule changes

  • `flake8-todos`
  • `pyflakes`

Formatter

  • Fix curly bracket spacing around f-string expressions containing curly braces (#15471)
  • Fix joining of f-strings with different quotes when using quote style Preserve (#15524)

Server

  • Avoid indexing the same workspace multiple times (#15495)
  • Display context for ruff.configuration errors (#15452)

Configuration

  • Remove flatten to improve deserialization error messages (#15414)

Bug fixes

  • Parse triple-quoted string annotations as if parenthesized (#15387)
  • `fastapi`
  • `flake8-bandit`
  • `flake8-pathlib`
  • `ruff`

0.9.3

Preview features

  • `airflow`
  • `airflow`
  • `flake8-bandit`
  • `flake8-pytest-style`
  • `flake8-simplify`
  • `pyflakes`
  • `pylint`
  • `pylint`
  • `pyupgrade`
  • `refurb`
  • `ruff`
  • `ruff`

Rule changes

  • `flake8-bugbear`
  • `flake8-comprehensions`
  • `flake8-pytest-style`
  • `flake8-simplify`
  • `flake8-type-checking`
  • `isort`
  • `pydoclint`
  • `pyflakes`
  • `pyflakes`
  • `pyflakes`
  • `pylint`
  • `ruff`

Formatter

  • Fix bracket spacing for single-element tuples in f-string expressions (#15537)
  • Fix unstable f-string formatting for expressions containing a trailing comma (#15545)

Performance

  • Avoid quadratic membership check in import fixes (#15576)

Server

  • Allow unsafe-fixes settings for code actions (#15666)

Bug fixes

  • `flake8-bandit`
  • `flake8-import-conventions`
  • `flake8-simplify`
  • `pyflakes`
  • `pyupgrade`
  • `ruff`
  • Preserve raw string prefix and escapes in all codegen fixes (#15694)

Documentation

  • Generate documentation redirects for lowercase rule codes (#15564)
  • TRY300: Add some extra notes on not catching exceptions you didn't expect (#15036)

0.9.4

Preview features

  • `airflow`
  • `airflow`
  • `flake8-bandit`
  • `pylint`
  • `refurb`
  • `ruff`
  • `ruff`
  • `ruff`
  • `ruff`

Rule changes

  • Preserve quote style in generated code (#15726, #15778, #15794)
  • `flake8-bugbear`
  • `pylint`
  • `pyupgrade`

CLI

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

Bug fixes

  • `flake8-comprehensions`
  • `flake8-comprehensions`
  • `pyupgrade`

Documentation

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

0.9.5

Preview features

  • Recognize all symbols named TYPE_CHECKING for in_type_checking_block (#15719)
  • `flake8-comprehensions`
  • `flake8-logging`
  • `flake8-pyi`
  • `flake8-pyi`
  • `flake8-pyi`
  • `flake8-pyi`
  • `pylint`
  • `pyupgrade`
  • `pyupgrade`
  • `refurb`
  • `refurb`
  • `ruff`
  • `airflow`
  • `flake8-pyi`
  • `flake8-pyi`

Rule changes

  • Preserve triple quotes and prefixes for strings (#15818)
  • `flake8-comprehensions`
  • `flake8-pyi`
  • `pep8-naming`
  • `pyupgrade`
  • `ruff`
  • `pycodestyle`

Configuration

  • Config error only when flake8-import-conventions alias conflicts with isort.required-imports bound name (#15918)
  • Workaround Even Better TOML crash related to allOf (#15992)

Bug fixes

  • `flake8-comprehensions`
  • `flake8-comprehensions`
  • `flake8-pyi`
  • `pep8-naming`
  • `pyflakes`
  • `pylint`
  • `refurb`
  • `refurb`

Documentation

  • Add deprecation warning for ruff-lsp related settings (#15850)
  • Docs (linter.md): clarify that Python files are always searched for in subdirectories (#15882)
  • Fix a typo in non_pep695_generic_class.rs (#15946)
  • Improve Docs: Pylint subcategories' codes (#15909)
  • Remove non-existing lint.extendIgnore editor setting (#15844)
  • Update black deviations (#15928)
  • Mention UP049 in UP046 and UP047, add See also section to UP040 (#15956)
  • Add instance variable examples to RUF012 (#15982)
  • Explain precedence for ignore and select config (#15883)

0.9.6

Preview features

  • `airflow`
  • `flake8-builtins`
  • `flake8-pyi`
  • `pylint`
  • `ruff`
  • `ruff`

Rule changes

  • `flake8-annotations`
  • `flake8-builtins`
  • `flake8-comprehensions`
  • `flake8-pie`
  • `flake8-simplify`
  • `pylint`
  • `pyupgrade`
  • `pyupgrade`
  • `pyupgrade`
  • `pyupgrade`
  • `ruff`

Server

  • Root exclusions in the server to project root (#16043)

Bug fixes

  • `flake8-datetime`
  • `flake8-type-checking`

Documentation

  • Improve ruff-lsp migration document (#16072)
  • Undeprecate ruff.nativeServer (#16039)

0.9.7

Preview features

  • Consider __new__ methods as special function type for enforcing class method or static method rules (#13305)
  • `airflow`
  • `refurb`
  • `ruff`
  • `ruff`
  • `refurb`

Rule changes

  • `flake8-debugger`
  • `pycodestyle`

Formatter

  • Fix unstable formatting of trailing end-of-line comments of parenthesized attribute values (#16187)

Server

  • Fix handling of requests received after shutdown message (#16262)
  • Ignore source.organizeImports.ruff and source.fixAll.ruff code actions for a notebook cell (#16154)
  • Include document specific debug info for ruff.printDebugInformation (#16215)
  • Update server to return the debug info as string with ruff.printDebugInformation (#16214)

CLI

  • Warn on invalid noqa even when there are no diagnostics (#16178)
  • Better error messages while loading configuration extends (#15658)

Bug fixes

  • `flake8-comprehensions`
  • `flake8-pyi`
  • `pydocstyle`
  • `pylint`
  • `pylint`
  • `pyupgrade`
  • `pyupgrade`
  • `pyupgrade`
  • `refurb`
  • `ruff`

Documentation

  • Add FAQ entry for source.* code actions in Notebook (#16212)
  • Add SECURITY.md (#16224)

0.9.8

Preview features

  • Start detecting version-related syntax errors in the parser (#16090)

Rule changes

  • `pylint`
  • `pylint`
  • `ruff`

Server

  • Avoid indexing the project if configurationPreference is editorOnly (#16381)
  • Avoid unnecessary info at non-trace server log level (#16389)
  • Expand ruff.configuration to allow inline config (#16296)
  • Notify users for invalid client settings (#16361)

Configuration

  • Add per-file-target-version option (#16257)

Bug fixes

  • `refurb`
  • `flake8-self`
  • `pylint`
  • `flake8-pyi`

Documentation

  • Fix example for S611 (#16316)
  • Normalize inconsistent markdown headings in docstrings (#16364)
  • Document MSRV policy (#16384)

0.9.9

Preview features

  • Fix caching of unsupported-syntax errors (#16425)

Bug fixes

  • Only show unsupported-syntax errors in editors when preview mode is enabled (#16429)

0.9.10

Preview features

  • `ruff`
  • `syntax-errors`
  • `syntax-errors`
  • `syntax-errors`
  • `syntax-errors`
  • `syntax-errors`
  • `syntax-errors`
  • `syntax-errors`
  • `syntax-errors`
  • `syntax-errors`

Bug fixes

  • Escape template filenames in glob patterns in configuration (#16407)
  • `flake8-simplify`
  • Formatter: Fix syntax error location in notebooks (#16499)
  • `pyupgrade`
  • `flake8-builtins`
  • `pylint`

CLI

  • Move rule code from description to check_name in GitLab output serializer (#16437)

Documentation

  • `pydocstyle`