NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #123 most downloaded on PyPI
An extremely fast Python linter and code formatter, written in Rust.
Last release 2 days ago
16 Sep 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
424 releases · first in 2022
One column per quarter.
\[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
Remove emoji identifier support by @MichaReiser in https://github.com/astral-sh/ruff/pull/7212
ruff]
RUF001: Remove autofix for ambiguous unicode rule by @charliermarsh in https://github.com/astral-sh/ruff/pull/7168flake8-self]
SLF001: Add extend-ignore-names option by @jaap3 in https://github.com/astral-sh/ruff/pull/7194flake8-bugbear]
B006: Add newline if fix is at end-of-file by @charliermarsh in https://github.com/astral-sh/ruff/pull/7090B006: Fix function docstring followed by whitespace but no newline by @zanieb in https://github.com/astral-sh/ruff/pull/7160B009: Parenthesize expressions when converting to attribute access by @charliermarsh in https://github.com/astral-sh/ruff/pull/7091B009, B010: Fix getattr calls on int literals by @density in https://github.com/astral-sh/ruff/pull/7057B013: Supported starred exceptions in length-one tuple detection by @charliermarsh in https://github.com/astral-sh/ruff/pull/7080B013: Insert required space when fixing by @charliermarsh in https://github.com/astral-sh/ruff/pull/7148flake8-comprehensions]
C402: Add required space when fixing by @charliermarsh in https://github.com/astral-sh/ruff/pull/7152C404 Add required space when fixing by @charliermarsh in https://github.com/astral-sh/ruff/pull/7185C416 Add required space to fix by @charliermarsh in https://github.com/astral-sh/ruff/pull/7204C417: Support length-2 lists in dictionary comprehension rewrites by @charliermarsh in https://github.com/astral-sh/ruff/pull/7081C417: Parenthesize targets if necessary by @charliermarsh in https://github.com/astral-sh/ruff/pull/7189flake8-return]
RET504: Add space after return when inlining number by @charliermarsh in https://github.com/astral-sh/ruff/pull/7116flake8-simplify]
SIM105: Avoid attempting to fix violations with multi-statement lines by @charliermarsh in https://github.com/astral-sh/ruff/pull/7191SIM105 Avoid inserting an extra newline for fixes by @charliermarsh in https://github.com/astral-sh/ruff/pull/7221SIM118: Add required space when fixing by @charliermarsh in https://github.com/astral-sh/ruff/pull/7150SIM118: delete .keys() rather than replace expression by @charliermarsh in https://github.com/astral-sh/ruff/pull/7223SIM210: Retain parentheses when fixing by @charliermarsh in https://github.com/astral-sh/ruff/pull/7118SIM222: Add parentheses when simplifying conditions by @charliermarsh in https://github.com/astral-sh/ruff/pull/7117SIM300: Add required space when fixing by @charliermarsh in https://github.com/astral-sh/ruff/pull/7167flake8-pytest-style]
PT018: Split within not, rather than outside of not by @charliermarsh in https://github.com/astral-sh/ruff/pull/7151flynt]
FLY002: Add required space for fixes by @charliermarsh in https://github.com/astral-sh/ruff/pull/7222numpy]
NPY001: Avoid attempting to fix with overridden builtins by @charliermarsh in https://github.com/astral-sh/ruff/pull/7187NPY003: Use symbol import for replacement by @charliermarsh in https://github.com/astral-sh/ruff/pull/7083pandas-vet]
PD002: Handle parenthesized calls by @charliermarsh in https://github.com/astral-sh/ruff/pull/7111pep8-naming]
N806: Avoid triggering on TypeAlias assignments by @charliermarsh in https://github.com/astral-sh/ruff/pull/7119pydocstyle]
D204: Fix when there's a semicolon after a docstring by @konstin in https://github.com/astral-sh/ruff/pull/7174D213, D400: Ignore single quote docstrings with newline escape by @konstin in https://github.com/astral-sh/ruff/pull/7173D417: Fix error with function docstrings with dashed lines by @eronnen in https://github.com/astral-sh/ruff/pull/7251pyflakes]
F401: Avoid panic with noqa import name by @charliermarsh in https://github.com/astral-sh/ruff/pull/7260F841: Expand fixes to handle parenthesized targets by @charliermarsh in https://github.com/astral-sh/ruff/pull/7110pylint]
PLW3301: Copy the starred argument as is for autofix by @dhruvmanila in https://github.com/astral-sh/ruff/pull/7177pyupgrade]
UP006 and UP007: Add required space to fixes by @charliermarsh in https://github.com/astral-sh/ruff/pull/7202UP007: Avoid attempting to fix invalid Optional annotations by @charliermarsh in https://github.com/astral-sh/ruff/pull/7079UP007: Fix syntax error in autofix by @charliermarsh in https://github.com/astral-sh/ruff/pull/7137UP021: Avoid adding duplicate text keyword to subprocess.run by @charliermarsh in https://github.com/astral-sh/ruff/pull/7112UP022: Avoid adding duplicate capture_output keyword to subprocess.run by @charliermarsh in https://github.com/astral-sh/ruff/pull/7113UP028: Support parenthesized expressions by @charliermarsh in https://github.com/astral-sh/ruff/pull/7114UP022: Avoid fixing when capture_output is provided by @charliermarsh in https://github.com/astral-sh/ruff/pull/7149UP024: Add required space when fixing by @charliermarsh in https://github.com/astral-sh/ruff/pull/7171ruff]
RUF017: Avoid duplicate fixes for multi-import imports by @charliermarsh in https://github.com/astral-sh/ruff/pull/7063Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.287...v0.0.288
<!-- Release notes generated using configuration in .github/release.yml at v0.0.287 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.0.287 -->
repeated-append rule (FURB113) by @SavchenkoValeriy in https://github.com/astral-sh/ruff/pull/6702delete-full-slice rule (FURB131) by @SavchenkoValeriy in https://github.com/astral-sh/ruff/pull/6897check-and-remove-from-set rule (FURB132) by @SavchenkoValeriy in https://github.com/astral-sh/ruff/pull/6904PERF401 and PERF402 with type checks by @qdegraaf in https://github.com/astral-sh/ruff/pull/6994typename is provided as a keyword argument by @charliermarsh in https://github.com/astral-sh/ruff/pull/6955missing_copyright_notice by @WindowGenerator in https://github.com/astral-sh/ruff/pull/7029WithItem ranges for parenthesized, non-as items by @charliermarsh in https://github.com/astral-sh/ruff/pull/6782Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.286...v0.0.287
<!-- Release notes generated using configuration in .github/release.yml at v0.0.286 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.0.286 -->
flake8-bugbear] Update function-call-in-argument-default (B008) to ignore arguments with immutable annotations by @zanieb in https://github.com/astral-sh/ruff/pull/6784flake8-bugbear] Update mutable-argument-default (B006) to use extend-immutable-calls when determining if annotations are immutable by @zanieb in https://github.com/astral-sh/ruff/pull/6781flake8-pie] Implement unnecessary-range-start (PIE808) by @harupy in https://github.com/astral-sh/ruff/pull/6690flake8-pytest-style] Add autofix for PT014 by @harupy in https://github.com/astral-sh/ruff/pull/6698pylint] Implement no-self-use (R6301) by @LaBatata101 in https://github.com/astral-sh/ruff/pull/6574pylint] Extend repeated-equality-comparison-target to check for mixed orderings and Yoda conditions. by @tjkuson in https://github.com/astral-sh/ruff/pull/6691detect-same-package behavior configurable by @charliermarsh in https://github.com/astral-sh/ruff/pull/6833typing_extensions.TypeAlias for PYI026 fixes on pre-3.10 by @charliermarsh in https://github.com/astral-sh/ruff/pull/6696repeated-equality-comparison-target by @charliermarsh in https://github.com/astral-sh/ruff/pull/6705ctypes.WinError() in flake8-raise by @charliermarsh in https://github.com/astral-sh/ruff/pull/6731eq-without-hash when __hash__ is explicitly set to None by @LaBatata101 in https://github.com/astral-sh/ruff/pull/6739native-literals handling of int literal with attribute access by @zanieb in https://github.com/astral-sh/ruff/pull/6792uncessary-coding-comment fix when there's leading content by @zanieb in https://github.com/astral-sh/ruff/pull/6775C417 for lambda with default and variadic parameters by @dhruvmanila in https://github.com/astral-sh/ruff/pull/6752networkx to conventional aliases by @zanieb in https://github.com/astral-sh/ruff/pull/6778Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.285...v0.0.286
Add deprecated unittest assertions to PT009 by @charliermarsh in https://github.com/astral-sh/ruff/pull/6572
flake8-pytest-style] Implement pytest-unittest-raises-assertion (PT027) by @harupy in https://github.com/astral-sh/ruff/pull/6554flake8-pytest-style] Implement pytest-duplicate-parametrize-test-cases (PT014) by @harupy in https://github.com/astral-sh/ruff/pull/6598flake8-tidy-imports] Implement banned-module-level-imports (TID253) by @durumu in https://github.com/astral-sh/ruff/pull/6378pylint] Implement bad-dunder-name (W3201) (in the Ruff nursery) by @LaBatata101 in https://github.com/astral-sh/ruff/pull/6486pylint] Implement subprocess-run-check (W1510) by @tjkuson in https://github.com/astral-sh/ruff/pull/6487ruff] Implement quadratic-list-summation (RUF017) by @evanrittenhouse in https://github.com/astral-sh/ruff/pull/6489flake8-bugbear] Add autofix for B006 by @qdegraaf in https://github.com/astral-sh/ruff/pull/6131flake8-pyi] Avoid applying PYI055 to runtime-evaluated annotations by @charliermarsh in https://github.com/astral-sh/ruff/pull/6457flake8-self] Allow os._exit accesses in SLF001 by @charliermarsh in https://github.com/astral-sh/ruff/pull/6490perflint] Ignore PERF203 if try contains loop control flow statements by @evanrittenhouse in https://github.com/astral-sh/ruff/pull/6536pylint] Check for invalid format type specifiers in nested replacements for PLE1300 by @zanieb in https://github.com/astral-sh/ruff/pull/6616tryceratops] Omit NotImplementedError from TRY003 by @charliermarsh in https://github.com/astral-sh/ruff/pull/6568.ipynb and .pyi sources when linting from stdin by @charliermarsh in https://github.com/astral-sh/ruff/pull/6628raises_require_match_for and raises_require_match_for by @harupy in https://github.com/astral-sh/ruff/pull/6635lambda-assignment fix always-manual in class bodies by @charliermarsh in https://github.com/astral-sh/ruff/pull/6626E721 by @charliermarsh in https://github.com/astral-sh/ruff/pull/6469E402 by @charliermarsh in https://github.com/astral-sh/ruff/pull/6526invalid-envvar-value by @charliermarsh in https://github.com/astral-sh/ruff/pull/6538locals() by @charliermarsh in https://github.com/astral-sh/ruff/pull/6578await in Jupyter notebooks by @charliermarsh in https://github.com/astral-sh/ruff/pull/6607pandas#values for stores, deletes, or class accesses by @charliermarsh in https://github.com/astral-sh/ruff/pull/6631E712 fix by @charliermarsh in https://github.com/astral-sh/ruff/pull/6575I002 by @durumu in https://github.com/astral-sh/ruff/pull/6523PLE1300 by @zanieb in https://github.com/astral-sh/ruff/pull/6616Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.284...v0.0.285
This release fixes a few bugs. Notably, the previous release announced a breaking change where the default target Python version changed from 3.10 to…
This release fixes a few bugs. Notably, the previous release announced a breaking change where the default target Python version changed from 3.10 to 3.8 but the change was not applied. Thanks to @rco-ableton for fixing this in https://github.com/astral-sh/ruff/pull/6444
S108 if path is inside tempfile.* call by @dhruvmanila in https://github.com/astral-sh/ruff/pull/6416Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.283...v0.0.284
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
flake8-pyi] PYI019: Detects if a type variable is used instead of Self in return annotations by @qdegraaf in https://github.com/astral-sh/ruff/pull/6204flake8-pyi] PYI051: Detects unions of Literal types by @LaBatata101 in https://github.com/astral-sh/ruff/pull/6215flake8-pyi] PYI055: Detects unions of types by @LaBatata101 in https://github.com/astral-sh/ruff/pull/6316pylint] E1300: Detects invalid string format characters by @silvanocerza in https://github.com/astral-sh/ruff/pull/6171pyupgrade] UP040: Upgrades type alias annotations to use PEP-695 syntax by @zanieb in https://github.com/astral-sh/ruff/pull/6289flake8-boolean-trap] FBT003: Add is_ and is_not to excluded functions by @zanieb in https://github.com/astral-sh/ruff/pull/6307flake8-logging-format] Allow capitalized names for logger candidate heuristic match by @charliermarsh in https://github.com/astral-sh/ruff/pull/6356flake8-pyi] Applicable rules are now checked non-stub code by @andersk in https://github.com/astral-sh/ruff/pull/6297
PYI013: ellipsis-in-non-empty-class-bodyPYI016: duplicate-union-memberPYI018: unused-private-type-varPYI019: custom-type-var-return-typePYI024: collections-named-tuplePYI025: unaliased-collections-abc-set-importPYI030: unnecessary-literal-unionPYI032: any-eq-ne-annotationPYI034: non-self-return-typePYI036: bad-exit-annotationPYI041: redundant-numeric-unionPYI042: snake-case-type-aliasPYI043: t-suffixed-type-aliasPYI045: iter-method-return-iterablePYI046: unused-private-protocolPYI047: unused-private-type-aliasPYI049: unused-private-typed-dictPYI050: no-return-argument-annotation-in-stub (Python ≥ 3.11)PYI051: redundant-literal-unionPYI056: unsupported-method-call-on-allflake8-pyi] PYI027 is being replaced by PYI022 / UP035 by @LaBatata101 in https://github.com/astral-sh/ruff/pull/6354pydocstyle] D103: Don't require docstrings in .pyi files by @charliermarsh in https://github.com/astral-sh/ruff/pull/6239pydocstyle] D203: Ignore same-line docstrings for lines-before and lines-after rules by @charliermarsh in https://github.com/astral-sh/ruff/pull/6344pylint] PLE0605: Allow generic tuple and list calls in __all__ by @charliermarsh in https://github.com/astral-sh/ruff/pull/6247pylint] PLR0124: Add detection of comparisons with built-in calls by @charliermarsh in https://github.com/astral-sh/ruff/pull/6324pyupgrade] UP032: Add support for await expressions in f-strings by @harupy in https://github.com/astral-sh/ruff/pull/6304pyupgrade] UP032: Add support for implicitly concatenated strings by @harupy in https://github.com/astral-sh/ruff/pull/6263pyupgrade] UP032: Add support for repeated format fields by @harupy in https://github.com/astral-sh/ruff/pull/6266ruff] RUF012: Permit ClassVar and Final without subscript by @bluetech in https://github.com/astral-sh/ruff/pull/6273flake8-bugbear] B006: Respect typing_extensions imports of Annotated by @PIG208 in https://github.com/astral-sh/ruff/pull/6361flake8-pyi] PYI019: Fix panic with positional-only arguments by @charliermarsh in https://github.com/astral-sh/ruff/pull/6350flake8-use-pathlib] Avoid raising PTH206 with maxsplit by @charliermarsh in https://github.com/astral-sh/ruff/pull/6283flake8] F841: Update autofix to not remove Jupyer magic expressions by @dhruvmanila in https://github.com/astral-sh/ruff/pull/6141pycodestyle] E721: Include comparisons to builtin types by @charliermarsh in https://github.com/astral-sh/ruff/pull/6325pycodestyle] E721: Match left-hand side types() call in types-comparison by @charliermarsh in https://github.com/astral-sh/ruff/pull/6326pyupgrade] UP031: Avoid auto-fixing if there are comments within the right-hand side by @harupy in https://github.com/astral-sh/ruff/pull/6364pyupgrade] UP032: Avoid auto-fixing if comments are present around format call arguments by @harupy in https://github.com/astral-sh/ruff/pull/6342pyupgrade] UP032: Improve invalid expression check by @harupy in https://github.com/astral-sh/ruff/pull/6308.format(...) calls with too-few-arguments by @charliermarsh in https://github.com/astral-sh/ruff/pull/6401.gitignore files in parent directories were incorrectly used by @charliermarsh in https://github.com/astral-sh/ruff/pull/6368Union expressions by @charliermarsh in https://github.com/astral-sh/ruff/pull/6399Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.282...v0.0.283
<!-- Release notes generated using configuration in .github/release.yml at v0.0.282 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.0.282 -->
quoted-annotation rule (#5766)" by @charliermarsh in https://github.com/astral-sh/ruff/pull/6237Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.281...v0.0.282
<!-- Release notes generated using configuration in .github/release.yml at v0.0.281 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.0.281 -->
See the release blog post for more, including detailed descriptions of any newly added rules.
flake8-pyi] Implement PYI018 by @LaBatata101 in https://github.com/astral-sh/ruff/pull/6018flake8-pyi] Implement PYI047 by @LaBatata101 in https://github.com/astral-sh/ruff/pull/6134flake8-pyi] Implement PYI049 by @LaBatata101 in https://github.com/astral-sh/ruff/pull/6136flake8-pyi] Implement PYI056 by @LaBatata101 in https://github.com/astral-sh/ruff/pull/5959flake8-pyi] Implement PYI046 by @LaBatata101 in https://github.com/astral-sh/ruff/pull/6098flake8-use-pathlib] Implement glob (PTH207) by @sbrugman in https://github.com/astral-sh/ruff/pull/5939flake8-use-pathlib] Implement os-sep-split (PTH206) by @sbrugman in https://github.com/astral-sh/ruff/pull/5936pycodestyle] Implement E241 and E242 (tab/multiple ws after commas) by @akx in https://github.com/astral-sh/ruff/pull/6094pylint] Implement self-assigning-variable (W0127) by @tjkuson in https://github.com/astral-sh/ruff/pull/6015pylint] Implement eq-without-hash rule (PLW1641) by @jelly in https://github.com/astral-sh/ruff/pull/5955pylint] Implement subprocess-popen-preexec-fn (W1509) by @tjkuson in https://github.com/astral-sh/ruff/pull/5978flake8-bugbear] Extends B002 to detect unary prefix decrement operators by @tjkuson in https://github.com/astral-sh/ruff/pull/5998flake8-pytest-style] Avoid raising PT012 for simple with statements by @harupy in https://github.com/astral-sh/ruff/pull/6081flake8-pytest-style] Allow pytest.raises body to contain a single func or class definition by @harupy in https://github.com/astral-sh/ruff/pull/6083flake8-simplify] Extend SIM118 with not in by @sbrugman in https://github.com/astral-sh/ruff/pull/5995perflint] Skip PERF203 violations for multi-statement loops by @charliermarsh in https://github.com/astral-sh/ruff/pull/6145pyupgrade] Add support for int, float, bool in UP018 by @dhruvmanila in https://github.com/astral-sh/ruff/pull/6013tryceratops] Add suggested fix for TRY201 by @dhruvmanila in https://github.com/astral-sh/ruff/pull/6008logging.Logger re-exports via logger-objects by @charliermarsh in https://github.com/astral-sh/ruff/pull/5750max-complexity to 10 for empty McCabe settings by @charliermarsh in https://github.com/astral-sh/ruff/pull/6073pep8-naming]: New config option extend-ignore-names by @dhruvmanila in https://github.com/astral-sh/ruff/pull/6169UP032 if format call arguments contain multiline expressions by @harupy in https://github.com/astral-sh/ruff/pull/5971F507 false positive by @harupy in https://github.com/astral-sh/ruff/pull/5986Literal members as expressions with __future__ by @charliermarsh in https://github.com/astral-sh/ruff/pull/6032x[:1]-like slices in RUF015 by @charliermarsh in https://github.com/astral-sh/ruff/pull/6150self accesses by @charliermarsh in https://github.com/astral-sh/ruff/pull/6165[ as an invalid noqa suffix by @charliermarsh in https://github.com/astral-sh/ruff/pull/5982explicit-string-concatenation on single line by @tjkuson in https://github.com/astral-sh/ruff/pull/6028SIM102 to handle indented elif by @harupy in https://github.com/astral-sh/ruff/pull/6072PTH201 for Path("") by @harupy in https://github.com/astral-sh/ruff/pull/6095SIM115 to cover pathlib.Path.open by @harupy in https://github.com/astral-sh/ruff/pull/611--diff for Jupyter Notebooks by @dhruvmanila in https://github.com/astral-sh/ruff/pull/6149SIM105 for non-exceptions by @sbrugman in https://github.com/astral-sh/ruff/pull/5985Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.280...v0.0.281
<!-- Release notes generated using configuration in .github/release.yml at v0.0.280 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.0.280 -->
elif and else branches during import sorting by @charliermarsh in https://github.com/astral-sh/ruff/pull/5964Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.279...v0.0.280
<!-- Release notes generated using configuration in .github/release.yml at v0.0.279 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.0.279 -->
flake8-pyi] Implement flake8-pyi's PYI026 by @LaBatata101 in https://github.com/astral-sh/ruff/pull/5844flake8-pyi] Implement flake8-pyi's PYI017 by @qdegraaf in https://github.com/astral-sh/ruff/pull/5895flake8-pyi] Implement flake8-pyi's PYI036 by @density in https://github.com/astral-sh/ruff/pull/5668flake8-pyi] Implement flake8-pyi's PYI041 by @density in https://github.com/astral-sh/ruff/pull/5722flake8-use-pathlib] Implement os-path-getsize and os-path-get(a|m|c)-time (PTH202-205) by @sbrugman in https://github.com/astral-sh/ruff/pull/5835flake8-use-pathlib] Implement path-constructor-default-argument (PTH201) by @sbrugman in https://github.com/astral-sh/ruff/pull/5833pandas-vet] Implement constant series rule (PD101) by @sbrugman in https://github.com/astral-sh/ruff/pull/5802pylint] Implement Pylint's consider-using-in (PLR1714) by @tjkuson in https://github.com/astral-sh/ruff/pull/5193flake8-annotations] Check for Any in other types for ANN401 by @dhruvmanila in https://github.com/astral-sh/ruff/pull/5601flake8-bugbear] Add autofix for B004 by @density in https://github.com/astral-sh/ruff/pull/5788flake8-bugbear] Remove B904's lowercase exemption by @charliermarsh in https://github.com/astral-sh/ruff/pull/5751flake8-use-pathlib] extend PTH118 with os.sep by @sbrugman in https://github.com/astral-sh/ruff/pull/5935pyupgrade] Expand scope of quoted-annotation rule (UP037) by @charliermarsh in https://github.com/astral-sh/ruff/pull/5766pyupgrade] Extend PEP 604 rewrites to support some quoted annotations by @charliermarsh in https://github.com/astral-sh/ruff/pull/5725ruff] Expand RUF015 to include all expression types by @charliermarsh in https://github.com/astral-sh/ruff/pull/5767Enum-and-str subclasses for slots enforcement by @charliermarsh in https://github.com/astral-sh/ruff/pull/5749sorted with differing arguments by @density in https://github.com/astral-sh/ruff/pull/5761incorrect-dict-iterator by @charliermarsh in https://github.com/astral-sh/ruff/pull/5763lint_only aware of the source kind by @dhruvmanila in https://github.com/astral-sh/ruff/pull/5876redefined-while-unused violations in classes by @charliermarsh in https://github.com/astral-sh/ruff/pull/5926--add-noqa by @dhruvmanila in https://github.com/astral-sh/ruff/pull/5727EXE001 and EXE002 on WSL by @tjkuson in https://github.com/astral-sh/ruff/pull/5735Expr::Call branches by @charliermarsh in https://github.com/astral-sh/ruff/pull/5772SetComp by @lkh42t in https://github.com/astral-sh/ruff/pull/5774runtime-import-in-type-checking-block (TCH004) behind enabled flag by @charliermarsh in https://github.com/astral-sh/ruff/pull/5789pandas-use-of-dot-read-table rule to emit only when read_table is used on CSV data by @tjkuson in https://github.com/astral-sh/ruff/pull/5807NamedTuple calls containing both a list of fields and keywords by @harupy in https://github.com/astral-sh/ruff/pull/5799noqa warnings by @sobolevn in https://github.com/astral-sh/ruff/pull/5856respect_gitignore when not in a git repo by @dhruvmanila in https://github.com/astral-sh/ruff/pull/5937Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.278...v0.0.279
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
See the release blog post for more, including detailed descriptions of any newly added rules.
pylint] Implement typevar-bivariance (PLC0131) by @tjkuson in https://github.com/astral-sh/ruff/pull/5517flake8-pyi] Implement unnecessary-literal-union (PYI030) by @zanieb in https://github.com/astral-sh/ruff/pull/5570pylint] Implement type-name-incorrect-variance (PLC0105) by @tjkuson in https://github.com/astral-sh/ruff/pull/5651ruff] Implement unnecessary-list-allocation-for-first-element (RUF015) by @evanrittenhouse in https://github.com/astral-sh/ruff/pull/5549flake8-bugbear] Implement re-sub-positional-args (B034) by @charliermarsh in https://github.com/astral-sh/ruff/pull/5669ruff] Implement invalid-index-type (RUF016) by @zanieb in https://github.com/astral-sh/ruff/pull/5602isort] Add --case-sensitive flag by @qdegraaf in https://github.com/astral-sh/ruff/pull/5539isort] Support globbing in isort options by @tjkuson in https://github.com/astral-sh/ruff/pull/5473str.format calls by @harupy in https://github.com/astral-sh/ruff/pull/5638unnecessary-map (C417) for late-bound lambdas by @charliermarsh in https://github.com/astral-sh/ruff/pull/5520.astimezone() by @dhruvmanila in https://github.com/astral-sh/ruff/pull/5524noqa directive parsing away from regex-based implementation by @charliermarsh in https://github.com/astral-sh/ruff/pull/5554# noqa directives by @charliermarsh in https://github.com/astral-sh/ruff/pull/5571# flake8: noqa directives by @charliermarsh in https://github.com/astral-sh/ruff/pull/5618tkinter import convention by @tjkuson in https://github.com/astral-sh/ruff/pull/5626PERF401 if conditional depends on list var by @dhruvmanila in https://github.com/astral-sh/ruff/pull/5603raise throws a caught exception by @evanrittenhouse in https://github.com/astral-sh/ruff/pull/5455Union declarations without | to PYI016 by @zanieb in https://github.com/astral-sh/ruff/pull/5598_name_ and _value_ accesses in flake8-self rules by @monosans in https://github.com/astral-sh/ruff/pull/5663repeated_keys() to use ComparableExpr by @qdegraaf in https://github.com/astral-sh/ruff/pull/5696Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.277...v0.0.278
<!-- Release notes generated using configuration in .github/release.yml at v0.0.277 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.0.277 -->
pylint] Implement Pylint typevar-name-mismatch (C0132) by @tjkuson in https://github.com/astral-sh/ruff/pull/5501ruff rule --all subcommand (with JSON output) by @akx in https://github.com/astral-sh/ruff/pull/5059Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.276...v0.0.277
[numpy] Implement numpy-deprecated-function (NPY003) by @charliermarsh in https://github.com/astral-sh/ruff/pull/5468
<!-- Release notes generated using configuration in .github/release.yml at v0.0.276 -->
See the release blog post for more, including detailed descriptions of any newly added rules.
Highlights include: experimental support for linting Jupyter Notebooks.
To opt-in to linting Jupyter Notebook files, add the *.ipynb pattern to your include
setting, like so:
[tool.ruff]
# Allow Ruff to discover `*.ipynb` files.
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
This will prompt Ruff to discover Jupyter Notebook files in any specified directories, and lint them accordingly.
Jupyter Notebook support is currently opt-in and experimental. We'd love your help testing it out. Have feedback? Run into issues? Let us know!
flake8-pyi] Implement PYI002, PYI003, PYI004, PYI005 by @density in https://github.com/astral-sh/ruff/pull/5457numpy] Implement numpy-deprecated-function (NPY003) by @charliermarsh in https://github.com/astral-sh/ruff/pull/5468perflint] Implement unnecessary-list-cast (PERF101) by @qdegraaf in https://github.com/astral-sh/ruff/pull/5121perflint] Implement try-except-in-loop (PERF203) by @evanrittenhouse in https://github.com/astral-sh/ruff/pull/5166perflint] Implement manual-list-comprehension (PERF401) and manual-list-copy (PERF402) rules by @qdegraaf in https://github.com/astral-sh/ruff/pull/5298pylint] Implement Pylint single-string-used-for-slots (C0205) as single-string-slots (PLC0205) by @tjkuson in https://github.com/astral-sh/ruff/pull/5399--show-source) by @dhruvmanila in https://github.com/astral-sh/ruff/pull/5402--show-source) (#5402) by @dhruvmanila in https://github.com/astral-sh/ruff/pull/5414pyupgrade] Restore the keep-runtime-typing setting by @charliermarsh in https://github.com/astral-sh/ruff/pull/5470PythonVersion::Py312 by @charliermarsh in https://github.com/astral-sh/ruff/pull/5316pydantic.BaseSettings in mutable-class-default by @charliermarsh in https://github.com/astral-sh/ruff/pull/5312__slots__ assignments in mutable-class-default by @charliermarsh in https://github.com/astral-sh/ruff/pull/5314iteration-over-set by @charliermarsh in https://github.com/astral-sh/ruff/pull/5392unnecessary-encode-utf8 to fix encode on parenthesized strings correctly by @harupy in https://github.com/astral-sh/ruff/pull/5478Final assignments in stubs by @charliermarsh in https://github.com/astral-sh/ruff/pull/5490abc decorators when classifying function types by @charliermarsh in https://github.com/astral-sh/ruff/pull/5315@Author format for "Missing Author" rule in flake8-todos by @mayrholu in https://github.com/astral-sh/ruff/pull/4903invalid-escape-sequence rule by @charliermarsh in https://github.com/astral-sh/ruff/pull/5359flake8-django] Skip duplicate violations in DJ012 by @charliermarsh in https://github.com/astral-sh/ruff/pull/5469Full Changelog: https://github.com/astral-sh/ruff/compare/v0.0.275...v0.0.276
Your coding agent can read these notes before it upgrades. Set up the MCP server →