pypi / ruff
ruff
What changed in ruff 0.0 to 0.17, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
41 breaking6 security4 deprecations77 new APIs and options26 performance149 behavior and defaults35 tooling320 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initruff 0.1774 changes
Breaking changes 5
flake8-builtins expands its checks in class scopes.
The conda-forge build no longer depends on Python, so python -m ruff and import ruff no longer work; use ruff directly from PATH.
Support for the legacy Python language server has been removed.
When neither target-version nor requires-python configures a Python version, Ruff now defaults to Python 3.11 instead of Python 3.10.
The formatter and I001, E501, and W505 consistently ignore trailing pragma comments when computing line length; existing imports may be reformatted.
Security 2
Implements the preview security rule tarfile-ignore-zeros-true.
macOS and Windows release executables and Ruff wheels are code-signed; macOS executables are also notarized, enabling publisher and binary-integrity verification.
Deprecations 1
ruff.nativeServer is deprecated and ignored because the Ruff VS Code extension now always uses the native language server.
New APIs and options 6
Implements the no-method-argument rule.
Adds the renamed-rule rule for detecting redirected renamed rules.
Adds the shared-clock-mock rule to the suspicious rule family.
Adds a configurable allowlist for magic-value-comparison (PLR2004).
Adds the preview
complexityrule unnecessary-regular-expression-compile.flake8-type-checking adds the notion of runtime-ambiguous references.
Performance 7
Includes various performance improvements.
Specializes lexing for ASCII identifiers.
Speeds up identifier and keyword lexing.
Buffers stdout in
ruff format.Prefilters checks by UTF-8 leading bytes.
Avoids intermediate names in lint name resolution.
Shares postfix parsing and reduces expression copies.
Behavior and default changes 21
Ignores frozen dataclass instantiations.
Marks the fix as unsafe, so Ruff no longer treats it as a safe autofix.
Expands redirected-noqa to cover other suppression comments.
Shows more nonprinting characters in diagnostic fix diffs.
Takes precedence in Ruff and ty diagnostics.
The pycodestyle rules no longer treat None, True, or False as keywords.
More collections and weakref containers are treated as mutable.
The preview flake8-bugbear rule now reports the method name and a more precise range.
These flake8-datetimez rules are no longer enabled by default.
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.
flake8-type-checking no longer flags annotations in function scopes.
The refurb fix is marked unsafe and the rule moves to suspicious.
datetime as dt is now recognized as a conventional alias by flake8-import-conventions.
JUnit output uses a skipped attribute instead of disabled on testsuite elements and adds a skipped attribute to the root testsuites element.
The TID255 rule is stabilized and no longer in preview.
The TID254 rule is stabilized and no longer in preview.
The default regex now recognizes underscore-prefixed Unicode names, such as _次, as dummy variables.
The RUF071 rule is stabilized and no longer in preview.
The preview Ruff rule allows docstrings in strict mode.
When checking for syntax errors without a configured Python version, Ruff now defaults to Python 3.15 instead of Python 3.14.
Ruff uses Unicode 17 data for identifier normalization and named character escapes.
Tooling 3
Implements the pytest-raises-exception-group rule.
The conda-forge build now supports linux-riscv64, win-arm64, and linux-ppc64le platforms.
pyupgrade now suggests typing.TypeForm on Python 3.15.
Fixes and other changes 29
Fixes the autofix for parenthesized setattr calls.
Ruff no longer crashes when logging to a closed stderr pipe.
Does not offer a fix when write is nested in an expression.
Its import-alias fix no longer shadows names.
Fixes fixes that add or remove a keyword argument with a parenthesized value.
Fixes the autofix for parenthesized self annotations.
Prevents the fix from duplicating closing parentheses around the format string.
Accepts a bare raise before a semicolon.
Ruff and ty diagnostics honor CLICOLOR=0.
Extends the syntax-errors check for writes to __debug__ to attribute targets.
Fixes a panic on BOM-prefixed files.
Fixes avoid behavior changes and syntax errors in G004 fixes.
Allows match identifiers after a semicolon.
Reports collapsible elif clauses after a multi-statement if branch.
Avoids incorrect conversions to f-strings.
Treats backslash-escaped *args and **kwargs as documented.
Avoids false positives on starred elements.
Marks fixes unsafe when they delete comments.
Avoids syntax errors for type variables with starred constraints in UP040, UP046, UP047, and RUF053.
Marks fixes unsafe when they delete comments.
Fixes dedent behavior when there are multiple leading comments.
The rules no longer suggest invalid comprehensions.
Fixes false positives on quoted annotations.
The rule now detects legacy positional-only parameters in __new__ methods.
The fix is marked unsafe when it creates a docstring.
The useless-return fix now preserves trailing comments.
Avoids a false positive when pytest.raises is used in a with statement.
flake8-self allows private access on object.__new__(cls) instances.
flake8-tidy-imports skips lazy-import-mismatch in stubs.
ruff 0.16120 changes
Breaking changes 6
DTZ901 rejects
tzinfo=Nonefor datetime bounds.Syntax errors now detect duplicate keyword arguments.
Semantic syntax errors in string type definitions are now emitted as F722.
Ruff enables 413 rules by default, up from 59, while removing 18 more opinionated E and F rules from the default set.
Checks additional PEP 585-compatible APIs, such as those from collections.abc.
The filename, location, end_location, and fix edit location fields may now be null instead of default values.
Security 3
The server avoids running
uv formatin untrusted workspaces.Embeds archive checksums in the shell installer.
Checks keyword arguments as well as other arguments.
New APIs and options 10
Adds a pyupgrade rule for context manager iterator annotations.
Adds
extend-banned-apiconfiguration forflake8-tidy-imports.Ruff recognizes the
parent_modeargument forRUF064andPTH103.Adds a preview rule for default values on method receivers.
Category selectors are introduced for selecting rules.
Adds a rule to replace
while 1withwhile True.An option lets developers opt out of human-readable names.
Ruff can format Python code blocks in Markdown files and does so by default.
Supports the same output formats as the linter, including github and gitlab for CI annotations.
Suppression comments can appear at the end of a line or on the line preceding a diagnostic, like noqa comments.
Performance 4
Reduces memory used by diagnostics.
Speeds up inherited configuration resolution.
Ruff releases now enable PGO for Linux x86-64, Linux ARM64, Windows x86-64, and macOS ARM64.
The unnecessary-future-import rule is faster.
Behavior and default changes 30
Ruff supports
__lazy_modules__, including conditional assignments.On Python 3.15 and later, Ruff prefers lazy imports over
TYPE_CHECKINGimports.Fixes are now always marked unsafe.
Pragma comments are excluded from line length calculation for I001.
The rule moves to the restriction category, changing how it is categorized for configuration and rule selection.
The preview default rules and categories are updated.
Rules can now be defined without codes.
The server can offer display-only fixes and marks safe fixes as preferred.
The delete-full-slice rule is now restricted to lists.
The existing exception now includes ctypes.LittleEndianStructure and related types.
Registers formatting capabilities dynamically to exclude TOML files.
Fixes that remove unknown separators are now marked unsafe.
Fixes are safe by default and unsafe only when comments are present.
Fixes for this rule are now marked unsafe.
The airflow3-incompatible-function-signature rule is stabilized and no longer in preview.
blind-except is suppressed when the exception is logged through logging methods other than critical, error, and exception.
The missing-copyright-notice rule is stabilized and no longer in preview.
The unnecessary-from-float rule is stabilized and no longer in preview.
The sorted-min-max rule is stabilized and no longer in preview.
Recognizes additional common gettext usage patterns, such as assigning gettext to builtins._.
The implicit-string-concatenation-in-collection-literal rule is stabilized and no longer in preview.
The log-exception-outside-except-handler rule is stabilized and no longer in preview.
The invalid-bool-return-type rule is stabilized and no longer in preview.
The too-many-positional-arguments rule is stabilized and no longer in preview.
The stop-iteration-return rule is stabilized and no longer in preview.
The none-not-at-end-of-union rule is stabilized and no longer in preview.
The access-annotations-from-class-dict rule is stabilized and no longer in preview.
The duplicate-entry-in-dunder-all rule is stabilized and no longer in preview.
Check output now shows fixes.
Ruff suppression comments now insert a space after the colon.
Tooling 7
Warnings now include the rule name and code.
RUF039 and RUF055 now recognize
re.prefixmatch.Adds an autofix for PT020, allowing Ruff to automatically fix violations.
The flake8-use-pathlib rule now offers an autofix.
Pull diagnostics are now supported for notebook cells.
Rule codes in the statistics output are now hyperlinked.
The LSP now lints TOML files.
Fixes and other changes 60
Avoids false positives for calls with keyword arguments.
Updates LibCST-based fixes for Python 3.15.
Mentions stubs in the diagnostic message.
Avoids false positives for overloaded division.
Allows lazy imports to be used in deferred annotations.
Ruff now visits functional TypedDict keyword arguments correctly.
Ruff recognizes PEP-728 keywords on
TypedDictclasses.Detects
\Zinpytest.raises()match patterns.The automatic fix preserves operand order.
Detects nested
async withunder a synchronous parent.Ruff skips conversions when
TypeVarTupleorParamSpechave bounds or constraints.Ruff recognizes quoted types in
typing.TypeForm.Stops recommending deprecated
ByteStringaliases.Multiline fixes preserve required parentheses.
Stops defining
__cached__for Python 3.15.Corrects the diagnostic for the conflict between D211 and D203.
Allows alternate nested quotes inside format spec interpolations.
Gates the PLW0133 check for
ImportCycleErroron Python 3.15.Marks a fix unsafe when it would create a docstring.
Recognizes
sliceandfrozendictgenerics.Skips fixes for multi-member imports.
Stops recommending the removed
typing.no_type_check_decorator.ASYNC230 now recognizes
builtins.open.Fixes a panic on match subjects.
Unary plus is allowed in match patterns on Python 3.15.
PLW1514 now recognizes
builtins.open.Avoids emitting duplicate PT017 diagnostics.
Adds a display-only fix for
os.listdir.Ruff-specific suppressions no longer produce a
lint.externalhint.Prevents a fix loop between TID254 and TID255.
Unary expressions are validated when parsing.
Detects blocking generic HTTP requests.
Allows timezone-safe strptime chains.
Respects side effects in lambda defaults.
The rule is skipped when the open argument is a file descriptor.
Fixes InvalidInstruction errors on Windows CPUs that do not support POPCNT.
The error message for mixed t-string and bytes syntax is aligned with CPython 3.14.
Syntax errors now detect parameters declared nonlocal.
The import-private-name rule now allows imports of os._exit.
Allows
continueinfinallyon Python 3.8.Makes the
np.chararrayautofix backwards-compatible.Fixes false positives and negatives involving the
%bformat character.Improves handling of concatenated strings.
Fixes a false positive with bools.
Fixes false negatives on negative numbers.
Avoids false positives on singledispatch functions.
Marks
rangeas immutable.The fix NFKC-normalizes keyword names.
Section detection is skipped inside RST directive bodies.
Fixes indexing of excluded nested Ruff workspaces.
The fix parenthesizes
yieldarguments.Unknown enumeration values in LSP messages are handled gracefully.
Avoids a false positive when a variable is read in a
finallyclause.Fixes a false positive involving unpacked arguments.
Syntax error noise is reduced by swallowing dedents like indents.
The fixer skips changes when a defaulted TypeVar precedes a non-defaulted one.
Fixes a missing check on unrecognized early bound.
Resolves local string literal bindings to avoid more false positives.
Supports the recommended API from newer versions of PySNMP.
Fixes a false positive involving a TypeVar default before Python 3.13.
ruff 0.15322 changes
Breaking changes 26
The pytest-fixture-autouse rule has been removed.
The parser now rejects _ as a match-pattern target.
The pydocstyle rule now prevents property docstrings from starting with verbs.
The parser now rejects __debug__ as a lambda parameter.
The flake8-pyi rule formerly named PYI033 is renamed to legacy-type-comment.
The parser now rejects multiple starred names in sequence patterns.
The parser now rejects parenthesized star imports.
The flake8-pyi rule now applies to Python files as well.
The parser now rejects starred comprehension targets.
The parser now rejects unparenthesized generator expressions in class bases.
The parser now rejects yield expressions after commas.
The rule no longer offers an autofix for
np.in1d.RUF019 now treats f-string interpolation as a potential side effect.
F507 now flags percent-format strings that have zero placeholders.
Starred expressions are disallowed as values of other starred expressions.
Naming conventions are now checked in match pattern bindings by
N806,N815, andN816.The rule now flags
requests.requestcalls.Explicit support for .qmd files was dropped; configure qmd as a markdown extension instead.
Preview now enables 412 default rules instead of the stable set of 59; users who prefer the old defaults can explicitly select E4, E7, E9, and F.
The rule now also checks string annotations.
Unlabeled Markdown code blocks are no longer formatted.
Ruff formats code according to the new 2026 style guide, changing formatting for lambdas, exception tuples, function-body blank lines, match captures, escaped quotes, and decorated classes in stubs.
The rule detects shadowed built-in names in additional contexts, including decorators, default arguments, and other attribute definitions.
The minimum supported Rust version is updated to 1.91.
Release binaries for the 64-bit big-endian PowerPC architecture are no longer included; users can still build Ruff manually for the platform.
The rule now applies to stub files on Python versions before 3.13.
New APIs and options 47
Adds a rule to replace
noqacomments withruff:ignore.Adds a rule to use human-readable names in
ruff:ignorecomments.Adds a rule to use human-readable names in configuration selectors.
Adds an option for adding ruff:ignore comments.
Adds --extend-exclude to ruff format.
Rule selectors can now use human-readable names.
Adds a rule that bans
pytestautouse fixtures.The command accepts rule names.
Implements the yield-in-context-manager-in-async-generator diagnostic, allowing Ruff to detect this pattern.
Adds the airflow-task-implicit-multiple-outputs rule.
Adds the incorrect-decorator-order rule.
Adds the fallible-context-manager rule.
Adds the too-many-try-statements rule.
A preview rule flags lazy imports that are eagerly evaluated.
Implements the Airflow task-branch-as-short-circuit rule.
Adds file-level suppressions using the #ruff:file-ignore directive.
Adds logical-line suppressions using the #ruff:ignore directive.
Implements the airflow-xcom-pull-in-template-string rule.
The server now supports custom file extensions.
Adds a formatter option to control quote style for nested strings.
Adds the preview rule unnecessary-if, which can be enabled to flag unnecessary if statements.
Adds the preview rule useless-finally.
Adds the preview rule f-string-percent-format, which warns when
%is used on an f-string.Adds a rule that flags
Variable.get()calls outside of task execution context.Adds a rule that flags runtime-varying values in DAG/task constructor arguments.
Implements the
delattr-with-constantrule.The rule supports the
newlineparameter for Python 3.13 and later.Ruff adds support for parsing lazy imports.
Adds the
os-path-commonprefixrule, which also has an unsafe fix.Ruff adds support for star-unpacking of comprehensions (PEP 798).
Adds a rule to enforce lazy imports.
The rule can be used to ban lazy imports.
Added a rule to enforce docstring section ordering.
Added the ICN001 import-convention rule.
Added the ICN002 import-convention rule.
Implemented the swap-with-temporary-variable rule.
Added the unnecessary-assign-before-yield rule.
Configuration file options now support extension mapping.
Checks that subscripts in tuples do not use lambda parameters in
reimplemented-operator.Adds support for configurable import section heading comments.
Detects non-existent mock methods in standalone expressions.
Adds support for Quarto Markdown language markers.
Detects mutable defaults in
fieldcalls.Adds the
float-equality-comparisonrule.A new CLI option forces colored output.
The location of the fix_title sub-diagnostic can be customized.
The linter supports block suppression comments using ruff: disable and ruff: enable to suppress rules across a code block.
Performance 13
Reserves capacity for builtin bindings.
Optimizes formatter text width and indentation.
Source files are created lazily for lint diagnostics.
Uses ArrayVec for qualified name segments.
Avoids allocating when parsing single string literals.
Avoids reallocating singleton call arguments.
Skips repeated-key checks for singleton dictionaries.
Drops excess capacity from statement suites during parsing.
Avoids redundant TokenValue drops in the lexer.
Uses ThinVec in the AST to shrink Stmt.
Reduces memory usage by dropping token-excess capacity and improves performance by approximating the initial tokens Vec size.
Avoids unnecessary parser lookahead for operators.
Diagnostic rendering is faster.
Behavior and default changes 66
Allows subclassing builtins in stub files.
Drops the tuple-comprehension preview behavior for C409.
Formatting comments no longer normalizes whitespace.
Skips overload-with-docstring in stub files.
Marks PYI061 fixes as unsafe in Python files.
Unknown rule selectors now emit a warning instead of an error.
Diagnostic links in the playground are now clickable.
LSP and playground diagnostics now use human-readable names.
The server renders subdiagnostics and secondary annotations as related information.
Severity is no longer displayed in output.
Python version comparisons are exempt from this rule.
Suppression comments can use human-readable rule names.
Automatically adds
from __future__ import annotationsfor this rule.Avoids fixes for ambiguous
argnamesandargvaluescombinations.The maximum allowed value for the setting has increased.
Standardizes the diagnostic message for this pylint rule.
The pandas-vet PD011 rule now suggests .array as well.
LOG004 now allows closures in except handlers.
In preview mode, F811 flags annotated variable redeclarations.
In non-strict mode, RUF067 allows dunder-named assignments.
UP018 detects more literals that are unnecessarily wrapped.
The server warns when Markdown files are skipped because preview is disabled.
The rule treats sys.executable as trusted input.
The E501 rule recognizes
pyrefly:as a pragma comment.The rule now ignores
pprintcalls that usestream=.A few rules are dropped from the preview default set, changing which rules run by default in preview.
Uses starred unpacking for this rule when targeting Python 3.15 or later.
Limits the rule to typing contexts and makes it unsafe outside typing-only contexts.
The rule automatically adds
from __future__ import annotations.In preview mode, Ruff discovers Markdown files by default.
The rule now applies to comprehensions and generators.
Certain B007 diagnostics are now tagged as unnecessary.
B901 is now allowed in pytest hook wrappers.
Configured extensions are now included in file discovery.
Sub-diagnostics are now rendered in the GitHub output format.
RUF100 now ignores unknown rule codes; RUF102 flags them instead.
RUF102 now supports file-level noqa directives.
Suspicious imports in TYPE_CHECKING blocks are now allowed for these rules.
The rule now allows global flags in uv shebangs.
The rule now detects chained str.split() calls.
Adds a secondary annotation showing the previous occurrence.
Uses extension mapping to select the language for Markdown code blocks.
Allows dunder submodules and improves the diagnostic range.
Adds a sub-diagnostic showing the runtime use of an annotation.
The blocking-http-call-httpx-in-async-function rule is no longer in preview.
The blocking-path-method-in-async-function rule is no longer in preview.
The blocking-input-in-async-function rule is no longer in preview.
The map-without-explicit-strict rule is no longer in preview.
The if-exp-instead-of-or-operator rule is no longer in preview.
The single-item-membership-test rule is no longer in preview.
Preview support applies formatting to code blocks in Markdown.
The server identifies notebooks using LSP didOpen rather than the .ipynb file extension.
The missing-maxsplit-arg rule is no longer in preview.
The unnecessary-lambda rule is no longer in preview.
The unnecessary-empty-iterable-within-deque-call rule is no longer in preview.
The in-empty-collection rule is no longer in preview.
The legacy-form-pytest-raises rule is no longer in preview.
The non-octal-permissions rule is no longer in preview.
The rule adds sub-diagnostics with permissions.
The invalid-rule-code rule is no longer in preview.
The invalid-suppression-comment rule is no longer in preview.
The unmatched-suppression-comment rule is no longer in preview.
The rule offers an autofix when maxsplit is provided, even if sep is omitted.
The rule now applies to more types of key expressions.
The fix is now unsafe if it deletes comments.
The replace-str-enum rule is no longer in preview.
Tooling 18
Adds an autofix for E402.
Adds linting and fixes for use of deprecated abc decorators.
Suppression comments and code actions support human-readable names when hovered.
The playground now uses diagnostic tags.
CLI output now uses human-readable names.
Pytest style checks also cover
pytest_asynciofixtures.Automatically adds
from __future__ import annotationsfor this rule.Adds full support for PEP 798.
The help text for
--confignow includes TOML examples.Colorizes the “All checks passed” output.
Preview displays output severity.
The Python module was updated for parity with uv, notably find_ruff_bin.
Flags a third positional parameter not named
ti_keyinBaseOperatorLink.get_link.Adds a rule to catch deprecated Airflow imports for Airflow 3.1.
Adds Markdown formatting support in the LSP.
Adds formatting support for
pyconMarkdown code blocks.The rule adds a sub-diagnostic explaining why a fix was unavailable.
The Docker image is now based on Debian 13 Trixie instead of Debian 12 Bookworm.
Fixes and other changes 152
Ignores mutable type updates in
redefined-loop-name.Fixes a false positive in
__all__.Marks the EXE004 fix as unsafe.
Refines detection of non-empty f-strings.
Fixes an autofix that incorrectly stripped + from comments.
Detects syntax errors in individual notebook cells.
Shebang handling in ruff:ignore comments now matches noqa shebang handling.
Ruff falls back to default settings when editor-only settings are invalid.
Fixes a panic when inserting text at a notebook cell boundary.
Updates fix suggestions for __floor__, __trunc__, __length_hint__, and __matmul__ variants.
Ruff crates are published to crates.io.
Ruff now detects mapping keys that are equivalent numeric values.
The parser now validates the default order of function type parameters.
Ruff now detects mapping keys equivalent to booleans.
Ruff now handles nested ruff:ignore comments.
Ruff now detects repeated signed and complex dictionary keys.
trio.as_safe_channelis recognized as a safe decorator.Clarifies the diagnostic message for single parameters.
The formatter preserves whitespace for Quarto cell option comments.
Fixes diagnostics when
ruff:enableorruff:disableappears whereruff:ignoreis expected.Suppressions respect diagnostic start and parent ranges, as well as trailing comments.
Handling of ignore comments within a disable/enable pair is fixed.
Preserves leading empty literals to avoid syntax errors.
No longer flags
ruff:ignorecomments as code.Fixes a conflict with RUF100 when
noqais on commented-out code.Avoids removing a
formatcall when doing so would change behavior.Avoids syntax errors from invalid character replacements in f-strings before Python 3.12; the fix also covers PLE2512, PLE2513, PLE2514, and PLE2515.
Narrows the diagnostic range and excludes cases without exception handlers.
Treats
yieldbeforebreakfrom a terminal loop as terminal.Avoids converting
formatcalls with more kinds of side effects.Returns a code action for resolve requests that contain no URL or no valid URL.
Reports duplicate imports in typing.TYPE_CHECKING blocks.
Treats function-scope bare annotations as locals, per PEP 526.
Fixes formatting of lambdas nested within f-strings.
Fixes how Ruff handles closing fences in Markdown.
Expands semantic syntax errors reported for invalid walruses.
Skips the rule for lambdas with positional-only parameters.
Treats generic frozenset annotations as immutable.
Fixes lambda formatting in interpolated string expressions.
Adds a recursion limit to the parser.
Avoids false positives in else clauses.
Marks the fix as unsafe when the first argument is a class attribute annotated as int.
Preserves f-string source verbatim in the fix.
Avoids strict behavior when future annotations are enabled.
Fixes a false positive for lines with leading whitespace.
Fixes a false positive for class methods.
Improves the error message for parameters declared global.
Updates Ruff's known standard-library information.
Fixes setting selection for multi-folder workspaces.
Panic diagnostic messages now always include the panic payload.
Fixes a false positive for f-string debug specifiers.
Restricts in-place operation checks to the enclosing class.
Fixes break and continue handling in loop-iterator-mutation.
Cache files now respect default Unix permissions.
Reverts preview changes to the displayed diagnostic severity in LSP.
Fixes PLC2701 behavior for type parameter scopes.
Overridden methods are omitted from ASYNC109 analysis.
RUF029 is ignored when a function is decorated with asynccontextmanager.
Fixes false positives and negatives in mask analysis.
E502 fixes no longer cause syntax errors in f-strings and t-strings.
Ruff avoids emitting or accepting multi-line f-string elements before Python 3.12.
The collapsible-if fix is safe in preview.
SLF diagnostics are robust to variables that are not named self.
Fixes a panic when UP012 handles octals.
The EM101 fix avoids shadowing an existing msg variable.
RUF010 fixes are marked unsafe when they delete a comment.
The RUF024 fix no longer reuses an existing symbol.
The RUF050 fix now parenthesizes the expression.
RUF072 now skips formfeeds when processing dedentation.
SIM105 is suppressed for except* before Python 3.12.
SIM113 ignores references made before initialization.
UP008 callable-scope handling now supports lambdas.
UP012 now ignores strings that contain string-only escapes.
W391 fixes now handle consecutive empty notebook cells correctly.
Resolves string imports that reference attributes as well as those referencing modules.
The autofix uses the fully qualified anyio.lowlevel import.
Line-width calculations for E501, W505, and the formatter exclude nested pragma comments.
The rule ignores ty: ignore comments.
Fixes a false negative for non-tuple right-hand sides in percent formatting.
The undefined-name rule skips variables that were conditionally deleted.
Pyflakes recognizes frozendict as a builtin when targeting Python 3.15 or later.
The fixer parenthesizes generator arguments.
Fixes parsing of
%foo?in IPython assignment expressions.The rule now checks tuple arguments for partial paths.
The rule recognizes Self annotations and self assignments.
The server no longer returns code actions for non-Python documents.
Ruff no longer shows noqa hover information for non-Python documents.
Fixes unwanted leading whitespace created by
--add-noqa.Fixes
--add-noqabreaking shebangs.Fixes a stack overflow on quoted annotations with escape sequences.
The formatter preserves required annotation parentheses.
Import sorting now retains the
lazykeyword.Fixes lambda body formatting for multiline calls and subscripts.
Ruff rejects semantic syntax errors in lazy imports.
Fixes comment duplication in fixes for
PERF401andPERF403.Fixes that previously caused syntax errors are avoided.
Adds an unsafe fix for
os-path-commonprefix.The formatter preserves parentheses in type expressions.
UP008 matching now handles nested classes correctly.
Fixes WSL detection in non-Docker containers.
Fixes numpy section ordering.
Fixes a false positive for names shadowing re-exports.
Handles callable class dependencies that have a
__call__method.Fixes false positives when an I/O variable is used later.
Adds a fix for
none-not-at-end-of-union.Fixes a false positive for
re.splitwith an empty string pattern.Avoids inserting redundant
Noneelements.Suppresses a false positive for names used before del in stub files.
Fixes a panic when PLR1712 is enabled alongside rules that analyze definitions, such as many ANN or D rules.
Fixed a false positive for @overload from lint.typing-modules.
Fixed an infinite loop between I002 and PYI025.
Invalid f-strings before Python 3.12 no longer produce this diagnostic.
BaseLoader and CBaseLoader are no longer flagged as unsafe.
Fixed handling of \N in raw strings.
Fixed a false positive for TypeVar defaults before Python 3.12.
Fixes a false positive for immediately-invoked lambdas.
The in_async_context logic is fixed, which may change flake8-async diagnostics.
Fixes parser indentation tracking after line continuations.
The parser no longer reports a false syntax error for match-like annotated assignments.
The CLI no longer emits the invalid inline noqa warning.
Suppresses diagnostics for strings with backslashes in interpolations when targeting Python versions before 3.12.
Fixes now delete the entire comment.
Fixes rule handling of typing.{io,re}.
Catches deprecated attribute access from context keys for Airflow 3.0.
Captures deprecated arguments and a decorator.
Fixes parenthesis removal for exception handlers on Python 3.14 and later.
Fixes an infinite loop in the preview fix for unused imports.
Avoids a false positive for undefined variables.
Prevents the autofix from introducing syntax errors.
Excludes
multiprocessing.Valuefrom the functions checked by the rule.Uses
ruffinstead ofRuffas the program name in GitHub output.No longer suggests
InitVarfor__post_init__that references PEP 695 type parameters.Fixes false negatives for the plural argument of
ngettext.Fixes missing diagnostics for the last range suppression in a file.
Improves the diagnostic for the rule.
Wraps the target for multiline fixes.
Ignores the standard-library
cmath.inf.Suppresses diagnostic output when formatting with
--check --silent.Fixes an f-string middle panic when parsing t-strings.
Deduplicates type variables in generic functions.
Wraps the target for multiline fixes.
Improves the diagnostic range for tuples.
Fixes a syntax error on strings with a newline escape and comment.
The rule no longer suggests NoReturn for functions that raise NotImplementedError.
Ruff resolves all extended configuration files before falling back on a default Python version.
The rule no longer adds abc.ABC if it is already present.
The rule now considers typing.Optional when searching for duplicate union members.
The Docker image is now based on Alpine 3.23 instead of 3.21.
Suppression indentation matching is fixed.
The rule now provides a safe fix when applying it will not delete comments.
The fix is now unsafe if it deletes comments.
The fix is now unsafe if it deletes comments.
ruff 0.14141 changes
Breaking changes 4
WASM now requires explicit logging initialization.
Invalid or unmatched range suppression comments now produce diagnostics.
Adds a syntax error for an annotated name that is global.
ERA001 now ignores ruff:disable and ruff:enable comments.
Security 1
Handles string literal bindings in suspicious-url-open-usage.
Deprecations 3
Extends the rule's deprecated-argument coverage to concurrency in airflow..DAG.
Warns that
airflow....DAG.create_dagrunhas been removed.Adds a warning for use of
airflow.datasets.DatasetEvent.
New APIs and options 13
Adds a preview diagnostic for dictionary values used as the second positional argument to Airflow Asset or Dataset.
PT011 supports the check parameter.
Adds a preview diagnostic that detects duplicate entries in __all__.
Adds the non-empty-init-module rule.
Adds a rule to prevent implicit string concatenation in collections.
Adds a pylint diagnostic that detects subclasses of builtin exceptions.
Adds diagnostics for unused range suppressions, allowing Ruff to identify suppressions that no longer silence any violations.
Adds a preview rule that catches yield expressions within other statements.
Adds a rule to detect unnecessary class properties.
Adds an option to skip over imports in TYPE_CHECKING blocks.
You can now provide a reason when using --add-noqa.
Implements the
stop-iteration-returnrule.Adds the
docstring-extraneous-parameterrule.
Performance 2
Uses
memchrto compute line indexes.The Ruff binary is smaller.
Behavior and default changes 32
Diagnostics for range suppression codes are combined.
Allows more logging methods for BLE001, changing which exception-catching cases the rule accepts.
Updates the Rust crate imperative used by D401 to v1.0.7, potentially changing rule results.
Import insertion for I002 now follows alphabetical order.
Diagnostics for matched disable/enable suppression comments are consolidated.
Improves the diagnostic range.
Identical members are now ignored.
Its fix is now display-only rather than automatically applicable.
Python 3.15 is accepted as a target-version value in preview.
The formatter keeps lambda parameters on one line and parenthesizes the body if it expands.
The formatter now formats method chains fluently.
Allows match and check keyword arguments without an expected exception type.
Suppresses this diagnostic for parameters with
Unpackannotations.Catches more dummy variable uses.
The preview rule now supports NumPy-style comma-separated parameters.
The preview rule now auto-fixes annotated assignments.
The rule now detects empty f-strings.
Help output now includes color.
The preview rule ignores str() when it is not used for simple conversion.
JSON output now includes the upstream linter URL.
The preview rule now applies when the index variable is of type int.
Autofix safety is expanded for keyword arguments and Decimals.
The formatter avoids adding extra parentheses around long match patterns with as captures.
The formatter now allows newlines after function headers even when the function has no docstring.
The graph command now works with Jupyter notebooks.
Extends the check for
airflow.models..Param.Adds support for additional eager conversion patterns.
More pyflakes and pandas rules use DiagnosticTag.
Autofixes for this rule are now marked unsafe.
More rules use
DiagnosticTag, changing how diagnostics display in editors.On Python 3.14 and later, the formatter removes parentheses around multiple exception types.
Recognizes typing_extensions.Text in addition to typing.Text.
Tooling 7
Flags passing a positional argument to HookLineageCollector.create_asset, which is not allowed.
Several Ruff rules now provide help subdiagnostics when their diagnostics can appear to disagree with ty.
Extends Path.open support for FURB101 and FURB103.
Shows a partial fixability indicator in statistics output.
Lint errors are now rendered with hyperlinks.
The flake8-bandit rules S508 and S509 support new PySNMP API paths.
The command's JSON output is improved.
Fixes and other changes 79
Fixes for B009, B010, B013, B014, B033, SIM910, SIM911, UP007, UP039, UP041, UP045, FURB105, FURB116, FURB136, FURB140, FURB145, FURB154, FURB157, FURB164, FURB181, FURB188, RUF019, and RUF020 are marked unsafe when they would remove comments.
The formatter preserves required parentheses in lambda bodies.
PIE794 now detects duplicated declared class fields.
Fixes inconsistent forward-reference handling for __new__, __enter__, and __aenter__.
RUF012 now exempts ctypes.Structure._fields_.
Corrects UP029 handling so non-builtin bindings can be shadowed.
UP045 now applies to string arguments of typing.cast.
RUF066 now respects
lint.pydocstyle.property-decoratorswhen evaluating properties.Fixes the configuration path shown by this option.
Treats **kwargs in a TypeVar as used.
Its fix is now always marked unsafe.
Fixes GitHub formatting for multi-line diagnostics.
Ruff checks required-version before parsing rules.
Improves the fix title shown for an invalid rule code.
Avoids adding an unnecessary builtins import in its fix.
Configured src directories are now included when resolving graphs.
Fixes are unsafe when types change in compound statements; this also applies to PTH105, PTH109, and PTH115.
Fixes parsing of named Unicode escape sequences.
Accepts immutable slice default arguments.
Fixes comment placement in lambda parameters.
Fixes a false positive when using a non-standard
CSafeLoaderpath.Marks fixes unsafe when they could change return types.
Fixes truthiness assumptions for non-iterable arguments in tuple, list, and set calls.
Changes handling of a default type parameter followed by a non-default type parameter.
Fixes false-positive syntax errors for await expressions outside functions.
Fixes a panic when parsing IPython escape command expressions.
Avoids producing an invalid fix.
Sets severity for non-rule diagnostics.
Fixes suppression for an empty dict without a tuple key annotation.
Fixes false positives on nested functions.
Formatting these expressions no longer causes a syntax error when the value is parenthesized and has a trailing comment.
The formatter no longer panics when formatting comments in unary expressions.
The formatter now respects
fmt: skipwhen multiple statements appear on the same logical line.Fixes the rule's autofix.
The formatter adjusts own-line comment placement between branches.
Avoids a false positive on ClassVar reassignment.
Fixes a false positive for complex conversion specifiers in logging-eager-conversion.
Fixes a syntax error false positive on alternative match patterns.
Fixes a false positive when Sphinx directives follow a Raises section.
The error message is improved when line-length exceeds u16::MAX.
Fixes a false positive for iterable initializers with generator arguments.
Fixes a false positive on relative imports from a local .builtins module.
The deprecated tag is now set consistently.
These rules now ignore attribute names that are not NFKC-normalized.
The autofix now preserves argument ordering.
Fixes a false negative for underscores before a sign in a Decimal constructor.
Fixes missing diagnostics for notebooks in the server.
Fixes false positives on starred arguments.
Fixes keyword range detection for a clause header after a statement ending with a semicolon.
Applies the rule to annotated fields.
Fixes a false positive on explicit exception re-raising.
Restores stable behavior when imports for a module lie in alternate branches.
Fixes a false positive for
__class__in lambda expressions within class definitions.Preserves digit separators in
Decimalconstructors.Fixes a panic when string literals are unclosed.
Provides a clearer error message when
line-lengthgoes beyond the threshold.Fixes a syntax error false positive on nested alternative patterns.
Adds missing docstring sections to the numpy list.
The flag is respected in watch mode, where the full output format is now used by default to match regular CLI output.
Prevents the rule from triggering on metaclasses.
Fixes a false positive with future annotations.
Fixes a false positive for
TypeVarwith a default on Python versions below 3.13.These rules are skipped when there are fewer than two iterables and no starred arguments.
The FAST002 autofix now handles ellipsis defaults.
The autofix is skipped for keyword and __debug__ path parameters.
The preview rules INT001, INT002, and INT003 now resolve qualified names and built-in bindings.
Ruff avoids reusing nested, interpolated quotes before Python 3.12.
Ruff catches syntax errors in nested interpolations before Python 3.12.
SIM911 is skipped when unknown arguments are present.
The preview autofix no longer omits an annotation.
Improves recovery for unclosed strings, including f-strings and t-strings.
Fixes false-positive syntax errors involving escapes and quotes in f-strings.
Fixes false positives for path parameters that FastAPI does not recognize.
The fix avoids dropping pieces that are implicitly concatenated.
Fixes false-positive syntax errors on parenthesized context managers.
The fix adds parentheses when needed to preserve operator precedence.
Suppresses diagnostics for f-string interpolations with debug text.
Fixes false negatives for lambdas, generators, and f-strings.
Fixes a false negative for
TypeVarwith a default argument innon-pep695-generic-class.
ruff 0.01 changes
New APIs and options 1
Adds a flake8-annotations-derived rule for missing return types on public functions; fixes are sometimes available.