NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #85 most downloaded on PyPI
An extremely fast Python linter and code formatter, written in Rust.
Latest stable
0.17.6
Last release 2 days ago
19 Nov 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 59 of the last 60 stable releases
4 versions withdrawn
withdrawn after publishing
4 years old
433 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
Fix codeblock dynamic line length calculation for indented docstring examples
refurb] Mark FURB118 fix as unsafe (#13613)pydocstyle] Don't raise D208 when last line is non-empty (#13372)pylint] Preserve trivia (i.e. comments) in PLR5501 autofix (#13573)pyflakes] Add allow-unused-imports setting for unused-import rule (F401) (#13601)flake8-bugbear] Avoid short circuiting B017 for multiple context managers (#13609)pylint] Do not offer an invalid fix for PLR1716 when the comparisons contain parenthesis (#13527)pyupgrade] Fix UP043 to apply to collections.abc.Generator and collections.abc.AsyncGenerator (#13611)refurb] Fix handling of slices in tuples for FURB118, e.g., x[:, 1] (#13518)astral-sh/ruff-action (#13551)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.9/ruff-installer.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.9/ruff-installer.ps1 | iex"
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Remove unnecessary parentheses around match case clauses
match case clauses (#13510)if guards in match..case clauses (#13513)ruff analyze graph (#13486)pylint] Implement boolean-chained-comparison (R1716) (#13435)lake8-simplify] Detect SIM910 when using variadic keyword arguments, i.e., **kwargs (#13503)pyupgrade] Avoid false negatives with non-reference shadowed bindings of loop variables (UP028) (#13504)*args (#13512)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.8/ruff-installer.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.8/ruff-installer.ps1 | iex"
Add Python version support to ruff analyze CLI
exclude support to ruff analyze (#13425)pycodestyle] Fix: Don't autofix if the first line ends in a question mark? (D400) (#13399)lint.exclude in ruff check --add-noqa (#13427)forget for module resolver database (#13438)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.7/ruff-installer.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.7/ruff-installer.ps1 | iex"
\[refurb\] Skip slice-to-remove-prefix-or-suffix (FURB188) when non-trivial slice steps are present
refurb] Skip slice-to-remove-prefix-or-suffix (FURB188) when non-trivial slice steps are present (#13405)LineIndex::offset calculation (#13407)fastapi] Respect FastAPI aliases in route definitions (#13394)pydocstyle] Respect word boundaries when detecting function signature in docs (#13388)FURB188 docs (#13406)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.6/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.6/ruff-installer.ps1 | iex"
\[pydoclint\] Ignore DOC201 when function name is "new"
pydoclint] Ignore DOC201 when function name is "new" (#13300)refurb] Implement slice-to-remove-prefix-or-suffix (FURB188) (#13256)eradicate] Ignore script-comments with multiple end-tags (ERA001) (#13283)pyflakes] Improve error message for UndefinedName when a builtin was added in a newer version than specified in Ruff config (F821) (#13293)ruff] Handle unary operators in decimal-from-float-literal (RUF032) (#13275)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.5/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.5/ruff-installer.ps1 | iex"
\[flake8-builtins\] Use dynamic builtins list based on Python version
flake8-builtins] Use dynamic builtins list based on Python version (#13172)pydoclint] Permit yielding None in DOC402 and DOC403 (#13148)pylint] Update diagnostic message for PLW3201 (#13194)ruff] Implement post-init-default (RUF033) (#13192)ruff] Implement useless if-else (RUF034) (#13218)flake8-pyi] Respect pep8_naming.classmethod-decorators settings when determining if a method is a classmethod in custom-type-var-return-type (PYI019) (#13162)flake8-pyi] Teach various rules that annotations might be stringized (#12951)pylint] Avoid no-self-use for attrs-style validators (#13166)pylint] Recurse into subscript subexpressions when searching for list/dict lookups (PLR1733, PLR1736) (#13186)pyupgrade] Detect aiofiles.open calls in UP015 (#13173)pyupgrade] Mark sys.version_info[0] < 3 and similar comparisons as outdated (UP036) (#13175)ruff format output (#13212)pydocstyle] Improve heuristics for detecting Google-style docstrings (#13142)refurb] Treat sep arguments with effects as unsafe removals (FURB105) (#13165)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.4/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.4/ruff-installer.ps1 | iex"
\[flake8-simplify\] Extend open-file-with-context-handler to work with dbm.sqlite3 (SIM115)
flake8-simplify] Extend open-file-with-context-handler to work with dbm.sqlite3 (SIM115) (#13104)pycodestyle] Disable E741 in stub files (.pyi) (#13119)pydoclint] Avoid DOC201 on explicit returns in functions that only return None (#13064)flake8-async] Disable check for asyncio before Python 3.11 (ASYNC109) (#13023)FastAPI] Avoid introducing invalid syntax in fix for fast-api-non-annotated-dependency (FAST002) (#13133)flake8-implicit-str-concat] Normalize octals before merging concatenated strings in single-line-implicit-string-concatenation (ISC001) (#13118)flake8-pytest-style] Improve help message for pytest-incorrect-mark-parentheses-style (PT023) (#13092)pylint] Avoid autofix for calls that aren't min or max as starred expression (PLW3301) (#13089)ruff] Add datetime.time, datetime.tzinfo, and datetime.timezone as immutable function calls (RUF009) (#13109)ruff] Extend comment deletion for RUF100 to include trailing text from noqa directives while preserving any following comments on the same line, if any (#13105)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.3/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.3/ruff-installer.ps1 | iex"
\[flake8-simplify\] Extend open-file-with-context-handler to work with other standard-library IO modules (SIM115)
flake8-simplify] Extend open-file-with-context-handler to work with other standard-library IO modules (SIM115) (#12959)ruff] Avoid unused-async for functions with FastAPI route decorator (RUF029) (#12938)ruff] Ignore fstring-missing-syntax (RUF027) for fastAPI paths (#12939)ruff] Implement check for Decimal called with a float literal (RUF032) (#12909)flake8-bugbear] Update diagnostic message when expression is at the end of function (B015) (#12944)flake8-pyi] Skip type annotations in string-or-bytes-too-long (PYI053) (#13002)flake8-type-checking] Always recognise relative imports as first-party (#12994)flake8-unused-arguments] Ignore unused arguments on stub functions (ARG001) (#12966)pylint] Ignore augmented assignment for self-cls-assignment (PLW0642) (#12957)pep8-naming] Don't flag from imports following conventional import names (N817) (#12946)pylint] - Allow __new__ methods to have cls as their first argument even if decorated with @staticmethod for bad-staticmethod-argument (PLW0211) (#12958)hyperfine installation instructions; update hyperfine code samples (#13034)PT001 as per the new default behavior (#13019)perflint] Improve docs for try-except-in-loop (PERF203) (#12947)pydocstyle] Add reference to lint.pydocstyle.ignore-decorators setting to rule docs (#12996)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.2/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.2/ruff-installer.ps1 | iex"
This is a hotfix release to address an issue with ruff-pre-commit. In v0.6, Ruff changed its behavior to lint and format Jupyter notebooks by default;
This is a hotfix release to address an issue with ruff-pre-commit. In v0.6, Ruff changed its behavior to lint and format Jupyter notebooks by default; however, due to an oversight, these files were still excluded by default if Ruff was run via pre-commit, leading to inconsistent behavior. This has now been fixed.
fastapi] Implement fast-api-unused-path-parameter (FAST003) (#12638)pylint] Rename too-many-positional to too-many-positional-arguments (R0917) (#12905)flake8-naming]: Respect import conventions (N817) (#12922)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.1/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.1/ruff-installer.ps1 | iex"
The following rules are now deprecated:
Check out the blog post for a migration guide and overview of the changes!
See also, the "Remapped rules" section which may result in disabled rules.
src layouts by default for isort rules (#12848)PT001 and PT023 now default to omitting the decorator parentheses when there are no arguments (#12838).The following rules are now deprecated:
pytest-missing-fixture-name-underscore (PT004)pytest-incorrect-fixture-name-underscore (PT005)unpacked-list-comprehension (UP027)The following rules have been remapped to new rule codes:
unnecessary-dict-comprehension-for-iterable: RUF025 to C420The following rules have been stabilized and are no longer in preview:
singledispatch-method (PLE1519)singledispatchmethod-function (PLE1520)bad-staticmethod-argument (PLW0211)if-stmt-min-max (PLR1730)invalid-bytes-return-type (PLE0308)invalid-hash-return-type (PLE0309)invalid-index-return-type (PLE0305)invalid-length-return-type (E303)self-or-cls-assignment (PLW0642)byte-string-usage (PYI057)duplicate-literal-member (PYI062)redirected-noqa (RUF101)The following behaviors have been stabilized:
cancel-scope-no-checkpoint (ASYNC100): Support asyncio and anyio context mangers.async-function-with-timeout (ASYNC109): Support asyncio and anyio context mangers.async-busy-wait (ASYNC110): Support asyncio and anyio context mangers.async-zero-sleep (ASYNC115): Support anyio context mangers.long-sleep-not-forever (ASYNC116): Support anyio context mangers.The following fixes have been stabilized:
superfluous-else-return (RET505)superfluous-else-raise (RET506)superfluous-else-continue (RET507)superfluous-else-break (RET508)flake8-simplify] Further simplify to binary in preview for (SIM108) (#12796)pyupgrade] Show violations without auto-fix (UP031) (#11229)flake8-import-conventions] Add xml.etree.ElementTree to default conventions (#12455)flake8-pytest-style] Add a space after comma in CSV output (PT006) (#12853)flake8-async] Do not lint yield in context manager (ASYNC100) (#12896)flake8-comprehensions] Do not lint async for comprehensions (C419) (#12895)flake8-return] Only add return None at end of a function (RET503) (#11074)flake8-type-checking] Avoid treating dataclasses.KW_ONLY as typing-only (TCH003) (#12863)pep8-naming] Treat type(Protocol) et al as metaclass base (N805) (#12770)pydoclint] Don't enforce returns and yields in abstract methods (DOC201, DOC202) (#12771)ruff] Skip tuples with slice expressions in (RUF031) (#12768)ruff] Ignore unparenthesized tuples in subscripts when the subscript is a type annotation or type alias (RUF031) (#12762)ruff] Ignore template strings passed to logging and builtins._() calls (RUF027) (#12889)ruff] Do not remove parens for tuples with starred expressions in Python <=3.10 (RUF031) (#12784)kernelspec notebook metadata when detecting the preferred language for a Jupyter Notebook (#12875)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.6.0/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.6.0/ruff-installer.ps1 | iex"
\[flake8-comprehensions\] Account for list and set comprehensions in unnecessary-literal-within-tuple-call (C409)
flake8-comprehensions] Account for list and set comprehensions in unnecessary-literal-within-tuple-call (C409) (#12657)flake8-pyi] Add autofix for future-annotations-in-stub (PYI044) (#12676)flake8-return] Avoid syntax error when auto-fixing RET505 with mixed indentation (space and tabs) (#12740)pydoclint] Add docstring-missing-yields (DOC402) and docstring-extraneous-yields (DOC403) (#12538)pydoclint] Avoid DOC201 if docstring begins with "Return", "Returns", "Yield", or "Yields" (#12675)pydoclint] Deduplicate collected exceptions after traversing function bodies (DOC501) (#12642)pydoclint] Ignore DOC errors for stub functions (#12651)pydoclint] Teach rules to understand reraised exceptions as being explicitly raised (DOC501, DOC502) (#12639)ruff] Implement incorrectly-parenthesized-tuple-in-subscript (RUF031) (#12480)ruff] Mark RUF023 fix as unsafe if __slots__ is not a set and the binding is used elsewhere (#12692)refurb] Add autofix for implicit-cwd (FURB177) (#12708)ruff] Add autofix for zip-instead-of-pairwise (RUF007) (#12663)tryceratops] Add BaseException to raise-vanilla-class rule (TRY002) (#12620)pyproject.toml files (#12727)flake8-async] Fix false positives with multiple async with items (ASYNC100) (#12643)flake8-bandit] Avoid false-positives for list concatenations in SQL construction (S608) (#12720)flake8-bugbear] Treat return as equivalent to break (B909) (#12646)flake8-comprehensions] Set comprehensions not a violation for sum in unnecessary-comprehension-in-call (C419) (#12691)flake8-simplify] Parenthesize conditions based on precedence when merging if arms (SIM114) (#12737)pydoclint] Try both 'Raises' section styles when convention is unspecified (DOC501) (#12649)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.7/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.7/ruff-installer.ps1 | iex"
Ruff 0.5.6 automatically enables linting and formatting of notebooks in *preview mode*. You can opt-out of this behavior by adding *.ipynb to the exte
Ruff 0.5.6 automatically enables linting and formatting of notebooks in preview mode.
You can opt-out of this behavior by adding *.ipynb to the extend-exclude setting.
[tool.ruff]
extend-exclude = ["*.ipynb"]
flake8-builtins] Implement import, lambda, and module shadowing (#12546)pydoclint] Add docstring-missing-returns (DOC201) and docstring-extraneous-returns (DOC202) (#12485)flake8-return] Exempt cached properties and other property-like decorators from explicit return rule (RET501) (#12563)$/logTrace for server trace logs in Zed and VS Code (#12564)flake8-implicit-str-concat] Always allow explicit multi-line concatenations when implicit concatenations are banned (#12532)flake8-async] Avoid flagging asyncio.timeouts as unused when the context manager includes asyncio.TaskGroup (#12605)flake8-slots] Avoid recommending __slots__ for classes that inherit from more than namedtuple (#12531)isort] Avoid marking required imports as unused (#12537)isort] Preserve trailing inline comments on import-from statements (#12498)pycodestyle] Add newlines before comments (E305) (#12606)pycodestyle] Don't attach comments with mismatched indents (#12604)pyflakes] Fix preview-mode bugs in F401 when attempting to autofix unused first-party submodule imports in an __init__.py file (#12569)pylint] Respect start index in unnecessary-list-index-lookup (#12603)pyupgrade] Avoid recommending no-argument super in slots=True dataclasses (#12530)pyupgrade] Use colon rather than dot formatting for integer-only types (#12534)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.6/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.6/ruff-installer.ps1 | iex"
Add note about the breaking change in nvim-lspconfig
fastapi] Implement fastapi-redundant-response-model (FAST001) and fastapi-non-annotated-dependency(FAST002) (#11579)pydoclint] Implement docstring-missing-exception (DOC501) and docstring-extraneous-exception (DOC502) (#11471)numpy] Fix NumPy 2.0 rule for np.alltrue and np.sometrue (#12473)numpy] Ignore NPY201 inside except blocks for compatibility with older numpy versions (#12490)pep8-naming] Avoid applying ignore-names to self and cls function names (N804, N805) (#12497)Ord implementation of cmp_fix (#12471)pydoclint] Fix panic in DOC501 reported in #12428 (#12435)flake8-bugbear] Allow singleton tuples with starred expressions in B013 (#12484)nvim-lspconfig (#12507)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.5/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.5/ruff-installer.ps1 | iex"
\[ruff\] Rename RUF007 to zip-instead-of-pairwise
ruff] Rename RUF007 to zip-instead-of-pairwise (#12399)flake8-builtins] Avoid shadowing diagnostics for @override methods (#12415)flake8-comprehensions] Insert parentheses for multi-argument generators (#12422)pydocstyle] Handle escaped docstrings within docstring (D301) (#12192)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.4/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.4/ruff-installer.ps1 | iex"
Ruff 0.5.3 marks the stable release of the Ruff language server and introduces revamped [documentation](https://docs.astral.sh/ruff/editors), includin
Ruff 0.5.3 marks the stable release of the Ruff language server and introduces revamped documentation, including setup guides for your editor of choice and the language server itself.
pyupgrade] Implement unnecessary-default-type-args (UP043) (#12371)flake8-bugbear] Detect enumerate iterations in loop-iterator-mutation (B909) (#12366)flake8-bugbear] Remove discard, remove, and pop allowance for loop-iterator-mutation (B909) (#12365)pylint] Allow repeated-equality-comparison for mixed operations (PLR1714) (#12369)pylint] Ignore self and cls when counting arguments (PLR0913) (#12367)pylint] Use UTF-8 as default encoding in unspecified-encoding fix (PLW1514) (#12370)--preview flag for server subcommand for the linter and formatter (#12208)flake8-comprehensions] Allow additional arguments for sum and max comprehensions (C419) (#12364)pylint] Avoid dropping extra boolean operations in repeated-equality-comparison (PLR1714) (#12368)pylint] Consider expression before statement when determining binding kind (PLR1704) (#12346)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.3/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.3/ruff-installer.ps1 | iex"
Use space separator before parenthesized expressions in comprehensions with leading comments
space separator before parenthesized expressions in comprehensions with leading comments (#12282)flake8-async] Update ASYNC100 to include anyio and asyncio (#12221)flake8-async] Update ASYNC109 to include anyio and asyncio (#12236)flake8-async] Update ASYNC110 to include anyio and asyncio (#12261)flake8-async] Update ASYNC115 to include anyio and asyncio (#12262)flake8-async] Update ASYNC116 to include anyio and asyncio (#12266)flake8-return] Exempt properties from explicit return rule (RET501) (#12243)numpy] Add np.NAN-to-np.nan diagnostic (#12292)refurb] Make list-reverse-copy an unsafe fix (#12303)include and extend-include settings in native server (#12252)D203 (#12238)not operations as boolean tests (#12301)flake8-bandit] Avoid S310 violations for HTTP-safe f-strings (#12305)flake8-bandit] Support explicit string concatenations in S310 HTTP detection (#12315)flake8-bandit] fix S113 false positive for httpx without timeout argument (#12213)pycodestyle] Remove "non-obvious" allowance for E721 (#12300)pyflakes] Consider with blocks as single-item branches for redefinition analysis (#12311)refurb] Restrict forwarding for newline argument in open() calls to Python versions >= 3.10 (#12244)--output-format full default (#12248)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.2/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.2/ruff-installer.ps1 | iex"
\[numpy\] Update NPY201 to include exception deprecations
flake8-bugbear] Implement mutable-contextvar-default (B039) (#12113)pycodestyle] Whitespace after decorator (E204) (#12140)pytest] Reverse PT001 and PT0023 defaults (#12106)flake8-bandit] Detect httpx for S113 (#12174)numpy] Update NPY201 to include exception deprecations (#12065)pylint] Generate autofix for duplicate-bases (PLE0241) (#12105)requires-python inference robust to == (#12091)str-width (#12135)pycodestyle] Avoid E275 if keyword followed by comma (#12136)pycodestyle] Avoid E275 if keyword is followed by a semicolon (#12095)pylint] Skip dummy variables for PLR1704 (#12190)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.1/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.1/ruff-installer.ps1 | iex"
Selecting ALL now excludes deprecated rules
Check out the blog post for a migration guide and overview of the changes!
See also, the "Remapped rules" section which may result in disabled rules.
ALL now excludes deprecated rules--strip-components=1 when untarring./latest URLs on GitHub.flake8-bandit rules were modified (#10667).The following rules are now deprecated:
syntax-error (E999): Syntax errors are now always shownThe following rules have been remapped to new rule codes:
blocking-http-call-in-async-function: ASYNC100 to ASYNC210open-sleep-or-subprocess-in-async-function: ASYNC101 split into ASYNC220, ASYNC221, ASYNC230, and ASYNC251blocking-os-call-in-async-function: ASYNC102 has been merged into ASYNC220 and ASYNC221trio-timeout-without-await: TRIO100 to ASYNC100trio-sync-call: TRIO105 to ASYNC105trio-async-function-with-timeout: TRIO109 to ASYNC109trio-unneeded-sleep: TRIO110 to ASYNC110trio-zero-sleep-call: TRIO115 to ASYNC115repeated-isinstance-calls: PLR1701 to SIM101The following rules have been stabilized and are no longer in preview:
mutable-fromkeys-value (RUF024)default-factory-kwarg (RUF026)django-extra (S610)manual-dict-comprehension (PERF403)print-empty-string (FURB105)readlines-in-for (FURB129)if-expr-min-max (FURB136)bit-count (FURB161)redundant-log-base (FURB163)regex-flag-alias (FURB167)isinstance-type-none (FURB168)type-none-comparison (FURB169)implicit-cwd (FURB177)hashlib-digest-hex (FURB181)list-reverse-copy (FURB187)bad-open-mode (PLW1501)empty-comment (PLR2044)global-at-module-level (PLW0604)misplaced-bare-raise (PLE0744)non-ascii-import-name (PLC2403)non-ascii-name (PLC2401)nonlocal-and-global (PLE0115)potential-index-error (PLE0643)redeclared-assigned-name (PLW0128)redefined-argument-from-local (PLR1704)repeated-keyword-argument (PLE1132)super-without-brackets (PLW0245)unnecessary-list-index-lookup (PLR1736)useless-exception-statement (PLW0133)useless-with-lock (PLW2101)The following behaviors have been stabilized:
is-literal (F632) now warns for identity checks against list, set or dictionary literalsneedless-bool (SIM103) now detects if expressions with implicit else branchesmodule-import-not-at-top-of-file (E402) now allows os.environ modifications between import statementstype-comparison (E721) now allows idioms such as type(x) is intyoda-condition (SIM300) now flags a wider range of expressionsThe following deprecated settings have been removed:
output-format=text; use output-format=concise or output-format=fulltab-size; use indent-widthThe following deprecated CLI options have been removed:
--show-source; use --output-format=full--no-show-source; use --output-format=conciseThe following deprecated CLI commands have been removed:
ruff <path>; use ruff check <path>ruff --clean; use ruff cleanruff --generate-shell-completion; use ruff generate-shell-completionruff] Add assert-with-print-message rule (#11981)--statistics (#11697)full by default (#12010)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)logFile (#11945)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)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.5.0/ruff-installer.sh | sh
powershell -c "irm https://github.com/astral-sh/ruff/releases/download/0.5.0/ruff-installer.ps1 | iex"
Implement re-lexing logic for better error recovery
flake8-copyright] Update CPY001 to check the first 4096 bytes instead of 1024 (#11927)pycodestyle] Update E999 to show all syntax errors instead of just the first one (#11900)\[pylint\] Implement consider-dict-items (C0206)
pylint] Implement consider-dict-items (C0206) (#11688)refurb] Implement repeated-global (FURB154) (#11187)pycodestyle] Adapt fix for E203 to work identical to ruff format (#10999)ruff server (#11800)ruff.printDebugInformation command (#11831)refurb] Avoid suggesting starmap when arguments are used outside call (FURB140) (#11830)flake8-bugbear] Avoid panic in B909 when checking large loop blocks (#11772)refurb] Fix misbehavior of operator.itemgetter when getter param is a tuple (FURB118) (#11774)Linter performance has been improved by around 10% on some microbenchmarks by refactoring the lexer and parser to maintain synchronicity between them
flake8-bugbear] Implement return-in-generator (B901) (#11644)flake8-pyi] Implement PYI063 (#11699)pygrep_hooks] Check blanket ignores via file-level pragmas (PGH004) (#11540)pyupgrade] Update UP035 for Python 3.13 and the latest version of typing_extensions (#11693)numpy] Update NPY001 rule for NumPy 2.0 (#11735)--output-format flag (#11682)pyupgrade] Write empty string in lieu of panic when fixing UP032 (#11696)flake8-simplify] Simplify double negatives in SIM103 (#11684)type statements (#11720)\[flake8-pyi\] Implement PYI064
flake8-pyi] Implement PYI064 (#11325)flake8-pyi] Implement PYI066 (#11541)flake8-pyi] Implement PYI057 (#11486)pyflakes] Enable F822 in __init__.py files by default (#11370)ruff server (#11590)ruff server (#11615)flake8-comprehension] Strip parentheses around generators in C400 (#11607)repeated-isinstance-calls as unsafe on Python 3.10 and later (#11622)Use project-relative paths when calculating GitLab fingerprints
flake8-async] Sleep with >24 hour interval should usually sleep forever (ASYNC116) (#11498)numpy] Add missing functions to NumPy 2.0 migration rule (#11528)mccabe] Consider irrefutable pattern similar to if .. else for C901 (#11565)match-case statements for C901, PLR0912, and PLR0915 (#11521)UP032) (#11524)flake8-bandit] request-without-timeout should warn for requests.request (#11548)flake8-self] Ignore sunder accesses in flake8-self rules (#11546)pyupgrade] Lint for TypeAliasType usages (UP040) (#11530)ruff server configuration discovery (#11551)ruff server correctly treats .pyi files as stub files (#11535)ruff server searches for configuration in parent directories (#11537)ruff server: An empty code action filter no longer returns notebook source actions (#11526)flake8-logging-format] Fix autofix title in logging-warn (G010) (#11514)refurb] Avoid recommending operator.itemgetter with dependence on lambda arguments (#11574)flake8-simplify] Avoid recommending context manager in __enter__ implementations (#11575)--output-file (#11550)singledispatch arguments as runtime-required (#11523)\[pyflakes\] Update documentation and deprecate ignore_init_module_imports
v0.4.5 marks the official Beta release of ruff server, an integrated language server built into Ruff. ruff server supports the same feature set as ruff-lsp, powering linting, formatting, and code fixes in Ruff's editor integrations -- but with superior performance and no installation required. We'd love your feedback!
You can enable ruff server in the VS Code extension today.
To read more about this exciting milestone, check out our blog post!
flake8-future-annotations] Reword future-rewritable-type-annotation (FA100) message (#11381)isort] Expanded the set of standard-library modules to include _string, etc. (#11374)pycodestyle] Consider soft keywords for E27 rules (#11446)pyflakes] Recommend adding unused import bindings to __all__ (#11314)pyflakes] Update documentation and deprecate ignore_init_module_imports (#11436)pyupgrade] Mark quotes as unnecessary for non-evaluated annotations (#11485)quote-style = preserve (#11490)noqa comment code actions (#11276)--output-format as a CLI option for ruff config (#11438)PLE0237 for property with setter (#11377)TCH005 for if stmt with elif/else block (#11376)__future__ annotations as required for non-evaluated type annotations (#11414)flake8-pie] Preserve parentheses in unnecessary-dict-kwargs (#11372)pylint] Ignore __slots__ with dynamic values (#11488)pylint] Remove try body from branch counting (#11487)refurb] Respect operator precedence in FURB110 (#11464)--preview to the README (#11395)pycodestyle] Clarify motivation for E713 and E714 (#11483)pyflakes] Update docs to describe WAI behavior (F541) (#11362)pylint] Clearly indicate what is counted as a branch (#11423)\[pycodestyle\] Ignore end-of-line comments when determining blank line rules
pycodestyle] Ignore end-of-line comments when determining blank line rules (#11342)pylint] Detect pathlib.Path.open calls in unspecified-encoding (PLW1514) (#11288)flake8-pyi] Implement PYI059 (generic-not-last-base-class) (#11233)flake8-pyi] Implement PYI062 (duplicate-literal-member) (#11269)flake8-boolean-trap] Allow passing booleans as positional-only arguments in code such as set(True) (#11287)flake8-bugbear] Ignore enum classes in cached-instance-method (B019) (#11312)ruff server hanging after Neovim closes (#11291)pylint] Consider with statements for too-many-branches (PLR0912) (#11321)flake8-blind-except, tryceratops] Respect logged and re-raised expressions in nested statements (BLE001, TRY201) (#11301)__all__ = builtins.list(["foo", "bar"]) as valid __all__ definitions (#11335)\[refurb\] Use function range for reimplemented-operator diagnostics
refurb] Use function range for reimplemented-operator diagnostics (#11271)refurb] Ignore methods in reimplemented-operator (FURB118) (#11270)refurb] Implement fstring-number-format (FURB116) (#10921)ruff] Implement redirected-noqa (RUF101) (#11052)pyflakes] Distinguish between first-party and third-party imports for fix suggestions (#11168)flake8-bugbear] Ignore non-abstract class attributes when enforcing B024 (#11210)flake8-logging] Include inline instantiations when detecting loggers (#11154)pylint] Also emit PLR0206 for properties with variadic parameters (#11200)ruff] Detect duplicate codes as part of unused-noqa (RUF100) (#10850)ruff server setup guide for Helix (#11183)ruff server no longer hangs after shutdown (#11222)ruff server reads from a configuration TOML file in the user configuration directory if no local configuration exists (#11225)ruff server respects per-file-ignores configuration (#11224)ruff server: Support a custom TOML configuration file (#11140)ruff server: Support setting to prioritize project configuration over editor configuration (#11086)pyflakes] Prioritize redefined-while-unused over unused-import (#11173)ruff] Respect async expressions in comprehension bodies (#11219)pygrep_hooks] Fix blanket-noqa panic when last line has noqa with no newline (PGH004) (#11108)perflint] Ignore list-copy recommendations for async for loops (#11250)pyflakes] Improve invalid-print-syntax documentation (#11171)\[flake8-pyi\] Allow for overloaded __exit__ and __aexit__ definitions (PYI036)
flake8-pyi] Allow for overloaded __exit__ and __aexit__ definitions (PYI036) (#11057)pyupgrade] Catch usages of "%s" % var and provide an unsafe fix (UP031) (#11019)refurb] Implement new rule that suggests min/max over sorted() (FURB192) (#10868)noqa codes (#11096)macos-12 for building release wheels to enable macOS 11 compatibility (#11146)flake8-blind-expect] Allow raise from in BLE001 (#11131)flake8-pyi] Allow simple assignments to None in enum class scopes (PYI026) (#11128)flake8-simplify] Avoid raising SIM911 for non-zip attribute calls (#11126)refurb] Avoid operator.itemgetter suggestion for single-item tuple (#11095)ruff] Respect per-file-ignores for RUF100 with no other diagnostics (#11058)ruff] Fix async comprehension false positive (RUF029) (#11070)flake8-bugbear] Document explicitly disabling strict zip (B905) (#11040)flake8-type-checking] Mention lint.typing-modules in TCH001, TCH002, and TCH003 (#11144)isort] Improve documentation around custom isort sections (#11050)pylint] Fix documentation oversight for invalid-X-returns (#11094)matchit to resolve per-file settings (#11111)\[pylint\] Implement invalid-hash-returned (PLE0309)
pylint] Implement invalid-hash-returned (PLE0309) (#10961)pylint] Implement invalid-index-returned (PLE0305) (#10962)pylint] Allow NoReturn-like functions for __str__, __len__, etc. (PLE0307) (#11017)ruff] Ignore stub functions in unused-async (RUF029) (#11026)Ruff's new parser is >2x faster, which translates to a 20-40% speedup for all linting and formatting invocations. There's a lot to say about this exci
Ruff's new parser is >2x faster, which translates to a 20-40% speedup for all linting and formatting invocations. There's a lot to say about this exciting change, so check out the blog post for more details!
See #10036 for implementation details.
With this release, we also want to highlight our new language server. ruff server is a Rust-powered language server that comes built-in with Ruff. It can be used with any editor that supports the Language Server Protocol (LSP). It uses a multi-threaded, lock-free architecture inspired by rust-analyzer and it will open the door for a lot of exciting features. It’s also faster than our previous Python-based language server -- but you probably guessed that already.
ruff server is only in alpha, but it has a lot of features that you can try out today:
ruff.applyAutofix, ruff.applyFormat, and ruff.applyOrganizeImportssource.fixAll and source.organizeImports source actionsTo setup ruff server with your editor, refer to the README.md.
pycodestyle] Do not trigger E3 rules on defs following a function/method with a dummy body (#10704)pylint] Implement invalid-bytes-returned (E0308) (#10959)pylint] Implement invalid-length-returned (E0303) (#10963)pylint] Implement self-cls-assignment (W0642) (#9267)pylint] Omit stubs from invalid-bool and invalid-str-return-type (#11008)ruff] New rule unused-async (RUF029) to detect unneeded async keywords on functions (#9966)flake8-bandit] Allow urllib.request.urlopen calls with static Request argument (S310) (#10964)flake8-bugbear] Treat raise NotImplemented-only bodies as stub functions (B006) (#10990)flake8-slots] Respect same-file Enum subclasses (SLOT000) (#11006)pylint] Support inverted comparisons (PLR1730) (#10920)--show-settings (#11003)BuiltinTypeChecker (#10976)RuleTable::any_enabled (#10971)This section is devoted to updates for our new language server, written in Rust.
RUFF_OUTPUT_FILE environment variable support (#10992)non-augmented-assignment for reversed, non-commutative operators (PLR6104) (#10909)PLR6104) (#10912)per-file-ignores for RUF100 on blanket # noqa (#10908)if expression for parenthesized with items parsing (#11010)FOR_TARGET context for all kinds of parentheses (#11009)\[flake8-bugbear\] Implement loop-iterator-mutation (B909)
flake8-bugbear] Implement loop-iterator-mutation (B909) (#9578)pylint] Implement rule to prefer augmented assignment (PLR6104) (#9932)pylint] Recode nan-comparison rule to W0177 (#10894)pylint] Reverse min-max logic in if-stmt-min-max (#10890)\[pylint\] Implement bad-staticmethod-argument (PLW0211)
pylint] Implement bad-staticmethod-argument (PLW0211) (#10781)pylint] Implement if-stmt-min-max (PLR1730, PLR1731) (#10002)pyupgrade] Replace str,Enum multiple inheritance with StrEnum UP042 (#10713)refurb] Implement if-expr-instead-of-or-operator (FURB110) (#10687)refurb] Implement int-on-sliced-str (FURB166) (#10650)refurb] Implement write-whole-file (FURB103) (#10802)refurb] Support itemgetter in reimplemented-operator (FURB118) (#10526)flake8_comprehensions] Add sum/min/max to unnecessary comprehension check (C419) (#10759)pydocstyle] Require capitalizing docstrings where the first sentence is a single word (D403) (#10776)pycodestyle] Ignore annotated lambdas in class scopes (E731) (#10720)flake8-pyi] Various improvements to PYI034 (#10807)flake8-slots] Flag subclasses of call-based typing.NamedTuples as well as subclasses of collections.namedtuple() (SLOT002) (#10808)pyflakes] Allow forward references in class bases in stub files (F821) (#10779)pygrep-hooks] Improve blanket-noqa error message (PGH004) (#10851)FORCE_COLOR env var (#10839)[extend-]per-file-ignores (#10852)flake8-import-conventions] Accept non-aliased (but correct) import in unconventional-import-alias (ICN001) (#10729)flake8-quotes] Add semantic model flag when inside f-string replacement field (#10766)pep8-naming] Recursively resolve TypeDicts for N815 violations (#10719)flake8-quotes] Respect Q00* ignores in flake8-quotes rules (#10728)flake8-simplify] Show negated condition in needless-bool diagnostics (SIM103) (#10854)ruff] Use within-scope shadowed bindings in asyncio-dangling-task (RUF006) (#10793)flake8-pytest-style] Fix single-tuple conversion in pytest-parametrize-values-wrong-type (PT007) (#10862)flake8-return] Ignore assignments to annotated variables in unnecessary-assign (RET504) (#10741)refurb] Do not allow any keyword arguments for read-whole-file in rb mode (FURB101) (#10803)pylint] Don't recommend decorating staticmethods with @singledispatch (PLE1519, PLE1520) (#10637)pydocstyle] Use section name range for all section-related docstring diagnostics (#10740)# noqa directives on __all__ openers (#10798)\[pylint\] Implement modified-iterating-set (E4703)
pylint] Implement modified-iterating-set (E4703) (#10473)refurb] Implement for-loop-set-mutations (FURB142) (#10583)refurb] Implement unnecessary-from-float (FURB164) (#10647)refurb] Implement verbose-decimal-constructor (FURB157) (#10533)flake8-comprehensions] Handled special case for C401 which also matches C416 (#10596)flake8-pyi] Mark unaliased-collections-abc-set-import fix as "safe" for more cases in stub files (PYI025) (#10547)numpy] Add row_stack to NumPy 2.0 migration rule (#10646)pycodestyle] Allow cell magics before an import (E402) (#10545)pycodestyle] Avoid blank line rules for the first logical line in cell (#10291)flake8-boolean-trap] Add setting for user defined allowed boolean trap (#10531)__all__ definitions when renaming symbols in autofixes (#10527)__all__ definitions (#10525)flake8-bugbear] Avoid false positive for usage after continue (B031) (#10539)flake8-copyright] Accept commas in default copyright pattern (#9498)flake8-datetimez] Allow f-strings with %z for DTZ007 (#10651)flake8-pytest-style] Fix PT014 autofix for last item in list (#10532)flake8-quotes] Ignore Q000, Q001 when string is inside forward ref (#10585)isort] Always place non-relative imports after relative imports (#10669)isort] Respect Unicode characters in import sorting (#10529)pyflakes] Fix F821 false negatives when from __future__ import annotations is active (attempt 2) (#10524)pyflakes] Make unnecessary-lambda an always-unsafe fix (#10668)pylint] Fixed false-positive on the rule PLW1641 (eq-without-hash) (#10566)ruff] Fix panic in unused # noqa removal with multi-byte space (RUF100) (#10682)CONTRIBUTING.md (#10665)flake8-logging next to the other flake8 plugins in registry (#10587)flake8-bandit] Update warning message for rule S305 to address insecure block cipher mode use (#10602)flake8-bugbear] Document use of anonymous assignment in useless-expression (#10551)flake8-datetimez] Clarify error messages and docs for DTZ rules (#10621)pycodestyle] Use same before vs. after numbers for space-around-operator (#10640)ruff] Change quadratic-list-summation docs to use iadd consistently (#10666)\[flake8-simplify\] Detect implicit else cases in needless-bool (SIM103)
flake8-simplify] Detect implicit else cases in needless-bool (SIM103) (#10414)pylint] Implement nan-comparison (PLW0117) (#10401)pylint] Implement nonlocal-and-global (E115) (#10407)pylint] Implement singledispatchmethod-function (PLE5120) (#10428)refurb] Implement list-reverse-copy (FURB187) (#10212)flake8-pytest-style] Add automatic fix for pytest-parametrize-values-wrong-type (PT007) (#10461)pycodestyle] Allow SPDX license headers to exceed the line length (E501) (#10481)C409) (#10491)name from being reformatted (#10442)W605 (#10480).pyi files (#10512)E231 bug: Inconsistent catch compared to pycodestyle, such as when dict nested in list (#10469)Options references to blank line docs (#10498)from __future__ import annotations is active (#10362)"' (#10513)flake8-bugbear] Allow tuples of exceptions (B030) (#10437)flake8-quotes] Avoid syntax errors due to invalid quotes (Q000, Q002) (#10199)\[flake8-bandit\]: Implement S610 rule
flake8-bandit]: Implement S610 rule (#10316)pycodestyle] Implement blank-line-at-end-of-file (W391) (#10243)pycodestyle] Implement redundant-backslash (E502) (#10292)pylint] - implement redeclared-assigned-name (W0128) (#9268)flake8_comprehensions] Handled special case for C400 which also matches C416 (#10419)flake8-bandit] Implement upstream updates for S311, S324 and S605 (#10313)pyflakes] Remove F401 fix for __init__ imports by default and allow opt-in to unsafe fix (#10365)pylint] Implement invalid-bool-return-type (E304) (#10377)pylint] Include builtin warnings in useless-exception-statement (PLW0133) (#10394)ruff check (#8631)PIE970] Allow trailing ellipsis in typing.TYPE_CHECKING (#10413)TRIO115 if the argument is a variable (#10376)F811] Avoid removing shadowed imports that point to different symbols (#10387)F821 and F822 false positives in .pyi files (#10341)F821 false negatives in .py files when from __future__ import annotations is active (#10362)Indexer fails to identify continuation preceded by newline #10351 (#10354)Settings display (#10370)C413] Wrap expressions in parentheses when negating (#10346)pycodestyle] Do not ignore lines before the first logical line in blank lines rules. (#10382)pycodestyle] Do not trigger E225 and E275 when the next token is a ')' (#10315)pylint] Avoid false-positive slot non-assignment for __dict__ (PLE0237) (#10348)ruff.toml format in README (#10393)RUF008] Make it clearer that a mutable default in a dataclass is only valid if it is typed as a ClassVar (#10395)pylint] Extend docs and test in invalid-str-return-type (E307) (#10400). from check and format commands (#10217)Improve single-with item formatting for Python 3.8 or older
with item formatting for Python 3.8 or older (#10276)pyupgrade] Allow fixes for f-string rule regardless of line length (UP032) (#10263)pycodestyle] Include actual conditions in E712 diagnostics (#10254)with items formatting (#10274)Parameter range for *args and **kwargs (#10283)typing.Annotated subscripts as type definitions (#10285)\[pycodestyle\] Fix E301 not triggering on decorated methods.
pycodestyle] Fix E301 not triggering on decorated methods. (#10117)pycodestyle] Respect isort settings in blank line rules (E3*) (#10096)pycodestyle] Make blank lines in typing stub files optional (E3*) (#10098)pylint] Implement singledispatch-method (E1519) (#10140)pylint] Implement useless-exception-statement (W0133) (#10176)flake8-debugger] Check for use of debugpy and ptvsd debug modules (#10177) (#10194)pyupgrade] Generate diagnostic for all valid f-string conversions regardless of line length (UP032) (#10238)pep8_naming] Add fixes for N804 and N805 (#10215)ruff format --diff (#10110)--config and --isolated global flags (#10150)--config (#10219)required-version (#10216)default-section setting (#10149)CapWords message (#10220)flake8-raise] Avoid false-positives for parens-on-raise with future.exception() (RSE102) (#10206)pylint] Add fix for unary expressions in PLC2801 (#9587)ruff] Fix RUF028 not allowing # fmt: skip on match cases (#10178)Deprecate ruff , ruff --explain, ruff --clean, and ruff --generate-shell-completion in favor of ruff check , ruff rule, ruff clean, and ruff generate-…
This release introduces the new Ruff formatter 2024.2 style and adds a new lint rule to detect invalid formatter suppression comments.
flake8-bandit] Remove suspicious-lxml-import (S410) (#10154)pycodestyle] Allow os.environ modifications between imports (E402) (#10066)pycodestyle] Don't warn about a single whitespace character before a comma in a tuple (E203) (#10094)eradicate] Detect commented out case statements (ERA001) (#10055)eradicate] Detect single-line code for try:, except:, etc. (ERA001) (#10057)flake8-boolean-trap] Allow boolean positionals in __post_init__ (#10027)flake8-copyright] Allow © in copyright notices (#10065)isort]: Use one blank line after imports in typing stub files (#9971)pylint] New Rule dict-iter-missing-items (PLE1141) (#9845)pylint] Ignore sys.version and sys.platform (PLR1714) (#10054)pyupgrade] Detect literals with unary operators (UP018) (#10060)ruff] Expand rule for list(iterable).pop(0) idiom (RUF015) (#10148)This release introduces the Ruff 2024.2 style, stabilizing the following changes:
with parentheses when targeting Python 3.9 or newer (#9222)...) in typing stub files (#9155)...) body (#7440, #9240)extend as part of a --config flag (#10135)build from the default exclusion list (#10093)ruff <path>, ruff --explain, ruff --clean, and ruff --generate-shell-completion in favor of ruff check <path>, ruff rule, ruff clean, and ruff generate-shell-completion (#10169)--format from ruff rule and ruff linter (#10170)flake8-bugbear] Avoid adding default initializers to stubs (B006) (#10152)flake8-type-checking] Respect runtime-required decorators for function signatures (#10091)pycodestyle] Mark fixes overlapping with a multiline string as unsafe (W293) (#10049)pydocstyle] Trim whitespace when removing blank lines after section (D413) (#10162)pylint] Delete entire statement, including semicolons (PLR0203) (#10074)ruff] Avoid f-string false positives in gettext calls (RUF027) (#10118)ruff crashing on PowerPC systems because of too small page size (#10080)line-length option: fix link to pycodestyle.max-line-length (#10136)\[numpy\] Add missing deprecation violations (NPY002)
Highlights include:
--preview).--config
argument (e.g., --config "lint.isort.combine-as-imports=false").pycodestyle] Add blank line(s) rules (E301, E302, E303, E304, E305, E306) (#9266)refurb] Implement readlines_in_for (FURB129) (#9880)ruff] Ensure closing parentheses for multiline sequences are always on their own line (RUF022, RUF023) (#9793)numpy] Add missing deprecation violations (NPY002) (#9862)flake8-bandit] Detect mark_safe usages in decorators (#9887)ruff] Expand asyncio-dangling-task (RUF006) to include new_event_loop (#9976)flake8-pyi] Ignore 'unused' private type dicts in class scopes (#9952)indent-style=tabs (#9915)preserve mode (#9922)show-settings filters directory-agnostic (#9866)DebugText (#9953)flake8-simplify] Avoid false positive with async for loops (SIM113) (#9996)flake8-trio] Respect async with in timeout-without-await (#9859)perflint] Catch a wider range of mutations in PERF101 (#9955)pycodestyle] Fix E30X panics on blank lines with trailing white spaces (#9907)pydocstyle] Allow using parameters as a subsection header (D405) (#9894)pydocstyle] Fix blank-line docstring rules for module-level docstrings (#9878)pylint] Accept 0.0 and 1.0 as common magic values (PLR2004) (#9964)pylint] Avoid suggesting set rewrites for non-hashable types (#9956)ruff] Avoid false negatives with string literals inside of method calls (RUF027) (#9865)ruff] Fix panic on with f-string detection (RUF027) (#9990)ruff] Ignore builtins when detecting missing f-strings (#9849)Fix references to deprecated ANN rules in changelog
This release includes support for range formatting (i.e., the ability to format specific lines within a source file).
__get__ and __set__ from unnecessary-dunder-call (#9791)Protocol in ellipsis removal (#9841)C408 (#9822)C400, C401, C410, and C418 (#9819)AhoCorasick to speed up quote match (#9773)C405 and C409 (#9821)zero-sleep-call (#9766)C403 (#9818)max-pos-args example to max-positional-args (#9797)weak_cryptographic_key.rs (#9774)ANN rules in changelog (#9771)max-positional-args (#9838)The following rules are now deprecated:
Check out the blog post for a migration guide and overview of the changes!
NURSERY selector cannot be used anymoreSee also, the "Remapped rules" section which may result in disabled rules.
The following rules are now deprecated:
missing-type-self (ANN101)missing-type-cls (ANN102)The following command line options are now deprecated:
--show-source; use --output-format full instead--no-show-source; use --output-format concise instead--output-format text; use full or concise insteadThe following settings have moved and the previous name is deprecated:
ruff.allowed-confusables → ruff.lint.allowed-confusablesruff.dummy-variable-rgx → ruff.lint.dummy-variable-rgxruff.explicit-preview-rules → ruff.lint.explicit-preview-rulesruff.extend-fixable → ruff.lint.extend-fixableruff.extend-ignore → ruff.lint.extend-ignoreruff.extend-per-file-ignores → ruff.lint.extend-per-file-ignoresruff.extend-safe-fixes → ruff.lint.extend-safe-fixesruff.extend-select → ruff.lint.extend-selectruff.extend-unfixable → ruff.lint.extend-unfixableruff.extend-unsafe-fixes → ruff.lint.extend-unsafe-fixesruff.external → ruff.lint.externalruff.fixable → ruff.lint.fixableruff.flake8-annotations → ruff.lint.flake8-annotationsruff.flake8-bandit → ruff.lint.flake8-banditruff.flake8-bugbear → ruff.lint.flake8-bugbearruff.flake8-builtins → ruff.lint.flake8-builtinsruff.flake8-comprehensions → ruff.lint.flake8-comprehensionsruff.flake8-copyright → ruff.lint.flake8-copyrightruff.flake8-errmsg → ruff.lint.flake8-errmsgruff.flake8-gettext → ruff.lint.flake8-gettextruff.flake8-implicit-str-concat → ruff.lint.flake8-implicit-str-concatruff.flake8-import-conventions → ruff.lint.flake8-import-conventionsruff.flake8-pytest-style → ruff.lint.flake8-pytest-styleruff.flake8-quotes → ruff.lint.flake8-quotesruff.flake8-self → ruff.lint.flake8-selfruff.flake8-tidy-imports → ruff.lint.flake8-tidy-importsruff.flake8-type-checking → ruff.lint.flake8-type-checkingruff.flake8-unused-arguments → ruff.lint.flake8-unused-argumentsruff.ignore → ruff.lint.ignoreruff.ignore-init-module-imports → ruff.lint.ignore-init-module-importsruff.isort → ruff.lint.isortruff.logger-objects → ruff.lint.logger-objectsruff.mccabe → ruff.lint.mccaberuff.pep8-naming → ruff.lint.pep8-namingruff.per-file-ignores → ruff.lint.per-file-ignoresruff.pycodestyle → ruff.lint.pycodestyleruff.pydocstyle → ruff.lint.pydocstyleruff.pyflakes → ruff.lint.pyflakesruff.pylint → ruff.lint.pylintruff.pyupgrade → ruff.lint.pyupgraderuff.select → ruff.lint.selectruff.task-tags → ruff.lint.task-tagsruff.typing-modules → ruff.lint.typing-modulesruff.unfixable → ruff.lint.unfixableThe following rules have been remapped to new codes:
raise-without-from-inside-except: TRY200 to B904suspicious-eval-usage: PGH001 to S307logging-warn: PGH002 to G010static-key-dict-comprehension: RUF011 to B035runtime-string-union: TCH006 to TCH010The following rules have been stabilized and are no longer in preview:
trio-timeout-without-await (TRIO100)trio-sync-call (TRIO105)trio-async-function-with-timeout (TRIO109)trio-unneeded-sleep (TRIO110)trio-zero-sleep-call (TRIO115)unnecessary-escaped-quote (Q004)enumerate-for-loop (SIM113)zip-dict-keys-and-values (SIM911)timeout-error-alias (UP041)flask-debug-true (S201)tarfile-unsafe-members (S202)ssl-insecure-version (S502)ssl-with-bad-defaults (S503)ssl-with-no-version (S504)weak-cryptographic-key (S505)ssh-no-host-key-verification (S507)django-raw-sql (S611)mako-templates (S702)generator-return-from-iter-method (PYI058)runtime-string-union (TCH006)numpy2-deprecation (NPY201)quadratic-list-summation (RUF017)assignment-in-assert (RUF018)unnecessary-key-check (RUF019)never-union (RUF020)direct-logger-instantiation (LOG001)invalid-get-logger-argument (LOG002)exception-without-exc-info (LOG007)undocumented-warn (LOG009)Fixes for the following rules have been stabilized and are now available without preview:
triple-single-quotes (D300)non-pep604-annotation (UP007)dict-get-with-none-default (SIM910)in-dict-keys (SIM118)collapsible-else-if (PLR5501)if-with-same-arms (SIM114)useless-else-on-loop (PLW0120)unnecessary-literal-union (PYI030)unnecessary-spread (PIE800)error-instead-of-exception (TRY400)redefined-while-unused (F811)duplicate-value (B033)multiple-imports-on-one-line (E401)non-pep585-annotation (UP006)Fixes for the following rules have been promoted from unsafe to safe:
unaliased-collections-abc-set-import (PYI025)The following behaviors have been stabilized:
module-import-not-at-top-of-file (E402) allows sys.path modifications between importsreimplemented-container-builtin (PIE807) includes lambdas that can be replaced with dictunnecessary-placeholder (PIE790) applies to unnecessary ellipses (...)if-else-block-instead-of-dict-get (SIM401) applies to if-else expressionsrefurb] Implement metaclass_abcmeta (FURB180) (#9658)blank_line_after_nested_stub_class preview style (#9155)and-or-ternary (PLR1706) was removedflake8-async] Take pathlib.Path into account when analyzing async functions (#9703)flake8-return] - fix indentation syntax error (RET505) (#9705)RUF022, RUF023: never add two trailing commas to the end of a sequence (#9698)RUF023: Don't sort __match_args__, only __slots__ (#9724)flake8-simplify] - Fix syntax error in autofix (SIM114) (#9704)pylint] Show verbatim constant in magic-value-comparison (PLR2004) (#9694)IfExp with dual string arms in invalid-envvar-default (#9734)pylint] Add __mro_entries__ to known dunder methods (PLW3201) (#9706)Error when NURSERY selector is used with --preview
NURSERY selector is used with --preview (#9682)flake8-return] Add fixes for all rules (RET505, RET506, RET507, RET508) (#9595)flake8-simplify] Add fix for if-with-same-arms (SIM114) (#9591)pycodestyle] Add fix for multiple-imports-on-one-line (E401) (#9518)pylint] Add fix for collapsible-else-if (PLR5501) (#9594)pylint] Add fix for useless-else-on-loop (PLW0120) (#9590)pylint] Implement assigning-non-slot (E0237) (#9623)pylint] Implement potential-index-error (PLE0643) (#9545)pylint] Implement too-many-nested-blocks (PLR1702) (#9172)ruff] Add rule to sort __slots__ and __match_args__ (#9564)ruff] Detect unnecessary dict comprehensions for iterables (RUF025) (#9613)ruff] Guard against use of default_factory as a keyword argument (RUF026) (#9651)ruff] Implement mutable-fromkeys-value (RUF024) (#9597)--help output (#9633)flake8-no-pep420] Include global --config when determining namespace packages (#9603)flake8-pie] Omit bound tuples passed to .startswith or .endswith (#9661)flake8-return] Avoid panic when fixing inlined else blocks (#9657)flake8-return] Consider exception suppression in unnecessary assignment (#9673)flake8-return] Take NoReturn annotation into account when analyzing implicit returns (#9636)flake8-simplify] Support inverted returns in needless-bool (SIM103) (#9619)flake8-type-checking] Add Pydantic's BaseConfig to default-copy list (#9650)flake8-type-checking] Avoid marking InitVar as a typing-only annotation (#9688)pycodestyle] Allow dtype comparisons in type-comparison (#9676)pydocstyle] Re-implement last-line-after-section (D413) (#9654)flake8-pytest-style] Add fix safety documentation for duplicate-parameterize-test-cases (#9678)pylint] Document literal-membership fix safety conditions (#9677)isort] Fix reference to isort rule code (#9598)\[pygrep_hooks\] Add fix for deprecated-log-warn (PGH002)
flake8-bugbear] Add fix for duplicate-value (B033) (#9510)flake8-simplify] Implement enumerate-for-loop (SIM113) (#7777)pygrep_hooks] Add fix for deprecated-log-warn (PGH002) (#9519)pylint] Implement import-private-name (C2701) (#5920)refurb] Implement regex-flag-alias with fix (FURB167) (#9516)ruff] Add rule and fix to sort contents of __all__ (RUF022) (#9474)tryceratops] Add fix for error-instead-of-exception (TRY400) (#9520)flake8-pyi] Fix PYI047 false negatives on PEP-695 type aliases (#9566)flake8-pyi] Fix PYI049 false negatives on call-based TypedDicts (#9567)pylint] Exclude self and cls when counting method arguments (PLR0917) (#9563)--show-settings displays active settings in a far more readable format (#9464)--extension support to the formatter (#9483)pycodestyle] Use the configured tab size when expanding indents (#9506)flake8-simplify] Avoid some more enumerate-for-loop false positives (SIM113) (#9515)pandas-vet] Limit inplace diagnostics to methods that accept inplace (#9495)pylint] Add the __prepare__ method to the list of recognized dunder method (#9529)pylint] Ignore unnecessary dunder calls within dunder definitions (#9496)refurb] Avoid bailing when reimplemented-operator is called on function (FURB118) (#9556)ruff] Avoid treating named expressions as static keys (RUF011) (#9494)noqa with isort rules (#9555)cargo bench -p ruff_benchmark (#9535)emacs-ruff-format (#9403)flake8-blind-except] Document exceptions to blind-except rule (#9580)Include base pyproject when initializing cache settings
flake8-simplify] Account for possibly-empty f-string values in truthiness logic (#9484)pylint] Add the missing period in unnecessary-dunder-call (#9485)pylint] Fix __aenter__ message in unnecessary-dunder-call (#9492)\[pyupgrade\] Add some additional Python 3.12 typing members to deprecated-import
flake8-bandit] Add ssl-with-no-version (S504) (#9384)flake8-bandit] Implement ssl-insecure-version (S502) (#9390)flake8-bandit] Implement ssl-with-bad-defaults (S503) (#9391)flake8-bandit] Implement suspicious import rules (S4XX) (#8831)flake8-simplify] Implement zip-dict-keys-and-values (SIM911) (#9460)pyflakes] Add a fix for redefined-while-unused (F811) (#9419)pylint] Implement unnecessary-dunder-call (C2801) (#9166)ruff] Add parenthesize-chained-operators (RUF021) to enforce parentheses in a or b and c (#9440)flake8-boolean-trap] Allow Boolean positional arguments in setters (#9429)flake8-builtins] Restrict builtin-attribute-shadowing (A003) to actual shadowed references (#9462)flake8-pyi] Add fix for generator-return-from-iter-method (PYI058) (#9355)pyflakes] Don't flag redefined-while-unused (F811) in if branches (#9418)pyupgrade] Add some additional Python 3.12 typing members to deprecated-import (#9445)ruff] Add fix for parenthesize-chained-operators (RUF021) (#9449)ruff] Include subscripts and attributes in static key rule (RUF011) (#9416)ruff] Support variable keys in static dictionary key rule (RUF011) (#9411)# fmt: skip with interspersed same-line comments (#9395)None comparisons (#9376)DisplayParseError for stdin parser errors (#9409)comment_ranges for isort directive extraction (#9414)flake8-pyi] Exclude warnings.deprecated and typing_extensions.deprecated arguments (#9423)flake8-pyi] Fix false negative for unused-private-protocol (PYI046) with unused generic protocols (#9405)pydocstyle] Disambiguate argument descriptors from section headers (#9427)pylint] Homogenize PLR0914 message to match other PLR09XX rules (#9399)ruff] Allow Hashable = None in type annotations (RUF013) (#9442)\[pylint\] Implement super-without-brackets (W0245)
Improve dummy_implementations preview style formatting
dummy_implementations preview style formatting (#9240)with statements (#9222)flake8-pyi] Implement generator-return-from-iter-method (PYI058) (#9313)pylint] Implement empty-comment (PLR2044) (#9174)refurb] Implement bit-count (FURB161) (#9265)ruff] Add never-union rule to detect redundant typing.NoReturn and typing.Never (#9217)asyncio-dangling-task for nonlocal and global bindings (#9263)__str__ definitions from super classes (#9338)unused-noqa via per-file-ignores (#9300)typing_extensions members as typing aliases (#9335)Display for formatter parse errors (#9316)flake8-annotations] Avoid adding return types to stub methods (#9277)flake8-annotations] Respect mixed return and raise cases in return-type analysis (#9310)flake8-bandit] Don't report violations when SafeLoader is imported from yaml.loader (S506) (#9299)pylint] Avoid panic when comment is preceded by Unicode (#9331)pylint] Change PLR0917 error message to match other PLR09XX messages (#9308)refurb] Avoid false positives for math-constant (FURB152) (#9290)perflint] Document PERF102 fix un-safety (#9351)pyupgrade] Document UP007 fix un-safety (#9306)Add site-packages to default exclusions
pylint] Implement too-many-locals (PLR0914) (#9163)reimplemented_operator (FURB118) (#9171)no_blank_line_before_class_docstring preview style (#9154)CONSTANT_CASE variables are improperly flagged for yoda violation (SIM300) (#9164)flake8-pyi] Cover ParamSpecs and TypeVarTuples (PYI018) (#9198)flake8-bugbear] Add fix for zip-without-explicit-strict (B905) (#9176)print and pprint statements (T201, T203) (#9208)Never to NoReturn in auto-typing in Python >= 3.11 (ANN201) (#9213)can_omit_optional_parentheses: Exit early for unparenthesized expressions (#9125)dynamic mode with doctests so that it doesn't exceed configured line width (#9129)can_omit_optional_parentheses for expressions with a right most fstring (#9124)target_version to formatter options (#9220)ruff format --check to display message for already formatted files (#9153)operator.contains (#9192)D208 with multibyte indent (#9147)NoReturn in auto-return-typing (#9206)typing from exempt-modules (#9214)mutable-class-default violations for Pydantic subclasses (#9187)PYI055 autofix (#9161)asyncio-dangling-task violations on shadowed bindings (#9215)This release includes opt-in support for formatting Python snippets within docstrings via the docstring-code-format setting. Check out the blog post f
This release includes opt-in support for formatting Python snippets within docstrings via the docstring-code-format setting. Check out the blog post for more details!
"preserve" quote-style to mimic Black's skip-string-normalization (#8822)prefer_splitting_right_hand_side_of_assignments preview style (#8943)pycodestyle] Add fix for unexpected-spaces-around-keyword-parameter-equals (#9072)pycodestyle] Add fix for comment-related whitespace rules (#9075)pycodestyle] Allow sys.path modifications between imports (#9047)refurb] Implement hashlib-digest-hex (FURB181) (#9077)flake8-type-checking rules to automatically quote runtime-evaluated references (#6001)flake8-annotations] Avoid ANN2xx fixes for abstract methods with empty bodies (#9034)flake8-self] Ignore underscore references in type annotations (#9036)pep8-naming] Allow class names when apps.get_model is a non-string (#9065)pycodestyle] Allow matplotlib.use calls to intersperse imports (#9094)pyflakes] Support fixing unused assignments in tuples by renaming variables (F841) (#9107)pylint] Add fix for subprocess-run-without-check (PLW1510) (#6708)docstring-code-format knob to enable docstring snippet formatting (#8854)--output-format (#9078)flake8-err-msg] Allow EM fixes even if msg variable is defined (#9059)flake8-pie] Prevent keyword arguments duplication (#8450)flake8-pie] Respect trailing comma in unnecessary-dict-kwargs (PIE804) (#9015)flake8-raise] Avoid removing parentheses on ctypes.WinError (#9027)isort] Avoid invalid combination of force-sort-within-types and lines-between-types (#9041)isort] Ensure that from-style imports are always ordered first in __future__ (#9039)pycodestyle] Allow tab indentation before keyword (#9099)pylint] Ignore @overrides and @overloads for too-many-positional (#9000)pyupgrade] Enable printf-string-formatting fix with comments on right-hand side (#9037)refurb] Make math-constant (FURB152) rule more targeted (#9054)refurb] Support floating-point base in redundant-log-base (FURB163) (#9100)ruff] Detect unused-asyncio-dangling-task (RUF006) on unused assignments (#9060)Implement multiline dictionary and list hugging for preview style
fix_power_op_line_length preview style (#8947)flake8-annotations] Enable auto-return-type involving Optional and Union annotations (#8885)flake8-bandit] Implement django-raw-sql (S611) (#8651)flake8-bandit] Implement tarfile-unsafe-members (S202) (#8829)flake8-pyi] Implement fix for unnecessary-literal-union (PYI030) (#7934)flake8-simplify] Extend dict-get-with-none-default (SIM910) to non-literals (#8762)pylint] - add unnecessary-list-index-lookup (PLR1736) + autofix (#7999)pylint] - implement R0202 and R0203 with autofixes (#8335)pylint] Implement repeated-keyword (PLE1132) (#8706)pylint] Implement too-many-positional (PLR0917) (#8995)pylint] Implement unnecessary-dict-index-lookup (PLR1733) (#8036)refurb] Implement redundant-log-base (FURB163) (#8842)flake8-boolean-trap] Allow booleans in @override methods (#8882)flake8-bugbear] Avoid B015,B018 for last expression in a cell (#8815)flake8-pie] Allow ellipses for enum values in stub files (#8825)flake8-pyi] Check PEP 695 type aliases for snake-case-type-alias and t-suffixed-type-alias (#8966)flake8-pyi] Check for kwarg and vararg NoReturn type annotations (#8948)flake8-simplify] Omit select context managers from SIM117 (#8801)pep8-naming] Allow Django model loads in non-lowercase-variable-in-function (N806) (#8917)pycodestyle] Avoid E703 for last expression in a cell (#8821)pycodestyle] Update E402 to work at cell level for notebooks (#8872)pydocstyle] Avoid D100 for Jupyter Notebooks (#8816)pylint] Implement fix for unspecified-encoding (PLW1514) (#8928)ruff check and ruff format to default to the current directory (#8791)pylint] Default max-positional-args to max-args (#8998)pylint] Add allow-dunder-method-names setting for bad-dunder-method-name (PLW3201) (#8812)isort] Add support for from-first setting (#8663)isort] Add support for length-sort settings (#8841)@functools.singledispatch (#8934)get_model matching (#8965)@overload and @override methods for too-many-arguments checks (#8954)Mode::Expression (#8880)pydantic_settings.BaseSettings as having default copy semantics (#8793)NamedTuple assignments (#8810)flake8-type-checking (#8768)flake8-annotations] Avoid filtering out un-representable types in return annotation (#8881)flake8-pie] Retain extra ellipses in protocols and abstract methods (#8769)flake8-pyi] Respect local enum subclasses in simple-defaults (PYI052) (#8767)flake8-trio] Use correct range for TRIO115 fix (#8933)flake8-trio] Use full arguments range for zero-sleep-call (#8936)isort] fix: mark __main__ as first-party import (#8805)pep8-naming] Avoid N806 errors for type alias statements (#8785)perflint] Avoid PERF101 if there's an append in loop body (#8809)pycodestyle] Allow space-before-colon after end-of-slice (#8838)pydocstyle] Avoid non-character breaks in over-indentation (D208) (#8866)pydocstyle] Ignore underlines when determining docstring logical lines (#8929)pylint] Extend self-assigning-variable to multi-target assignments (#8839)tryceratops] Avoid repeated triggers in nested tryceratops diagnostics (#8772)flake8-pyi] Fix error in t-suffixed-type-alias (PYI043) example (#8963)flake8-pyi] Improve motivation for custom-type-var-return-type (PYI019) (#8766)Remove incorrect deprecation label for stdout and stderr
flake8-boolean-trap] Extend boolean-type-hint-positional-argument (FBT001) to include booleans in unions (#7501)flake8-pie] Extend reimplemented-list-builtin (PIE807) to dict reimplementations (#8608)flake8-pie] Extend unnecessary-pass (PIE790) to include ellipses (...) (#8641)flake8-pie] Implement fix for unnecessary-spread (PIE800) (#8668)flake8-quotes] Implement unnecessary-escaped-quote (Q004) (#8630)pycodestyle] Implement fix for multiple-spaces-after-keyword (E271) and multiple-spaces-before-keyword (E272) (#8622)pycodestyle] Implement fix for multiple-spaces-after-operator (E222) and multiple-spaces-before-operator (E221) (#8623)pyflakes] Extend is-literal (F632) to include comparisons against mutable initializers (#8607)pylint] Implement redefined-argument-from-local (PLR1704) (#8159)pylint] Implement fix for unnecessary-lambda (PLW0108) (#8621)refurb] Implement if-expr-min-max (FURB136) (#8664)refurb] Implement math-constant (FURB152) (#8727)flake8-annotations] Add autotyping-like return type inference for annotation rules (#8643)flake8-future-annotations] Implement fix for future-required-type-annotation (FA102) (#8711)flake8-implicit-namespace-package] Avoid missing namespace violations in scripts with shebangs (#8710)pydocstyle] Update over-indentation (D208) to preserve indentation offsets when fixing overindented lines (#8699)pyupgrade] Refine timeout-error-alias (UP041) to remove false positives (#8587)await formatting with fluent style (#8676)isort] Support disabling sections with no-sections = true (#8657)pep8-naming] Support local and dynamic class- and static-method decorators (#8592)pydocstyle] Allow overriding pydocstyle convention rules (#8586)trio.lowlevel (#8730)PIE794 (#8634)EM fixes (#7746)whitespace-before-punctuation (E203) (#8654)no-self-use (#8637)PLW0129 (#8675)TYPE_CHECKING blocks imported from typing_extensions or _typeshed (#8429)FURB113 autofix if comments are present (#8494)flake8-commas (#8582)force-sort-within-sections (#8665)\[flake8-bandit\] Implement mako-templates (S702)
flake8-bandit] Implement mako-templates (S702) (#8533)flake8-trio] Implement TRIO105 (#8490)flake8-trio] Implement TRIO109 (#8534)flake8-trio] Implement TRIO110 (#8537)flake8-trio] Implement TRIO115 (#8486)refurb] Implement type-none-comparison (FURB169) (#8487)E721 (#8491)SIM118 fix as safe when the expression is a known dictionary (#8525)--extension to override inference of source type from file extension (#8373)extend_unsafe_fixes and override extend_safe_fixes (#8444)RUFF_NO_CACHE environment variable (#8538)E721] Flag comparisons to memoryview (#8485)D301 autofix for u prefixed strings (#8495)flake8-trio rules when trio import is present (#8550)TRIO115 violations for trio.sleep(...) calls with non-number values (#8532)F841 false negative on assignment to multiple variables (#8489)known-first-party (#8562)project.requires-python over target-version (#8513)B008 documentation (#8501)\[flake8-trio\] Implement timeout-without-await (TRIO001)
flake8-trio] Implement timeout-without-await (TRIO001) (#8439)numpy] Implement NumPy 2.0 migration rule (NPY200) (#7702)pylint] Implement bad-open-mode (W1501) (#8294)pylint] Implement import-outside-toplevel (C0415) rule (#5180)pylint] Implement useless-with-lock (W2101) (#8321)pyupgrade] Implement timeout-error-alias (UP041) (#8476)refurb] Implement isinstance-type-none (FURB168) (#8308)RUF001, RUF002, and RUF003 (#4430)fmt: skip (#8273)fmt: off (#8275)--line-length option to format command (#8363)--output-format to ruff rule and ruff linter (#8203)--force-exclude in lint.exclude and format.exclude (#8393)--extend-per-file-ignores on the CLI (#8329)bad-dunder-method-name to permit __index__ (#8300)D300 when both triple quote styles are present (#8462)FStringRanges (#8154)shell=True for truthy, non-True diagnostics (#8359)NamedTuple rewrite with starred annotation (#8434)PLE1307 was raised when formatting %c with characters (#8407)fixedOverflowWidgets for playground popover (#8458)byte_bounds as a non-backwards-compatible NumPy 2.0 change (#8474)--fix and --diff (#8316)This release includes a variety of improvements to the Ruff formatter (available now as ruff format), removing several known and unintentional deviati
This release includes a variety of improvements to the Ruff formatter (available now as ruff format), removing several known and unintentional deviations from Black.
None, True and False (#8189)isort settings (#8192)isort.force-single-line is true (#8244)SourceKind::diff for formatter (#8240)fmt:off with trailing child comment (#8234)IpyEscapeCommand (#8207)pylint] Add buffer methods to bad-dunder-method-name (PLW3201) exclusions (#8190)external codes setting in unused-noqa (#8177)line-length setting for isort in lieu of pycodestyle.max-line-length (#8235)unnecessary-paren-on-raise-exception to unsafe for unknown types (#8231)W605 (#8255)unused-noqa (#8172)external option to unused-noqa documentation (#8171)magic-trailing-comma option in README (#8200)Add backports.strenum to deprecated-imports
This release includes the Beta version of the Ruff formatter — an extremely fast, Black-compatible Python formatter.
Try it today with ruff format! Check out the blog post and read the docs.
pylint] Implement non-ascii-module-import (C2403) (#8056)pylint] implement non-ascii-name (C2401) (#8038)pylint] Implement unnecessary-lambda (W0108) (#7953)refurb] Implement read-whole-file (FURB101) (#7682)E223, E224, and E242 (#8143)E225, E226, E227, and E228 (#8136)E252 (#8142)E261 (#8114)E273 and E274 (#8144)E275 (#8133)SIM401 to catch ternary operations (#7415)E721 to allow is and is not for direct type comparisons (#7905)backports.strenum to deprecated-imports (#8113)SIM112 to ignore https_proxy, http_proxy, and no_proxy (#8140)literal-membership (PLR6201) to be unsafe (#8097)mutable-argument-defaults (B006) to be unsafe (#8108)line-ending default to auto (#8057)has_own_parentheses (#8100)--line-length option from format command (#8131)line-length documentation (#8150)ruff format command in help menus (#8167)ruff version command with long version display (#8034)pycodestyle.max-line-length option (#8039)sys.version_info slices in outdated-version-block (#8112)TYPE_CHECKING blocks (#8072)too-many-arguments lint (#8092)extend-unsafe-fixes and extend-safe-fixes example (#8139)flake8-import-conventions options (#8115)Options JSON schema description (#8081)pytext -> pytest) (#8117)magic-value-comparison example in docs (#8111)Respect #(deprecated) attribute in configuration options
escape-sequence-in-docstring (D301) (#7970)#(deprecated) attribute in configuration options (#8035)[format|lint].exclude options (#8000)tab-size setting in formatter (#8006)lint.preview (#8002)pylint] Implement literal-membership (PLR6201) (#7973)pylint] Implement too-many-boolean-expressions (PLR0916) (#7975)pylint] Implement misplaced-bare-raise (E0704) (#7961)pylint] Implement global-at-module-level (W0604) (#8058)pylint] Implement unspecified-encoding (PLW1514) (#7939)triple-single-quotes (D300) (#7967)ruff format (#7878)--target-version to ruff format (#8055)in keyword (#8054)--diff option to ruff format (#7937)pass over ellipsis in non-function/class contexts (#8049)bad-dunder-method-name for _ (#8015)URLOpen audit (#8047)iteration-over-set to preserve whitespace and comments (#8001)B005 docs (#8028)--output-format (#8014)lint.preview and format.preview (#8032)RuleGroup::Preview. (#7989)The deprecated format setting has been removed
Read the blog post about this release.
Read Ruff's new versioning policy.
This is the first release which uses the CHANGELOG file — change entries will be listed there and in each GitHub Release.
format setting has been removed (#7984)
format setting cannot be used to configure the output format, use output-format insteadRUFF_FORMAT environment variable is ignored, use RUFF_OUTPUT_FORMAT instead--format option has been removed from ruff check, use --output-format insteadreimplemented-starmap (FURB140) to catch calls with a single and starred argument (#7768)RUF015 (#7848)SIM15 to allow open followed by close (#7916)msgspec.Struct default-copy semantics in RUF012 (#7786)sqlalchemy methods to `flake8-boolean-trap`` exclusion list (#7874)PLR1714 (#7910)PIE804 (#7884)PLC0208 (#7887)PYI055 (#7886)non-pep695-type-alias to require --unsafe-fixes outside of stub files (#7836)UP018 (#7913)PLW3201 to support Enum sunder names (#7987)unnecessary-key-check to simplify key in dct and dct[key] to dct.get(key) (#7895)assignment-in-assert to prevent walrus expressions in assert statements (#7856)refurb] Add single-item-membership-test (FURB171) (#7815)pylint] Add and-or-ternary (R1706) (#7811)New rules are added in preview.
unsafe-fixes setting (#7769)extend-safe-fixes and extend-unsafe-fixes for promoting and demoting fixes (#7841)--unsafe-fixes option for opt-in to display and apply unsafe fixes (#7769)--format option in warning (#7837)--check (#7788)check --diff to include unsafe fix hints (#7790)cell field to JSON output format (#7664)Safe, Unsafe, and Display (#7843)SIM110 with a yield in the condition (#7801)C414 fixes (#7775)unnecessary-enumerate len suggestion (#7781)SIM101 (#7798)E251 false positive inside f-strings (#7894)stdin (#7789)ruff rule (#7812)--unfixable in ISC rules (#7917)PIE804 (#7922)PTH118 for Path.joinpath with starred arguments (#7852)outdated-version-block when using greater than comparisons (#7920)gettext calls (#7898)PLR6301 (#7933)TCH004 (#7968)cache-dir relative to project root (#7962)TCH003 (#7954)line-length (#7883)coalesce keyword (#7876)reimplemented-starmap performance effects (#7846)PLR6301 (#7831)UP038 docs to note that it results in slower code (#7872)unnecessary-subscript-reversal (#7774)FURB177 example (#7832)ruff format message (#7867)ruff_python_formatter generate.py comment (#7850)Quick Fix action (#7824)Expand DeprecatedLogWarn to check for Expr::Atrribute calls by @qdegraaf in https://github.com/astral-sh/ruff/pull/7677
<!-- Release notes generated using configuration in .github/release.yml at v0.0.292 -->
This release includes full support for Python 3.12 (out now!), including the new type parameter (PEP 695) and f-string syntaxes (PEP 701).
PEP 701 lifts many of the restrictions on f-strings that existed in the past, allowing for arbitrarily nested f-strings, consistent quote style within f-strings, and more, all of which are now supported by Ruff (thanks to @dhruvmanila in https://github.com/astral-sh/ruff/pull/7376).
format.quote-style no longer affects triple-quoted strings, to align with common conventions as well as the guidance from PEP 8 and PEP 257 (see: https://github.com/astral-sh/ruff/pull/7680).line-too-long (E501) now ignores trailing pragma comments (like # type: ignore and # noqa) when computing line length (see: https://github.com/astral-sh/ruff/pull/7692). This is similar to flake8-bugbear's methodology for detecting overlong lines, and ensures that adding pragmas like # noqa does not introduce further lint errors.refurb] Implement print-empty-string (FURB105) by @tjkuson in https://github.com/astral-sh/ruff/pull/7617flake8-bandit] Implement weak-cryptographic-key (S505) by @mkniewallner in https://github.com/astral-sh/ruff/pull/7703refurb] Implement implicit-cwd (FURB177) by @danparizher in https://github.com/astral-sh/ruff/pull/7704unnecessary-pass (PIE790) now flags all unnecessary pass statements; previously, the rule only flagged pass statements that followed a docstring in a two-statement body (see: https://github.com/astral-sh/ruff/pull/7697).lint section to Ruff configuration by @MichaReiser in https://github.com/astral-sh/ruff/pull/7549explicit-preview-rules to toggle explicit selection of preview rules by @zanieb in https://github.com/astral-sh/ruff/pull/7390stdout by @charliermarsh in https://github.com/astral-sh/ruff/pull/7748unnecessary-pass (PIE790) to trigger on all unnecessary pass statements by @tjkuson in https://github.com/astral-sh/ruff/pull/7697PT022 autofix by @dhruvmanila in https://github.com/astral-sh/ruff/pull/7613builtin.open() with Path.open() if the latter doesn't support all options by @konstin in https://github.com/astral-sh/ruff/pull/7637Expr::Name checks to rules which use is_logger_candidate by @qdegraaf in https://github.com/astral-sh/ruff/pull/7521__all__ assignments by @charliermarsh in https://github.com/astral-sh/ruff/pull/7673commented-out-code by @tjkuson in https://github.com/astral-sh/ruff/pull/7523unnecessary-pass by @charliermarsh in https://github.com/astral-sh/ruff/pull/7715quadratic-list-summation by @charliermarsh in https://github.com/astral-sh/ruff/pull/7719NotebookIndex for Diagnostics on stdin by @dhruvmanila in https://github.com/astral-sh/ruff/pull/7663LexError for dedent to incorrect level by @MichaReiser in https://github.com/astral-sh/ruff/pull/7638DeprecatedLogWarn to check for Expr::Atrribute calls by @qdegraaf in https://github.com/astral-sh/ruff/pull/7677commented-out-code (~50-80%) by @charliermarsh in https://github.com/astral-sh/ruff/pull/7706Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.291...v0.0.292
<!-- Release notes generated using configuration in .github/release.yml at v0.0.291 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.0.291 -->
The format command-line argument and configuration option has been renamed to output-format. While Ruff will continue to respect format when passed as a command-line argument or configuration option, this backwards-compatible support will be dropped in a future release. See: https://github.com/astral-sh/ruff/pull/7514.
flake8-bandit] Implement S201: flask-debug-true by @mkniewallner in https://github.com/astral-sh/ruff/pull/7503flake8-bandit] Implement S507: ssh_no_host_key_verification by @mkniewallner in https://github.com/astral-sh/ruff/pull/7528flake8-logging] Implement LOG002: invalid-get-logger-argument by @dhruvmanila in https://github.com/astral-sh/ruff/pull/7399flake8-logging] Implement LOG007: exception-without-exc-info by @qdegraaf in https://github.com/astral-sh/ruff/pull/7410refurb] Implement FURB140: reimplemented-starmap by @SavchenkoValeriy in https://github.com/astral-sh/ruff/pull/7253refurb] Implement FURB148: unnecessary-enumerate by @tjkuson in https://github.com/astral-sh/ruff/pull/7454ruff] Detect asyncio.get_running_loop calls in RUF006 by @charliermarsh in https://github.com/astral-sh/ruff/pull/7562--no-X variants in CLI help by @charliermarsh in https://github.com/astral-sh/ruff/pull/7504format option to output-format by @MichaReiser in https://github.com/astral-sh/ruff/pull/7514ruff rule by @charliermarsh in https://github.com/astral-sh/ruff/pull/7560bad-dunder-method-name to permit attrs dunders by @tjkuson in https://github.com/astral-sh/ruff/pull/7472.exception() calls by @charliermarsh in https://github.com/astral-sh/ruff/pull/7524PERF102 fixes by @charliermarsh in https://github.com/astral-sh/ruff/pull/7554os.error as an OSError alias by @charliermarsh in https://github.com/astral-sh/ruff/pull/7582bad-dunder-method-name to permit __html__ by @jaap3 in https://github.com/astral-sh/ruff/pull/7492Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.290...v0.0.291
Update deprecated-import lists based on recent typing-extensions release by @charliermarsh in https://github.com/astral-sh/ruff/pull/7356
<!-- Release notes generated using configuration in .github/release.yml at v0.0.290 -->
deprecated-import lists based on recent typing-extensions release by @charliermarsh in https://github.com/astral-sh/ruff/pull/7356UP040 by @nathanwhit in https://github.com/astral-sh/ruff/pull/6749C416 to catch tuple unpacking by @charliermarsh in https://github.com/astral-sh/ruff/pull/7363NURSERY rule selctor in JSON Schema by @charliermarsh in https://github.com/astral-sh/ruff/pull/7374D411 by @charliermarsh in https://github.com/astral-sh/ruff/pull/7351flake8-logging] New rule undocumented-warn (LOG009) by @qdegraaf in https://github.com/astral-sh/ruff/pull/7249flake8-logging] New rule direct-logger-instantiation (LOG001) by @charliermarsh in https://github.com/astral-sh/ruff/pull/7397flake8-logging] New plugin flake8_logging (LOG) by @qdegraaf in https://github.com/astral-sh/ruff/pull/7249perflint] Add manual-dict-comprehsion (PERF403) by @qdegraaf in https://github.com/astral-sh/ruff/pull/6132pylint] New rule too-many-public-methods (PLR0904) by @jelly in https://github.com/astral-sh/ruff/pull/6179refurb] New rule no-slice-copy (FURB145) by @tjkuson in https://github.com/astral-sh/ruff/pull/7007PREVIEW rule selector by @zanieb in https://github.com/astral-sh/ruff/pull/7389pre-commit support for the alpha formatter by @zanieb in https://github.com/astral-sh/ruff-pre-commit/pull/50Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.289...v0.0.290
<!-- Release notes generated using configuration in .github/release.yml at v0.0.289 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.0.289 -->
@override method when enforcing bad-dunder-name rule by @brendonh8 in https://github.com/astral-sh/ruff/pull/7224NotebookIndex to the cache by @dhruvmanila in https://github.com/astral-sh/ruff/pull/6863This release includes a new preview mode which can be used to opt-in to unstable rules and features.
--preview option in the CLI help menu by @zanieb in https://github.com/astral-sh/ruff/pull/7274See the documentation and versioning discussion for more details.
Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.288...v0.0.289
One column per quarter.