unstale

pypi / ruff

ruff

What changed in ruff 0.15 to 0.17, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.

23 breaking6 security1 deprecations24 new APIs and options16 performance65 behavior and defaults17 tooling122 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

ruff 0.1735 changes

Breaking changes 5

  • flake8-builtins expands its checks in class scopes.

    0.17.0release notes

  • The conda-forge build no longer depends on Python, so python -m ruff and import ruff no longer work; use ruff directly from PATH.

    0.17.0release notes

  • Support for the legacy Python language server has been removed.

    0.17.0release notes

  • When neither target-version nor requires-python configures a Python version, Ruff now defaults to Python 3.11 instead of Python 3.10.

    0.17.0release notes

  • The formatter and I001, E501, and W505 consistently ignore trailing pragma comments when computing line length; existing imports may be reformatted.

    0.17.0release notes

Security 1

  • macOS and Windows release executables and Ruff wheels are code-signed; macOS executables are also notarized, enabling publisher and binary-integrity verification.

    0.17.0release notes

Deprecations 1

  • ruff.nativeServer is deprecated and ignored because the Ruff VS Code extension now always uses the native language server.

    0.17.0release notes

New APIs and options 1

  • flake8-type-checking adds the notion of runtime-ambiguous references.

    0.17.0release notes

Behavior and default changes 16

  • The pycodestyle rules no longer treat None, True, or False as keywords.

    0.17.1release notes

  • More collections and weakref containers are treated as mutable.

    0.17.1release notes

  • The preview flake8-bugbear rule now reports the method name and a more precise range.

    0.17.0release notes

  • These flake8-datetimez rules are no longer enabled by default.

    0.17.0release notes

  • The default full output format now shows unsafe fixes and suggestions requiring manual review regardless of unsafe-fixes; applying unsafe fixes still requires explicit opt-in.

    0.17.0release notes

  • flake8-type-checking no longer flags annotations in function scopes.

    0.17.0release notes

  • The refurb fix is marked unsafe and the rule moves to suspicious.

    0.17.0release notes

  • datetime as dt is now recognized as a conventional alias by flake8-import-conventions.

    0.17.0release notes

  • JUnit output uses a skipped attribute instead of disabled on testsuite elements and adds a skipped attribute to the root testsuites element.

    0.17.0release notes

  • The TID255 rule is stabilized and no longer in preview.

    0.17.0release notes

  • The TID254 rule is stabilized and no longer in preview.

    0.17.0release notes

  • The default regex now recognizes underscore-prefixed Unicode names, such as _次, as dummy variables.

    0.17.0release notes

  • The RUF071 rule is stabilized and no longer in preview.

    0.17.0release notes

  • The preview Ruff rule allows docstrings in strict mode.

    0.17.0release notes

  • When checking for syntax errors without a configured Python version, Ruff now defaults to Python 3.15 instead of Python 3.14.

    0.17.0release notes

  • Ruff uses Unicode 17 data for identifier normalization and named character escapes.

    0.17.0release notes

Tooling 2

  • The conda-forge build now supports linux-riscv64, win-arm64, and linux-ppc64le platforms.

    0.17.0release notes

  • pyupgrade now suggests typing.TypeForm on Python 3.15.

    0.17.0release notes

Fixes and other changes 9

  • Fixes dedent behavior when there are multiple leading comments.

    0.17.1release notes

  • The rules no longer suggest invalid comprehensions.

    0.17.1release notes

  • Fixes false positives on quoted annotations.

    0.17.1release notes

  • The rule now detects legacy positional-only parameters in __new__ methods.

    0.17.1release notes

  • The fix is marked unsafe when it creates a docstring.

    0.17.0release notes

  • The useless-return fix now preserves trailing comments.

    0.17.0release notes

  • Avoids a false positive when pytest.raises is used in a with statement.

    0.17.0release notes

  • flake8-self allows private access on object.__new__(cls) instances.

    0.17.0release notes

  • flake8-tidy-imports skips lazy-import-mismatch in stubs.

    0.17.0release notes

ruff 0.16133 changes

Breaking changes 6

  • DTZ901 rejects tzinfo=None for datetime bounds.

    0.16.6release notes

  • Syntax errors now detect duplicate keyword arguments.

    0.16.4release notes

  • Semantic syntax errors in string type definitions are now emitted as F722.

    0.16.4release notes

  • Ruff enables 413 rules by default, up from 59, while removing 18 more opinionated E and F rules from the default set.

    0.16.0release notes

  • Checks additional PEP 585-compatible APIs, such as those from collections.abc.

    0.16.0release notes

  • The filename, location, end_location, and fix edit location fields may now be null instead of default values.

    0.16.0release notes

Security 5

  • The server avoids running uv format in untrusted workspaces.

    0.16.10release notes

  • Embeds archive checksums in the shell installer.

    0.16.7release notes

  • Checks keyword arguments as well as other arguments.

    0.16.3release notes

  • Checks keyword arguments as well as other arguments.

    0.16.3release notes

  • Checks keyword arguments as well as other arguments.

    0.16.3release notes

New APIs and options 10

  • Adds a pyupgrade rule for context manager iterator annotations.

    0.16.10release notes

  • Adds extend-banned-api configuration for flake8-tidy-imports.

    0.16.8release notes

  • Ruff recognizes the parent_mode argument for RUF064 and PTH103.

    0.16.8release notes

  • Adds a preview rule for default values on method receivers.

    0.16.7release notes

  • Category selectors are introduced for selecting rules.

    0.16.5release notes

  • Adds a rule to replace while 1 with while True.

    0.16.3release notes

  • An option lets developers opt out of human-readable names.

    0.16.1release notes

  • Ruff can format Python code blocks in Markdown files and does so by default.

    0.16.0release notes

  • Supports the same output formats as the linter, including github and gitlab for CI annotations.

    0.16.0release notes

  • Suppression comments can appear at the end of a line or on the line preceding a diagnostic, like noqa comments.

    0.16.0release notes

Performance 4

  • Reduces memory used by diagnostics.

    0.16.10release notes

  • Speeds up inherited configuration resolution.

    0.16.7release notes

  • Ruff releases now enable PGO for Linux x86-64, Linux ARM64, Windows x86-64, and macOS ARM64.

    0.16.3release notes

  • The unnecessary-future-import rule is faster.

    0.16.0release notes

Behavior and default changes 35

  • Ruff supports __lazy_modules__, including conditional assignments.

    0.16.8release notes

  • On Python 3.15 and later, Ruff prefers lazy imports over TYPE_CHECKING imports.

    0.16.8release notes

  • On Python 3.15 and later, Ruff prefers lazy imports over TYPE_CHECKING imports.

    0.16.8release notes

  • On Python 3.15 and later, Ruff prefers lazy imports over TYPE_CHECKING imports.

    0.16.8release notes

  • Fixes are now always marked unsafe.

    0.16.8release notes

  • Pragma comments are excluded from line length calculation for I001.

    0.16.6release notes

  • The rule moves to the restriction category, changing how it is categorized for configuration and rule selection.

    0.16.6release notes

  • The preview default rules and categories are updated.

    0.16.5release notes

  • Rules can now be defined without codes.

    0.16.5release notes

  • The server can offer display-only fixes and marks safe fixes as preferred.

    0.16.4release notes

  • The delete-full-slice rule is now restricted to lists.

    0.16.4release notes

  • The existing exception now includes ctypes.LittleEndianStructure and related types.

    0.16.4release notes

  • Registers formatting capabilities dynamically to exclude TOML files.

    0.16.2release notes

  • Fixes that remove unknown separators are now marked unsafe.

    0.16.1release notes

  • Fixes are safe by default and unsafe only when comments are present.

    0.16.1release notes

  • Fixes for this rule are now marked unsafe.

    0.16.1release notes

  • The airflow3-incompatible-function-signature rule is stabilized and no longer in preview.

    0.16.0release notes

  • blind-except is suppressed when the exception is logged through logging methods other than critical, error, and exception.

    0.16.0release notes

  • The missing-copyright-notice rule is stabilized and no longer in preview.

    0.16.0release notes

  • The unnecessary-from-float rule is stabilized and no longer in preview.

    0.16.0release notes

  • The sorted-min-max rule is stabilized and no longer in preview.

    0.16.0release notes

  • Recognizes additional common gettext usage patterns, such as assigning gettext to builtins._.

    0.16.0release notes

  • Recognizes additional common gettext usage patterns, such as assigning gettext to builtins._.

    0.16.0release notes

  • Recognizes additional common gettext usage patterns, such as assigning gettext to builtins._.

    0.16.0release notes

  • The implicit-string-concatenation-in-collection-literal rule is stabilized and no longer in preview.

    0.16.0release notes

  • The log-exception-outside-except-handler rule is stabilized and no longer in preview.

    0.16.0release notes

  • The invalid-bool-return-type rule is stabilized and no longer in preview.

    0.16.0release notes

  • The too-many-positional-arguments rule is stabilized and no longer in preview.

    0.16.0release notes

  • The stop-iteration-return rule is stabilized and no longer in preview.

    0.16.0release notes

  • The none-not-at-end-of-union rule is stabilized and no longer in preview.

    0.16.0release notes

  • The access-annotations-from-class-dict rule is stabilized and no longer in preview.

    0.16.0release notes

  • The duplicate-entry-in-dunder-all rule is stabilized and no longer in preview.

    0.16.0release notes

  • Check output now shows fixes.

    0.16.0release notes

  • Ruff suppression comments now insert a space after the colon.

    0.16.0release notes

  • Recognizes typing_extensions.Text in addition to typing.Text.

    0.16.0release notes

Tooling 7

  • Warnings now include the rule name and code.

    0.16.8release notes

  • RUF039 and RUF055 now recognize re.prefixmatch.

    0.16.7release notes

  • Adds an autofix for PT020, allowing Ruff to automatically fix violations.

    0.16.6release notes

  • The flake8-use-pathlib rule now offers an autofix.

    0.16.4release notes

  • Pull diagnostics are now supported for notebook cells.

    0.16.4release notes

  • Rule codes in the statistics output are now hyperlinked.

    0.16.3release notes

  • The LSP now lints TOML files.

    0.16.1release notes

Fixes and other changes 66

  • Avoids false positives for calls with keyword arguments.

    0.16.9release notes

  • Avoids false positives for calls with keyword arguments.

    0.16.9release notes

  • Avoids false positives for calls with keyword arguments.

    0.16.9release notes

  • Updates LibCST-based fixes for Python 3.15.

    0.16.9release notes

  • Mentions stubs in the diagnostic message.

    0.16.9release notes

  • Avoids false positives for overloaded division.

    0.16.9release notes

  • Allows lazy imports to be used in deferred annotations.

    0.16.9release notes

  • Ruff now visits functional TypedDict keyword arguments correctly.

    0.16.8release notes

  • Ruff recognizes PEP-728 keywords on TypedDict classes.

    0.16.8release notes

  • Detects \Z in pytest.raises() match patterns.

    0.16.8release notes

  • The automatic fix preserves operand order.

    0.16.8release notes

  • Detects nested async with under a synchronous parent.

    0.16.8release notes

  • Ruff skips conversions when TypeVarTuple or ParamSpec have bounds or constraints.

    0.16.8release notes

  • Ruff recognizes quoted types in typing.TypeForm.

    0.16.8release notes

  • Stops recommending deprecated ByteString aliases.

    0.16.8release notes

  • Multiline fixes preserve required parentheses.

    0.16.8release notes

  • Stops defining __cached__ for Python 3.15.

    0.16.7release notes

  • Corrects the diagnostic for the conflict between D211 and D203.

    0.16.7release notes

  • Allows alternate nested quotes inside format spec interpolations.

    0.16.7release notes

  • Gates the PLW0133 check for ImportCycleError on Python 3.15.

    0.16.7release notes

  • Marks a fix unsafe when it would create a docstring.

    0.16.7release notes

  • Recognizes slice and frozendict generics.

    0.16.7release notes

  • Skips fixes for multi-member imports.

    0.16.7release notes

  • Stops recommending the removed typing.no_type_check_decorator.

    0.16.7release notes

  • ASYNC230 now recognizes builtins.open.

    0.16.6release notes

  • Fixes a panic on match subjects.

    0.16.6release notes

  • Unary plus is allowed in match patterns on Python 3.15.

    0.16.6release notes

  • PLW1514 now recognizes builtins.open.

    0.16.6release notes

  • Avoids emitting duplicate PT017 diagnostics.

    0.16.6release notes

  • Adds a display-only fix for os.listdir.

    0.16.6release notes

  • Ruff-specific suppressions no longer produce a lint.external hint.

    0.16.6release notes

  • Prevents a fix loop between TID254 and TID255.

    0.16.6release notes

  • Unary expressions are validated when parsing.

    0.16.6release notes

  • Detects blocking generic HTTP requests.

    0.16.5release notes

  • Allows timezone-safe strptime chains.

    0.16.5release notes

  • Respects side effects in lambda defaults.

    0.16.5release notes

  • The rule is skipped when the open argument is a file descriptor.

    0.16.4release notes

  • The rule is skipped when the open argument is a file descriptor.

    0.16.4release notes

  • Fixes InvalidInstruction errors on Windows CPUs that do not support POPCNT.

    0.16.4release notes

  • The error message for mixed t-string and bytes syntax is aligned with CPython 3.14.

    0.16.4release notes

  • Syntax errors now detect parameters declared nonlocal.

    0.16.4release notes

  • The import-private-name rule now allows imports of os._exit.

    0.16.4release notes

  • Allows continue in finally on Python 3.8.

    0.16.3release notes

  • Makes the np.chararray autofix backwards-compatible.

    0.16.3release notes

  • Fixes false positives and negatives involving the %b format character.

    0.16.3release notes

  • Improves handling of concatenated strings.

    0.16.3release notes

  • Fixes a false positive with bools.

    0.16.3release notes

  • Fixes false positives and negatives involving the %b format character.

    0.16.3release notes

  • Fixes false negatives on negative numbers.

    0.16.3release notes

  • Checks keyword arguments as well as other arguments.

    0.16.3release notes

  • Avoids false positives on singledispatch functions.

    0.16.2release notes

  • Marks range as immutable.

    0.16.1release notes

  • The fix NFKC-normalizes keyword names.

    0.16.1release notes

  • Section detection is skipped inside RST directive bodies.

    0.16.1release notes

  • Fixes indexing of excluded nested Ruff workspaces.

    0.16.1release notes

  • The fix parenthesizes yield arguments.

    0.16.1release notes

  • Unknown enumeration values in LSP messages are handled gracefully.

    0.16.1release notes

  • Avoids a false positive when a variable is read in a finally clause.

    0.16.1release notes

  • Fixes a false positive involving unpacked arguments.

    0.16.1release notes

  • Syntax error noise is reduced by swallowing dedents like indents.

    0.16.1release notes

  • The fixer skips changes when a defaulted TypeVar precedes a non-defaulted one.

    0.16.1release notes

  • Fixes a missing check on unrecognized early bound.

    0.16.0release notes

  • Resolves local string literal bindings to avoid more false positives.

    0.16.0release notes

  • Supports the recommended API from newer versions of PySNMP.

    0.16.0release notes

  • Supports the recommended API from newer versions of PySNMP.

    0.16.0release notes

  • Fixes a false positive involving a TypeVar default before Python 3.13.

    0.16.0release notes

ruff 0.15106 changes

Breaking changes 12

  • The pytest-fixture-autouse rule has been removed.

    0.15.20release notes

  • The parser now rejects _ as a match-pattern target.

    0.15.18release notes

  • The pydocstyle rule now prevents property docstrings from starting with verbs.

    0.15.18release notes

  • The parser now rejects __debug__ as a lambda parameter.

    0.15.18release notes

  • The flake8-pyi rule formerly named PYI033 is renamed to legacy-type-comment.

    0.15.18release notes

  • The parser now rejects multiple starred names in sequence patterns.

    0.15.18release notes

  • The parser now rejects parenthesized star imports.

    0.15.18release notes

  • The flake8-pyi rule now applies to Python files as well.

    0.15.18release notes

  • The parser now rejects starred comprehension targets.

    0.15.18release notes

  • The parser now rejects unparenthesized generator expressions in class bases.

    0.15.18release notes

  • The parser now rejects yield expressions after commas.

    0.15.18release notes

  • The rule no longer offers an autofix for np.in1d.

    0.15.17release notes

New APIs and options 13

  • Adds a rule to replace noqa comments with ruff:ignore.

    0.15.22release notes

  • Adds a rule to use human-readable names in ruff:ignore comments.

    0.15.22release notes

  • Adds a rule to use human-readable names in configuration selectors.

    0.15.22release notes

  • Adds an option for adding ruff:ignore comments.

    0.15.21release notes

  • Adds --extend-exclude to ruff format.

    0.15.21release notes

  • Rule selectors can now use human-readable names.

    0.15.20release notes

  • Adds a rule that bans pytest autouse fixtures.

    0.15.17release notes

  • The command accepts rule names.

    0.15.17release notes

  • Implements the yield-in-context-manager-in-async-generator diagnostic, allowing Ruff to detect this pattern.

    0.15.16release notes

  • Adds the airflow-task-implicit-multiple-outputs rule.

    0.15.14release notes

  • Adds the incorrect-decorator-order rule.

    0.15.14release notes

  • Adds the fallible-context-manager rule.

    0.15.14release notes

  • Adds the too-many-try-statements rule.

    0.15.14release notes

Performance 12

  • Reserves capacity for builtin bindings.

    0.15.19release notes

  • Optimizes formatter text width and indentation.

    0.15.19release notes

  • Source files are created lazily for lint diagnostics.

    0.15.19release notes

  • Uses ArrayVec for qualified name segments.

    0.15.19release notes

  • Avoids allocating when parsing single string literals.

    0.15.19release notes

  • Avoids reallocating singleton call arguments.

    0.15.19release notes

  • Skips repeated-key checks for singleton dictionaries.

    0.15.19release notes

  • Drops excess capacity from statement suites during parsing.

    0.15.16release notes

  • Avoids redundant TokenValue drops in the lexer.

    0.15.15release notes

  • Uses ThinVec in the AST to shrink Stmt.

    0.15.15release notes

  • Reduces memory usage by dropping token-excess capacity and improves performance by approximating the initial tokens Vec size.

    0.15.15release notes

  • Avoids unnecessary parser lookahead for operators.

    0.15.14release notes

Behavior and default changes 14

  • Allows subclassing builtins in stub files.

    0.15.22release notes

  • Drops the tuple-comprehension preview behavior for C409.

    0.15.21release notes

  • Formatting comments no longer normalizes whitespace.

    0.15.21release notes

  • Skips overload-with-docstring in stub files.

    0.15.21release notes

  • Marks PYI061 fixes as unsafe in Python files.

    0.15.21release notes

  • Unknown rule selectors now emit a warning instead of an error.

    0.15.20release notes

  • Diagnostic links in the playground are now clickable.

    0.15.18release notes

  • LSP and playground diagnostics now use human-readable names.

    0.15.18release notes

  • The server renders subdiagnostics and secondary annotations as related information.

    0.15.18release notes

  • Severity is no longer displayed in output.

    0.15.18release notes

  • Python version comparisons are exempt from this rule.

    0.15.17release notes

  • Suppression comments can use human-readable rule names.

    0.15.17release notes

  • Automatically adds from __future__ import annotations for this rule.

    0.15.17release notes

  • Avoids fixes for ambiguous argnames and argvalues combinations.

    0.15.16release notes

Tooling 8

Fixes and other changes 47

  • Ignores mutable type updates in redefined-loop-name.

    0.15.22release notes

  • Fixes a false positive in __all__.

    0.15.22release notes

  • Marks the EXE004 fix as unsafe.

    0.15.21release notes

  • Refines detection of non-empty f-strings.

    0.15.21release notes

  • Fixes an autofix that incorrectly stripped + from comments.

    0.15.21release notes

  • Detects syntax errors in individual notebook cells.

    0.15.21release notes

  • Shebang handling in ruff:ignore comments now matches noqa shebang handling.

    0.15.20release notes

  • Ruff falls back to default settings when editor-only settings are invalid.

    0.15.19release notes

  • Fixes a panic when inserting text at a notebook cell boundary.

    0.15.19release notes

  • Updates fix suggestions for __floor__, __trunc__, __length_hint__, and __matmul__ variants.

    0.15.19release notes

  • Ruff crates are published to crates.io.

    0.15.19release notes

  • Ruff now detects mapping keys that are equivalent numeric values.

    0.15.18release notes

  • The parser now validates the default order of function type parameters.

    0.15.18release notes

  • Ruff now detects mapping keys equivalent to booleans.

    0.15.18release notes

  • Ruff now handles nested ruff:ignore comments.

    0.15.18release notes

  • Ruff now detects repeated signed and complex dictionary keys.

    0.15.18release notes

  • trio.as_safe_channel is recognized as a safe decorator.

    0.15.17release notes

  • Clarifies the diagnostic message for single parameters.

    0.15.17release notes

  • The formatter preserves whitespace for Quarto cell option comments.

    0.15.17release notes

  • Fixes diagnostics when ruff:enable or ruff:disable appears where ruff:ignore is expected.

    0.15.17release notes

  • Fixes diagnostics when ruff:enable or ruff:disable appears where ruff:ignore is expected.

    0.15.17release notes

  • Suppressions respect diagnostic start and parent ranges, as well as trailing comments.

    0.15.17release notes

  • Handling of ignore comments within a disable/enable pair is fixed.

    0.15.17release notes

  • Preserves leading empty literals to avoid syntax errors.

    0.15.17release notes

  • No longer flags ruff:ignore comments as code.

    0.15.16release notes

  • Fixes a conflict with RUF100 when noqa is on commented-out code.

    0.15.16release notes

  • Avoids removing a format call when doing so would change behavior.

    0.15.16release notes

  • Avoids syntax errors from invalid character replacements in f-strings before Python 3.12; the fix also covers PLE2512, PLE2513, PLE2514, and PLE2515.

    0.15.16release notes

  • Narrows the diagnostic range and excludes cases without exception handlers.

    0.15.16release notes

  • Treats yield before break from a terminal loop as terminal.

    0.15.16release notes

  • Avoids converting format calls with more kinds of side effects.

    0.15.16release notes

  • Returns a code action for resolve requests that contain no URL or no valid URL.

    0.15.15release notes

  • Reports duplicate imports in typing.TYPE_CHECKING blocks.

    0.15.15release notes

  • Treats function-scope bare annotations as locals, per PEP 526.

    0.15.15release notes

  • Fixes formatting of lambdas nested within f-strings.

    0.15.15release notes

  • Fixes how Ruff handles closing fences in Markdown.

    0.15.15release notes

  • Expands semantic syntax errors reported for invalid walruses.

    0.15.15release notes

  • Skips the rule for lambdas with positional-only parameters.

    0.15.14release notes

  • Treats generic frozenset annotations as immutable.

    0.15.14release notes

  • Fixes lambda formatting in interpolated string expressions.

    0.15.14release notes

  • Adds a recursion limit to the parser.

    0.15.14release notes

  • Avoids false positives in else clauses.

    0.15.14release notes

  • Marks the fix as unsafe when the first argument is a class attribute annotated as int.

    0.15.14release notes

  • Preserves f-string source verbatim in the fix.

    0.15.14release notes

  • Avoids strict behavior when future annotations are enabled.

    0.15.14release notes

  • Avoids strict behavior when future annotations are enabled.

    0.15.14release notes

  • Avoids strict behavior when future annotations are enabled.

    0.15.14release notes