Update dependency ruff to v0.14.2 #107
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/ruff-0.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
==0.1.11->==0.14.2Release Notes
astral-sh/ruff (ruff)
v0.14.2Compare Source
Released on 2025-10-23.
Preview features
flake8-gettext] Resolve qualified names and built-in bindings (INT001,INT002,INT003) (#19045)Bug fixes
fastapi] Handle ellipsis defaults inFAST002autofix (#20810)flake8-simplify] SkipSIM911when unknown arguments are present (#20697)pyupgrade] Always parenthesize assignment expressions in fix forf-string(UP032) (#21003)pyupgrade] FixUP032conversion for decimal ints with underscores (#21022)fastapi] Skip autofix for keyword and__debug__path params (FAST003) (#20960)Rule changes
flake8-bugbear] SkipB905andB912for fewer than two iterables and no starred arguments (#20998)ruff] UseDiagnosticTagfor morepyflakesandpandasrules (#20801)CLI
ruff rule(#20168)Documentation
Other changes
matchpatterns bind different names (#20682)Contributors
v0.14.1Compare Source
Released on 2025-10-16.
Preview features
flake8-bugbear] Omit annotation in preview fix forB006(#20877)flake8-logging-format] Avoid dropping implicitly concatenated pieces in theG004fix (#20793)pydoclint] Implementdocstring-extraneous-parameter(DOC102) (#20376)pyupgrade] ExtendUP019to detecttyping_extensions.Text(UP019) (#20825)pyupgrade] Fix false negative forTypeVarwith default argument innon-pep695-generic-class(UP046) (#20660)Bug fixes
Truthiness::from_exprfor lambdas, generators, and f-strings (#20704)fastapi] Fix false positives for path parameters that FastAPI doesn't recognize (FAST003) (#20687)flake8-pyi] Fix operator precedence by adding parentheses when needed (PYI061) (#20508)ruff] Suppress diagnostic for f-string interpolations with debug text (RUF010) (#20525)Rule changes
airflow] Add warning toairflow.datasets.DatasetEventusage (AIR301) (#20551)flake8-bugbear] MarkB905andB912fixes as unsafe (#20695)DiagnosticTagfor more rules - changes display in editors (#20758,#20734)Documentation
lint.flake8-type-checking.quoted-annotationsdocs (#20765)flake8-datetimez] Clarify docs for several rules (#20778)RUF015description (#20873)Other changes
Contributors
v0.14.0Compare Source
Released on 2025-10-07.
Breaking changes
Preview features
flake8-bugbear] Include certain guaranteed-mutable expressions: tuples, generators, and assignment expressions (B006) (#20024)refurb] Add fixes forFURB101andFURB103(#20520)ruff] ExtendFA102with listed PEP 585-compatible APIs (#20659)Bug fixes
flake8-annotations] Fix return type annotations to handle shadowed builtin symbols (ANN201,ANN202,ANN204,ANN205,ANN206) (#20612)flynt] Fix f-string quoting for mixed quote joiners (FLY002) (#20662)isort] Fix inserting required imports before future imports (I002) (#20676)ruff] Handle argfile expansion errors gracefully (#20691)ruff] SkipRUF051ifelse/elifblock is present (#20705)ruff] Improve handling of intermixed comments inside from-imports (#20561)Documentation
flake8-comprehensions] Clarify fix safety documentation (C413) (#20640)Contributors
v0.13.3Compare Source
Release Notes
Released on 2025-10-02.
Preview features
ruff format --checkand add support for different output formats (#20443)pyflakes] Handle some common submodule import situations forunused-import(F401) (#20200)ruff] Do not flag%r+repr()combinations (RUF065) (#20600)Bug fixes
cli] Add conflict between--add-noqaand--diffoptions (#20642)pylint] Exempt required imports fromPLR0402(#20381)pylint] Fix missingmax-nested-blocksin settings display (#20574)pyupgrade] Prevent infinite loop withI002andUP026(#20634)Rule changes
flake8-simplify] Improve help message clarity (SIM105) (#20548)Documentation
isort] Clarify dependency betweenorder-by-typeandcase-sensitivesettings (#20559)pylint] Clarify fix safety to include left-hand hashability (PLR6201) (#20518)Other changes
playground] Fix quick fixes for empty ranges in playground (#20599)Contributors
Install ruff 0.13.3
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.13.3
v0.13.2Compare Source
Release Notes
Released on 2025-09-25.
Preview features
flake8-async] Implementblocking-path-method(ASYNC240) (#20264)flake8-bugbear] Implementmap-without-explicit-strict(B912) (#20429)flake8-bultins] Detect class-scope builtin shadowing in decorators, default args, and attribute initializers (A003) (#20178)ruff] Implementlogging-eager-conversion(RUF065) (#19942).pywfiles by default when linting and formatting (#20458)Bug fixes
flake8-comprehensions] Preserve trailing commas for single-element lists (C409) (#19571)flake8-pyi] Avoid syntax error from conflict withPIE790(PYI021) (#20010)flake8-simplify] Correct fix for positivemaxsplitwithout separator (SIM905) (#20056)pyupgrade] FixUP008not to apply when__class__is a local variable (#20497)ruff] FixB004to skip invalidhasattr/getattrcalls (#20486)ruff] Replace-nanwithnanwhen using the value to construct aDecimal(FURB164) (#20391)Documentation
ruff-wasm-web(#20539)flake8-bandit] Clarify the supported hashing functions (S324) (#20534)Other changes
playground] Allow hover quick fixes to appear for overlapping diagnostics (#20527)playground] Fix non‑BMP code point handling in quick fixes and markers (#20526)Contributors
Install ruff 0.13.2
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.13.2
v0.13.1Compare Source
Release Notes
Released on 2025-09-18.
Preview features
flake8-simplify] Detect unnecessaryNonedefault for additional key expression types (SIM910) (#20343)flake8-use-pathlib] Add fix forPTH123(#20169)flake8-use-pathlib] FixPTH101,PTH104,PTH105,PTH121fixes (#20143)flake8-use-pathlib] MakePTH111fix unsafe because it can change behavior (#20215)pycodestyle] FixE301to only trigger for functions immediately within a class (#19768)refurb] Marksingle-item-membership-testfix as always unsafe (FURB171) (#20279)Bug fixes
flake8-bandit] Fix truthiness: dict-only**displays not truthy forshell(S602,S604,S609) (#20177)flake8-simplify] Fix diagnostic to show correct method name forstr.rsplitcalls (SIM905) (#20459)flynt] Use triple quotes for joined raw strings with newlines (FLY002) (#20197)pyupgrade] Fix false positive when class name is shadowed by local variable (UP008) (#20427)pyupgrade] Prevent infinite loop withI002andUP026(#20327)ruff] Recognize t-strings, generators, and lambdas ininvalid-index-type(RUF016) (#20213)Rule changes
RUF102] Respect rule redirects in invalid rule code detection (#20245)flake8-bugbear] Mark the fix forunreliable-callable-checkas always unsafe (B004) (#20318)ruff] Allow dataclass attribute value instantiation from nested frozen dataclass (RUF009) (#20352)CLI
output-format=sarif(#20300)Documentation
ruff] Addanalyze.string-imports-min-dotsto settings (#20375)Other changes
Contributors
Install ruff 0.13.1
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.13.1
v0.13.0Compare Source
Release Notes
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
Several rules can now add
from __future__ import annotationsautomaticallyTC001,TC002,TC003,RUF013, andUP037now addfrom __future__ import annotationsas part of their fixes when thelint.future-annotationssetting is enabled. This allows the rules to move more imports intoTYPE_CHECKINGblocks (TC001,TC002, andTC003), use PEP 604 union syntax on Python versions before 3.10 (RUF013), and unquote more annotations (UP037).Full module paths are now used to verify first-party modules
Ruff now checks that the full path to a module exists on disk before categorizing it as a first-party import. This change makes first-party import detection more accurate, helping to avoid false positives on local directories with the same name as a third-party dependency, for example. See the FAQ section on import categorization for more details.
Deprecated rules must now be selected by exact rule code
Ruff will no longer activate deprecated rules selected by their group name or prefix. As noted below, the two remaining deprecated rules were also removed in this release, so this won't affect any current rules, but it will still affect any deprecations in the future.
The deprecated macOS configuration directory fallback has been removed
Ruff will no longer look for a user-level configuration file at
~/Library/Application Support/ruff/ruff.tomlon macOS. This feature was deprecated in v0.5 in favor of using the XDG specification (usually resolving to~/.config/ruff/ruff.toml), like on Linux. The fallback and accompanying deprecation warning have now been removed.Removed Rules
The following rules have been removed:
pandas-df-variable-name(PD901)non-pep604-isinstance(UP038)Stabilization
The following rules have been stabilized and are no longer in preview:
airflow-dag-no-schedule-argument(AIR002)airflow3-removal(AIR301)airflow3-moved-to-provider(AIR302)airflow3-suggested-update(AIR311)airflow3-suggested-to-move-to-provider(AIR312)long-sleep-not-forever(ASYNC116)f-string-number-format(FURB116)os-symlink(PTH211)generic-not-last-base-class(PYI059)redundant-none-literal(PYI061)pytest-raises-ambiguous-pattern(RUF043)unused-unpacked-variable(RUF059)useless-class-metaclass-type(UP050)The following behaviors have been stabilized:
assert-raises-exception(B017) now checks for direct calls tounittest.TestCase.assert_raisesandpytest.raisesinstead of only the context manager forms.missing-trailing-comma(COM812) andprohibited-trailing-comma(COM819) now check for trailing commas in PEP 695 type parameter lists.raw-string-in-exception(EM101) now also checks for byte strings in exception messages.invalid-mock-access(PGH005) now checks forAsyncMockmethods likenot_awaitedin addition to the synchronous variants.useless-import-alias(PLC0414) no longer applies to__init__.pyfiles, where it conflicted with one of the suggested fixes forunused-import(F401).bidirectional-unicode(PLE2502) now also checks for U+061C (Arabic Letter Mark).multiple-with-statements(SIM117) is now marked as always safe.Preview features
pyupgrade] EnableUP043in stub files (#20027)Bug fixes
pyupgrade] ApplyUP008only when the__class__cell exists (#19424)ruff] Fix empty f-string detection inin-empty-collection(RUF060) (#20249)Server
Documentation
pep8-naming] Fix formatting of__all__(N816) (#20301)Contributors
Install ruff 0.13.0
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.13.0
v0.12.12Compare Source
Release Notes
Preview features
airflow] ConvertDatasetOrTimeSchedule(datasets=...)toAssetOrTimeSchedule(assets=...)(AIR311) (#20202)airflow] Improve theAIR002error message (#20173)airflow] Moveairflow.operators.postgres_operator.MappingfromAIR302toAIR301(#20172)flake8-async] Implementblocking-inputrule (ASYNC250) (#20122)flake8-use-pathlib] MakePTH119andPTH120fixes unsafe because they can change behavior (#20118)pylint] Add U+061C toPLE2502(#20106)ruff] Fix false negative for empty f-strings indequecalls (RUF037) (#20109)Bug fixes
fastapi] Fix false positive for paths with spaces around parameters (FAST003) (#20077)flake8-comprehensions] SkipC417when lambda containsyield/yield from(#20201)perflint] Handle tuples in dictionary comprehensions (PERF403) (#19934)Rule changes
pycodestyle] Preserve return type annotation forParamSpec(E731) (#20108)Documentation
Contributors
Install ruff 0.12.12
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.12
v0.12.11Compare Source
Release Notes
Preview features
airflow] ExtendAIR311andAIR312rules (#20082)airflow] Replace wrong pathairflow.io.storagewithairflow.io.store(AIR311) (#20081)flake8-async] Implementblocking-http-call-httpx-in-async-function(ASYNC212) (#20091)flake8-logging-format] Add auto-fix for f-string logging calls (G004) (#19303)flake8-use-pathlib] Add autofix forPTH211(#20009)flake8-use-pathlib] MakePTH100fix unsafe because it can change behavior (#20100)Bug fixes
pyflakes,pylint] Fix false positives caused by__class__cell handling (F841,PLE0117) (#20048)pyflakes] Fixallowed-unused-importsmatching for top-level modules (F401) (#20115)ruff] Fix false positive for t-strings indefault-factory-kwarg(RUF026) (#20032)ruff] Preserve relative whitespace in multi-line expressions (RUF033) (#19647)Rule changes
ruff] Handle empty t-strings inunnecessary-empty-iterable-within-deque-call(RUF037) (#20045)Documentation
D413links in docstrings convention FAQ (#20089)flake8-use-pathlib] Update links to the table showing the correspondence betweenosandpathlib(#20103)Contributors
Install ruff 0.12.11
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.11
v0.12.10Compare Source
Release Notes
Preview features
flake8-simplify] Implement fix formaxsplitwithout separator (SIM905) (#19851)flake8-use-pathlib] Add fixes forPTH102andPTH103(#19514)Bug fixes
isort] Handle multiple continuation lines after module docstring (I002) (#19818)pyupgrade] Avoid reporting__future__features as unnecessary when they are used (UP010) (#19769)pyupgrade] Handle nestedOptionals (UP045) (#19770)Rule changes
pycodestyle] MakeE731fix unsafe instead of display-only for class assignments (#19700)pyflakes] Add secondary annotation showing previous definition (F811) (#19900)Documentation
flake8-annotations] Remove unused import in example (ANN401) (#20000)Contributors
Install ruff 0.12.10
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.10
v0.12.9Compare Source
Release Notes
Preview features
airflow] Add check forairflow.secrets.cache.SecretCache(AIR301) (#17707)ruff] Offer a safe fix for multi-digit zeros (RUF064) (#19847)Bug fixes
flake8-blind-except] FixBLE001false-positive onraise ... from None(#19755)flake8-comprehensions] Fix false positive forC420with attribute, subscript, or slice assignment targets (#19513)flake8-simplify] Fix handling of U+001C..U+001F whitespace (SIM905) (#19849)Rule changes
pylint] Use lowercase hex characters to match the formatter (PLE2513) (#19808)Documentation
lint.future-annotationslink (#19876)Other changes
Build
riscv64binaries for release (#19819)Add rule code to error description in GitLab output (#19896)
Improve rendering of the
fulloutput format (#19415)Below is an example diff for
F401:For now, the primary difference is the movement of the filename, line number, and column information to a second line in the header. This new representation will allow us to make further additions to Ruff's diagnostics, such as adding sub-diagnostics and multiple annotations to the same snippet.
Contributors
Install ruff 0.12.9
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.9
v0.12.8Compare Source
Release Notes
Preview features
flake8-use-pathlib] ExpandPTH201to check allPurePathsubclasses (#19440)Bug fixes
flake8-blind-except] ChangeBLE001to correctly parse exception tuples (#19747)flake8-errmsg] Excludetyping.castfromEM101(#19656)flake8-simplify] Fix raw string handling inSIM905for embedded quotes (#19591)flake8-import-conventions] Avoid false positives for NFKC-normalized__debug__import aliases inICN001(#19411)isort] Fix syntax error after docstring ending with backslash (I002) (#19505)pylint] MarkPLC0207fixes as unsafe when*argsunpacking is present (#19679)pyupgrade] Prevent infinite loop withI002(UP010,UP035) (#19413)ruff] Parenthesize generator expressions in f-strings (RUF010) (#19434)Rule changes
eradicate] Don't flagpyreflypragmas as unused code (ERA001) (#19731)Documentation
RUF036(#19706)typingdocumentation (#19648)refurb] Make more examples error out-of-the-box (#19695,#19673,#19672)Other changes
ruffid (#19654)Contributors
Install ruff 0.12.8
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.8
v0.12.7Release Notes
This is a follow-up release to 0.12.6. Because of an issue in the package metadata, 0.12.6 failed to publish fully to PyPI and has been yanked. Similarly, there is no GitHub release or Git tag for 0.12.6. The contents of the 0.12.7 release are identical to 0.12.6, except for the updated metadata.
0.12.6 Release Notes
Preview features
flake8-commas] Add support for trailing comma checks in type parameter lists (COM812,COM819) (#19390)pylint] Implement auto-fix formissing-maxsplit-arg(PLC0207) (#19387)ruff] Offer fixes forRUF039in more cases (#19065)Bug fixes
.pyifiles in ruff analyze graph (#19611)flake8-pyi] Preserve inline comment in ellipsis removal (PYI013) (#19399)perflint] Ignore rule if target isglobalornonlocal(PERF401) (#19539)pyupgrade] FixUP030to avoid modifying double curly braces in format strings (#19378)refurb] Ignore decorated functions forFURB118(#19339)refurb] Markintandboolcases forDecimal.from_floatas safe fixes (FURB164) (#19468)ruff] FixRUF033for named default expressions (#19115)Rule changes
flake8-blind-except] ChangeBLE001to permitlogging.critical(..., exc_info=True)(#19520)Performance
Contributors
Install ruff 0.12.7
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.7
v0.12.5Compare Source
Release Notes
Preview features
flake8-use-pathlib] Add autofix forPTH101,PTH104,PTH105,PTH121(#19404)ruff] Support byte strings (RUF055) (#18926)Bug fixes
unreachablepanic in parser (#19183)flake8-pyi] Skip fix if allUnionmembers areNone(PYI016) (#19416)perflint] Parenthesize generator expressions (PERF401) (#19325)pylint] Handle empty comments after line continuation (PLR2044) (#19405)Rule changes
pep8-naming] FixN802false positives forCGIHTTPRequestHandlerandSimpleHTTPRequestHandler(#19432)Contributors
Install ruff 0.12.5
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.5
v0.12.4Compare Source
Release Notes
Preview features
flake8-type-checking,pyupgrade,ruff] Addfrom __future__ import annotationswhen it would allow new fixes (TC001,TC002,TC003,UP037,RUF013) (#19100)flake8-use-pathlib] Add autofix forPTH109(#19245)pylint] Detect indirectpathlib.Pathusages forunspecified-encoding(PLW1514) (#19304)Bug fixes
flake8-bugbear] FixB017false negatives for keyword exception arguments (#19217)flake8-use-pathlib] Fix false negative on directPath()instantiation (PTH210) (#19388)flake8-django] FixDJ008false positive for abstract models with type-annotatedabstractfield (#19221)isort] FixI002import insertion after docstring with multiple string statements (#19222)isort] Treat form feed as valid whitespace before a semicolon (#19343)pydoclint] FixSyntaxErrorfrom fixes with line continuations (D201,D202) (#19246)refurb]FURB164fix should validate arguments and should usually be marked unsafe (#19136)Rule changes
flake8-use-pathlib] Skip single dots forinvalid-pathlib-with-suffix(PTH210) on versions >= 3.14 (#19331)pep8_naming] Avoid false positives on standard library functions with uppercase names (N802) (#18907)pycodestyle] Handle brace escapes for t-strings in logical lines (#19358)pylint] Extend invalid string character rules to include t-strings (#19355)ruff] Allowstrictkwarg when checking forstarmap-zip(RUF058) in Python 3.14+ (#19333)Documentation
flake8-type-checking] MakeTC010docs example more realistic (#19356)Contributors
Install ruff 0.12.4
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.4
v0.12.3Compare Source
Release Notes
Preview features
flake8-bugbear] Support non-context-manager calls inB017(#19063)flake8-use-pathlib] Add autofixes forPTH100,PTH106,PTH107,PTH108,PTH110,PTH111,PTH112,PTH113,PTH114,PTH115,PTH117,PTH119,PTH120(#19213)flake8-use-pathlib] Add autofixes forPTH203,PTH204,PTH205(#18922)Bug fixes
flake8-return] Fix false-positive for variables used inside nested functions inRET504(#18433)flake8-type-checking] Fix syntax error introduced by fix (TC008) (#19150)pyupgrade] Keyword arguments insupershould suppress theUP008fix (#19131)Documentation
flake8-pyi] Make example error out-of-the-box (PYI007,PYI008) (#19103)flake8-simplify] Make example error out-of-the-box (SIM116) (#19111)flake8-type-checking] Make example error out-of-the-box (TC001) (#19151)flake8-use-pathlib] Make example error out-of-the-box (PTH210) (#19189)pycodestyle] Make example error out-of-the-box (E272) (#19191)pycodestyle] Make example not raise unnecessarySyntaxError(E114) (#19190)pydoclint] Make example error out-of-the-box (DOC501) (#19218)pylint,pyupgrade] Fix syntax errors in examples (PLW1501,UP028) (#19127)pylint] Updatemissing-maxsplit-argdocs and error to suggest proper usage (PLC0207) (#18949)flake8-bandit] Make example error out-of-the-box (S412) (#19241)Contributors
Install ruff 0.12.3
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.3
v0.12.2Compare Source
Release Notes
Preview features
flake8-pyi] ExpandOptional[A]toA | None(PYI016) (#18572)pyupgrade] MarkUP008fix safe if no comments are in range (#18683)Bug fixes
flake8-comprehensions] FixC420to prepend whitespace when needed (#18616)perflint] FixPERF403panic on attribute or subscription loop variable (#19042)pydocstyle] FixD413infinite loop for parenthesized docstring (#18930)pylint] FixPLW0108autofix introducing a syntax error when the lambda's body contains an assignment expression (#18678)refurb] Fix false positive on empty tuples (FURB168) (#19058)ruff] Allow morefieldcalls fromattrs(RUF009) (#19021)ruff] Fix syntax error introduced for an empty string followed by a u-prefixed string (UP025) (#18899)Rule changes
flake8-executable] Allowuvxin shebang line (EXE003) (#18967)pandas] Avoid flaggingPD002ifpandasis not imported (#18963)pyupgrade] Avoid PEP-604 unions withtyping.NamedTuple(UP007,UP045) (#18682)Documentation
import-outside-top-level (PLC0415)andlint.flake8-tidy-imports.banned-module-level-imports(#18733)format.skip-magic-trailing-commaexample (#19095)airflow] MakeAIR302example error out-of-the-box (#18988)airflow] MakeAIR312example error out-of-the-box (#18989)flake8-annotations] MakeANN401example error out-of-the-box (#18974)flake8-async] MakeASYNC100example error out-of-the-box (#18993)flake8-async] MakeASYNC105example error out-of-the-box (#19002)flake8-async] MakeASYNC110example error out-of-the-box (#18975)flake8-async] MakeASYNC210example error out-of-the-box (#18977)flake8-async] MakeASYNC220,ASYNC221, andASYNC222examples error out-of-the-box (#18978)flake8-async] MakeASYNC251example error out-of-the-box (#18990)flake8-bandit] MakeS201example error out-of-the-box (#19017)flake8-bandit] MakeS604andS609examples error out-of-the-box (#19049)flake8-bugbear] MakeB028example error out-of-the-box (#19054)flake8-bugbear] MakeB911example error out-of-the-box (#19051)flake8-datetimez] MakeDTZ011example error out-of-the-box (#19055)flake8-datetimez] MakeDTZ901example error out-of-the-box (#19056)flake8-pyi] MakePYI032example error out-of-the-box (#19061)flake8-pyi] Make example error out-of-the-box (PYI014,PYI015) (#19097)flake8-pyi] Make example error out-of-the-box (PYI042) (#19101)flake8-pyi] Make example error out-of-the-box (PYI059) (#19080)flake8-pyi] Make example error out-of-the-box (PYI062) (#19079)flake8-pytest-style] Make example error out-of-the-box (PT023) (#19104)flake8-pytest-style] Make example error out-of-the-box (PT030) (#19105)flake8-quotes] Make example error out-of-the-box (Q003) (#19106)flake8-simplify] Make example error out-of-the-box (SIM110) (#19113)flake8-simplify] Make example error out-of-the-box (SIM113) (#19109)flake8-simplify] Make example error out-of-the-box (SIM401) (#19110)pyflakes] Fix backslash in docs (F621) (#19098)pylint] FixPLC0415example (#18970)Contributors
Install ruff 0.12.2
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.2
v0.12.1Compare Source
Release Notes
Preview features
flake8-errmsg] ExtendEM101to support byte strings (#18867)flake8-use-pathlib] Add autofix forPTH202(#18763)pygrep-hooks] AddAsyncMockmethods toinvalid-mock-access(PGH005) (#18547)pylint] Ignore__init__.pyfiles in (PLC0414) (#18400)ruff] TriggerRUF037for empty string and byte strings (#18862).pyifiles (#18888)Bug fixes
remove_argument(#18805)flake8-logging] Avoid false positive forexc_info=Trueoutsidelogger.exception(LOG014) (#18737)flake8-pytest-style] Enforcepytestimport for decorators (#18779)flake8-pytest-style] Mark autofix forPT001andPT023as unsafe if there's comments in the decorator (#18792)flake8-pytest-style]PT001/PT023fix makes syntax error on parenthesized decorator (#18782)flake8-raise] Make fix unsafe if it deletes comments (RSE102) (#18788)flake8-simplify] FixSIM911autofix creating a syntax error (#18793)flake8-simplify] Fix false negatives for shadowed bindings (SIM910,SIM911) (#18794)flake8-simplify] Preserve original behavior forexcept ()and bareexcept(SIM105) (#18213)flake8-pyi] FixPYI041's fix causingTypeErrorwithNone | None | ...(#18637)perflint] FixPERF101autofix creating a syntax error and mark autofix as unsafe if there are comments in thelistcall expr (#18803)perflint] Fix false negative inPERF401(#18866)pylint] Avoid flattening nestedmin/maxwhen outer call has single argument (PLW3301) (#16885)pylint] FixPLC2801autofix creating a syntax error (#18857)pylint] MarkPLE0241autofix as unsafe if there's comments in the base classes (#18832)pylint] SuppressPLE2510/PLE2512/PLE2513/PLE2514/PLE2515autofix if the text contains an odd number of backslashes (#18856)refurb] Detect more exotic float literals inFURB164(#18925)refurb] FixFURB163autofix creating a syntax error foryieldexpressions (#18756)refurb] MarkFURB129autofix as unsafe if there's comments in thereadlinescall (#18858)ruff] Fix false positives and negatives inRUF010(#18690)analyze.directionvariant names (#18892)Rule changes
flake8-return] MarkRET501fix unsafe if comments are inside (#18780)flake8-async] Fix detection for large integer sleep durations inASYNC116rule (#18767)flake8-async] Mark autofix forASYNC115as unsafe if the call expression contains comments (#18753)flake8-bugbear] Mark autofix forB004as unsafe if thehasattrcall expr contains comments (#18755)flake8-comprehension] Mark autofix forC420as unsafe if there's comments inside the dict comprehension (#18768)flake8-comprehensions] Handle template strings for comprehension fixes (#18710)flake8-future-annotations] Add autofix (FA100) (#18903)pyflakes] MarkF504/F522/F523autofix as unsafe if there's a call with side effect (#18839)pylint] Allow fix with comments and document performance implications (PLW3301) (#18936)pylint] Detect more exoticNaNliterals inPLW0177(#18630)pylint] FixPLC1802autofix creating a syntax error and mark autofix as unsafe if there's comments in thelencall (#18836)pyupgrade] Extend version detection to includesys.version_info.major(UP036) (#18633)ruff] Add lint ruleRUF064for callingchmodwith non-octal integers (#18541)ruff] Addedcls.__dict__.get('__annotations__')check (RUF063) (#18233)ruff] Frozendataclassdefault should be valid (RUF009) (#18735)Server
Documentation
perflint] Small docs improvement toPERF401(#18786)pyupgrade]: Usesuper(), not__super__in error messages (UP008) (#18743)flake8-pie] Small docs fix toPIE794(#18829)flake8-pyi] Correctcollections-named-tupleexample to use PascalCase assignment (#16884)flake8-pie] Add note on type checking benefits tounnecessary-dict-kwargs(PIE804) (#18666)pycodestyle] Clarify PEP 8 relationship towhitespace-around-operatorrules (#18870)Other changes
flake8-logging] Add fix safety section toLOG002(#18840)pyupgrade] Add fix safety section toUP010(#18838)Contributors
Install ruff 0.12.1
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.1
v0.12.0Compare Source
Release Notes
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
Detection of more syntax errors
Ruff now detects version-related syntax errors, such as the use of the
matchstatement on Python versions before 3.10, and syntax errors emitted by
CPython's compiler, such as irrefutable
matchpatterns before the finalcasearm.New default Python version handling for syntax errors
Ruff will default to the latest supported Python version (3.13) when
checking for the version-related syntax errors mentioned above to prevent
false positives in projects without a Python version configured. The default
in all other cases, like applying lint rules, is unchanged and remains at the
minimum supported Python version (3.9).
Updated f-string formatting
Ruff now formats multi-line f-strings with format specifiers to avoid adding a
line break after the format specifier. This addresses a change to the Python
grammar in version 3.13.4 that made such a line break a syntax error.
rust-toolchain.tomlis no longer included in source distributionsThe
rust-toolchain.tomlis used to specify a higher Rust version than Ruff'sminimum supported Rust version (MSRV) for development and building release
artifacts. However, when present in source distributions, it would also cause
downstream package maintainers to pull in the same Rust toolchain, even if
their available toolchain was MSRV-compatible.
Removed Rules
The following rules have been removed:
suspicious-xmle-tree-usage(S320)Deprecated Rules
The following rules have been deprecated:
pandas-df-variable-nameStabilization
The following rules have been stabilized and are no longer in preview:
for-loop-writes(FURB122)check-and-remove-from-set(FURB132)verbose-decimal-constructor(FURB157)fromisoformat-replace-z(FURB162)int-on-sliced-str(FURB166)exc-info-outside-except-handler(LOG014)import-outside-top-level(PLC0415)unnecessary-dict-index-lookup(PLR1733)nan-comparison(PLW0177)eq-without-hash(PLW1641)pytest-parameter-with-default-argument(PT028)pytest-warns-too-broad(PT030)pytest-warns-with-multiple-statements(PT031)invalid-formatter-suppression-comment(RUF028)dataclass-enum(RUF049)class-with-mixed-type-vars(RUF053)unnecessary-round(RUF057)starmap-zip(RUF058)non-pep604-annotation-optional(UP045)non-pep695-generic-class(UP046)non-pep695-generic-function(UP047)private-type-parameter(UP049)The following behaviors have been stabilized:
collection-literal-concatenation(RUF005) now recognizes slices, inaddition to list literals and variables.
readlines-in-for(FURB129) is now marked as always safe.if-else-block-instead-of-if-exp(SIM108) will now further simplifyexpressions to use
orinstead of anifexpression, where possible.unused-noqa(RUF100) now checks for file-levelnoqacomments as wellas inline comments.
subprocess-without-shell-equals-true(S603) now accepts literal strings,as well as lists and tuples of literal strings, as trusted input.
boolean-type-hint-positional-argument(FBT001) now applies to types thatinclude
bool, likebool | intortyping.Optional[bool], in addition toplain
boolannotations.non-pep604-annotation-union(UP007) has now been split into two rules.UP007now applies only totyping.Union, whilenon-pep604-annotation-optional(UP045) checks for use oftyping.Optional.UP045has also been stabilized in this release, but youmay need to update existing
include,ignore, ornoqasettings toaccommodate this change.
Preview features
ruff] Check for non-context-manager use ofpytest.raises,pytest.warns, andpytest.deprecated_call(RUF061) (#17368)Bug fixes
readlines(#18542)\rand\r\nhandling in t- and f-string debug texts (#18673)}when f-string expression has a format specifier (#18704)flake8-pyi] Avoid syntax error in the case of starred and keyword arguments (PYI059) (#18611)flake8-return] FixRET504autofix generating a syntax error (#18428)pep8-naming] Suppress fix forN804andN805if the recommended name is already used (#18472)pycodestyle] Avoid causing a syntax error in expressions spanning multiple lines (E731) (#18479)pyupgrade] SuppressUP008ifsuperis shadowed (#18688)refurb] Parenthesize lambda and ternary expressions (FURB122,FURB142) (#18592)ruff] Handle extra arguments todeque(RUF037) (#18614)ruff] Preserve parentheses arounddequein fix forunnecessary-empty-iterable-within-deque-call(RUF037) (#18598)ruff] Validate arguments before offering a fix (RUF056) (#18631)ruff] Skip fix forRUF059if dummy name is already bound (#18509)pylint] FixPLW0128to check assignment targets in square brackets and after asterisks (#18665)Rule changes
returnstatements (B909) (#18408)ty:comments as pragma comments (#18532)flake8-pyi] Applycustom-typevar-for-selfto string annotations (PYI019) (#18311)pyupgrade] Don't offer a fix forOptional[None](UP007,UP045)(#18545)pyupgrade] Fixsuper(__class__, self)detection (UP008) (#18478)refurb] Make the fix forFURB163unsafe forlog2,log10,*args, and deleted comments (#18645)Server
Documentation
*from glob pattern example forper-file-target-version(#18709)pylint] De-emphasize__hash__ = Parent.__hash__(PLW1641) (#18613)refurb] Add a note about float literal handling (FURB157) (#18615)Contributors
Install ruff 0.12.0
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.12.0
v0.11.13Compare Source
Release Notes
Preview features
airflow] Add unsafe fix for module moved cases (AIR301,AIR311,AIR312,AIR302) (#18367,#18366,#18363,#18093)refurb] Add coverage ofsetandfrozensetcalls (FURB171) (#18035)refurb] MarkFURB180fix unsafe when class has bases (#18149)Bug fixes
perflint] Fix missing parentheses for lambda and ternary conditions (PERF401,PERF403) (#18412)pyupgrade] ApplyUP035only on py313+ forget_type_hints()(#18476)pyupgrade] Make fix unsafe if it deletes comments (UP004,UP050) (#18393, #18390)Rule changes
fastapi] Avoid false positive for class dependencies (FAST003) (#18271)Documentation
Other changes
Contributors
Install ruff 0.11.13
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.13
v0.11.12Compare Source
Release Notes
Preview features
airflow] Revise fix titles (AIR3) (#18215)pylint] Implementmissing-maxsplit-arg(PLC0207) (#17454)pyupgrade] New ruleUP050(useless-class-metaclass-type) (#18334)flake8-use-pathlib] Replaceos.symlinkwithPath.symlink_to(PTH211) (#18337)Bug fixes
flake8-bugbear] Ignore__debug__attribute inB010(#18357)flake8-async] Fixanyio.sleepargument name (ASYNC115,ASYNC116) (#18262)refurb] FixFURB129autofix generating invalid syntax (#18235)Rule changes
flake8-implicit-str-concat] Add autofix forISC003(#18256)pycodestyle] Improve the diagnostic message forE712(#18328)flake8-2020] Fix diagnostic message for!=comparisons (YTT201) (#18293)pyupgrade] Make fix unsafe if it deletes comments (UP010) (#18291)Documentation
flake8-bugbear] Add fix safety section (B006) (#17652)Contributors
Install ruff 0.11.12
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.12
v0.11.11Compare Source
Release Notes
Preview features
airflow] Add autofixes forAIR302andAIR312(#17942)airflow] Move rules fromAIR312toAIR302(#17940)airflow] UpdateAIR301andAIR311with the latest Airflow implementations (#17985)flake8-simplify] Enable fix in preview mode (SIM117) (#18208)Bug fixes
[]and_(#18147)pylint] FixPLW1514not recognizing theencodingpositional argument ofcodecs.open(#18109)CLI
Documentation
flake8-print] Improve print/pprint docs forT201andT203(#18130)flake8-simplify] Add fix safety section (SIM110,SIM210) (#18114,#18100)pylint] Fix docs example that produced different output (PLW0603) (#18216)Contributors
Install ruff 0.11.11
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.11
v0.11.10Compare Source
Release Notes
Preview features
ruff] Implement a recursive check forRUF060(#17976)airflow] Enable autofixes forAIR301andAIR311(#17941)airflow] Apply try catch guard to allAIR3rules (#17887)airflow] ExtendAIR311rules (#17913)Bug fixes
flake8-bugbear] IgnoreB028ifskip_file_prefixesis present (#18047)flake8-pie] Mark autofix forPIE804as unsafe if the dictionary contains comments (#18046)flake8-simplify] Correct behavior forstr.split/rsplitwithmaxsplit=0(SIM905) (#18075)flake8-simplify] FixSIM905autofix forrsplitcreating a reversed list literal (#18045)flake8-use-pathlib] Suppress diagnostics for allos.*functions that have thedir_fdparameter (PTH) (#17968)refurb] Mark autofix as safe only for number literals (FURB116) (#17692)Rule changes
flake8-bandit] SkipS608for expressionless f-strings (#17999)flake8-pytest-style] Don't recommendusefixturesforparametrizevalues (PT019) (#17650)pyupgrade] Addresource.erroras deprecated alias ofOSError(UP024) (#17933)CLI
Documentation
flake8-simplify] Add fix safety section (SIM103) (#18086)flake8-simplify] Add fix safety section (SIM112) (#18099)pylint] Add fix safety section (PLC0414) (#17802)pylint] Add fix safety section (PLE4703) (#17824)pylint] Add fix safety section (PLW1514) (#17932)pylint] Add fix safety section (PLW3301) (#17878)ruff] Add fix safety section (RUF007) (#17755)ruff] Add fix safety section (RUF033) (#17760)Contributors
Install ruff 0.11.10
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.10
v0.11.9Compare Source
Release Notes
Preview features
airflow] FixSQLTableCheckOperatortypo (AIR302) (#17946)airflow] Removeairflow.utils.dag_parsing_context.get_parsing_context(AIR301) (#17852)airflow] Skip attribute check in try catch block (AIR301) (#17790)flake8-bandit] Mark tuples of string literals as trusted input inS603(#17801)isort] Check full module path against project root(s) when categorizing first-party imports (#16565)ruff] Add new rulein-empty-collection(RUF060) (#16480)Bug fixes
combinecall forlint.typing-extensionssetting (#17823)flake8-async] Fix module name inASYNC110,ASYNC115, andASYNC116fixes (#17774)pyupgrade] Add spaces between tokens as necessary to avoid syntax errors inUP018autofix (#17648)refurb] Fix false positive for float and complex numbers inFURB116(#17661)Documentation
PLC2801,PLR1722, andRUF013(#17825, #17826, #17759)check-typed-exceptionfromS110andS112(#17786)Other changes
ruff analyze graph(#17743)Contributors
Install ruff 0.11.9
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.9
v0.11.8Compare Source
Release Notes
Preview features
airflow] Apply auto fixes to cases where the names have changed in Airflow 3 (AIR302,AIR311) (#17553, #17570, #17571)airflow] ExtendAIR301rule (#17598)airflow] Update existingAIR302rules with better suggestions (#17542)refurb] Mark fix as safe forreadlines-in-for(FURB129) (#17644)nonlocaldeclaration at module level (#17559)x = *y(#17624)Bug fixes
flake8-pyi] EnsureLiteral[None,] | Literal[None,]is not autofixed toNone | None(PYI061) (#17659)flake8-use-pathlib] Avoid suggestingPath.iterdir()foros.listdirwith file descriptor (PTH208) (#17715)flake8-use-pathlib] FixPTH104false positive whenrenameis passed a file descriptor (#17712)flake8-use-pathlib] FixPTH116false positive whenstatis passed a file descriptor (#17709)flake8-use-pathlib] FixPTH123false positive whenopenis passed a file descriptor from a function call (#17705)pycodestyle] Fix duplicated diagnostic inE712(#17651)pylint] Detectglobaldeclarations in module scope (PLE0118) (#17411)async-comprehension-in-sync-comprehensionmore specific (#17460)Configuration
typing_extensionsimports (#17611)Documentation
lint.pydocstyle.ignore-var-parametersoption (#17740)ASYNC116,FLY002,D200,RUF005,RUF017,RUF027,RUF028,RUF057) (#17497, #17496, #17502, #17484, #17480, #17485, #17722, #17483)Other changes
Contributors
Install ruff 0.11.8
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.8
v0.11.7Compare Source
Release Notes
Preview features
airflow] Apply auto fixes to cases where the names have changed in Airflow 3 (AIR301) (#17355)perflint] Implement fix formanual-dict-comprehension(PERF403) (#16719)Bug fixes
airflow] Fix typos in provider package names (AIR302,AIR312) (#17574)flake8-type-checking] Visit keyword arguments in checks involvingtyping.cast/typing.NewTypearguments (#17538)pyupgrade] Preserve parenthesis when fixing native literals containing newlines (UP018) (#17220)refurb] Mark theFURB161fix unsafe except for integers and booleans (#17240)Rule changes
perflint] Allow list function calls to be replaced with a comprehension (PERF401) (#17519)pycodestyle] Auto-fix redundant boolean comparison (E712) (#17090)pylint] make fix unsafe if delete comments (PLR1730) (#17459)Documentation
Contributors
Install ruff 0.11.7
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.7
v0.11.6Compare Source
Release Notes
Preview features
airflow] ExtractAIR311fromAIR301rules (AIR301,AIR311) (#17310, #17422)Bug fixes
\is at end of file (#17409)Contributors
Install ruff 0.11.6
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.6
v0.11.5Compare Source
Release Notes
Preview features
airflow] Add missingAIR302attribute check (#17115)airflow] Expand module path check to individual symbols (AIR302) (#17278)airflow] ExtractAIR312fromAIR302rules (AIR302,AIR312) (#17152)airflow] Update oudatedAIR301,AIR302rules (#17123)await(#17282)Bug fixes
flake8-pie] Avoid false positive for multiple assignment withauto()(PIE796) (#17274)Rule changes
ruff] FixRUF100to detect unused file-levelnoqadirectives with specific codes (#17042) (#17061)flake8-pytest-style] Avoid false positive for legacy form ofpytest.raises(PT011) (#17231)Documentation
Contributors
Install ruff 0.11.5
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.5
v0.11.4Compare Source
Release Notes
Preview features
ruff] Implementinvalid-rule-codeasRUF102(#17138)matchmapping patterns (#17129)matchclass patterns (#17186)Bug fixes
matchpatterns (#17184)typing.Annotatedsubscripts (#17201)Contributors
Install ruff 0.11.4
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.4
v0.11.3Compare Source
Release Notes
Preview features
airflow] Add more autofixes forAIR302(#16876, #16977, #16976, #16965)airflow] MoveAIR301toAIR002(#16978)airflow] MoveAIR302toAIR301andAIR303toAIR302(#17151)flake8-bandit] Markstrandlist[str]literals as trusted input (S603) (#17136)ruff] Support slices inRUF005(#17078)casepattern before final case (#16905)casepattern (#16957)return,yield, andfor(#17134)__debug__(#16984)Bug fixes
panic!when running Ruff from a deleted directory (#16903) (#17054)CLI
pyproject.tomlcorrectly when it is passed via stdin (#16971)Configuration
flake8-import-conventions] Add importnumpy.typing as nptto defaultflake8-import-conventions.aliases(#17133)Documentation
refurb] Document whyUserDict,UserList, andUserStringare preferred overdict,list, andstr(FURB189) (#16927)Contributors
Install ruff 0.11.3
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.3
v0.11.2Compare Source
Release Notes
Preview features
Contributors
Install ruff 0.11.2
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.2
v0.11.1Compare Source
Release Notes
Preview features
airflow] Addchain,chain_linearandcross_downstreamforAIR302(#16647)Bug fixes
FixAllaction in presence of version-specific syntax errors (#16848)flake8-bandit] Allow raw strings insuspicious-mark-safe-usage(S308) #16702 (#16770)refurb] Avoid panickingunwrapinverbose-decimal-constructor(FURB157) (#16777)refurb] Fix starred expressions fix (FURB161) (#16550)--statisticsreporting for unsafe fixes (#16756)Rule changes
flake8-executables] Allowuv runin shebang line forshebang-missing-python(EXE003) (#16849,#16855)CLI
--exit-non-zero-on-format(#16009)Documentation
__init__.py(#16818)flake8-gettext] Swapformat-andprintf-in-get-text-func-callexamples (INT002,INT003) (#16769)Contributors
Install ruff 0.11.1
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.1
v0.11.0Compare Source
Release Notes
This is a follow-up to release 0.10.0. The
requires-pythoninference changes were unintentionally omitted from 0.10.0, and have been included here. This release also includes stabilization of the preview behavior forPGH004.Breaking changes
Changes to how the Python version is inferred when a
target-versionis not specified (#16319)In previous versions of Ruff, you could specify your Python version with:
target-versionoption in aruff.tomlfile or the[tool.ruff]section of a pyproject.toml file.project.requires-pythonfield in apyproject.tomlfile with a[tool.ruff]section.These options worked well in most cases, and are still recommended for fine control of the Python version. However, because of the way Ruff discovers config files,
pyproject.tomlfiles without a[tool.ruff]section would be ignored, including therequires-pythonsetting. Ruff would then use the default Python version (3.9 as of this writing) instead, which is surprising when you've attempted to request another version.In v0.10, config discovery has been updated to address this issue:
ruff.tomlfile without atarget-version, it will checkfor a
pyproject.tomlfile in the same directory and respect itsrequires-pythonversion, even if it does not contain a[tool.ruff]section.
requires-pythonfield of the closestpyproject.tomlin a parent directory will take precedence.ruff.tomlorpyproject.tomlwith a[tool.ruff]section) in the directory of the file being checked, Ruff willsearch for the closest
pyproject.tomlin the parent directories and use itsrequires-pythonsetting.Stabilization
The following behaviors have been stabilized:
blanket-noqa(PGH004): Also detect blanked file-level noqa comments (and not just line level comments).Preview features
forstatement iterator clause before Python 3.9 (#16558)Install ruff 0.11.0
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.11.0
v0.10.0Compare Source
Release Notes
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
See also, the "Remapped rules" section which may result in disabled rules.
Changes to how the Python version is inferred when a
target-versionis not specified (#16319)While this change was intended to be released in 0.10.0, it was unintentionally omitted. It was subsequently released in 0.11.0 — see the changelog there for details.
Updated
TYPE_CHECKINGbehavior (#16669)Previously, Ruff only recognized typechecking blocks that tested the
typing.TYPE_CHECKINGsymbol. Now, Ruff recognizes any local variable namedTYPE_CHECKING. This release also removes support for the legacyif 0:andif False:typechecking checks. Use a localTYPE_CHECKINGvariable instead.More robust noqa parsing (#16483)
The syntax for both file-level and in-line suppression comments has been unified and made more robust to certain errors. In most cases, this will result in more suppression comments being read by Ruff, but there are a few instances where previously read comments will now log an error to the user instead. Please refer to the documentation on Error suppression for the full specification.
Avoid unnecessary parentheses around with statements with a single context manager and a trailing comment (#14005)
This change fixes a bug in the formatter where it introduced unnecessary parentheses around with statements with a single context manager and a trailing comment. This change may result in a change in formatting for some users.
Bump alpine default tag to 3.21 for derived Docker images (#16456)
Alpine 3.21 was released in Dec 2024 and is used in the official Alpine-based Python images. Now the ruff:alpine image will use 3.21 instead of 3.20 and ruff:alpine3.20 will no longer be updated.
Deprecated Rules
The following rules have been deprecated:
non-pep604-isinstance(UP038)suspicious-xmle-tree-usage(S320)Remapped rules
The following rules have been remapped to new rule codes:
unsafe-markup-use]:RUF035toS704Stabilization
The following rules have been stabilized and are no longer in preview:
batched-without-explicit-strict(B911)unnecessary-dict-comprehension-for-iterable(C420)datetime-min-max(DTZ901)fast-api-unused-path-parameter(FAST003)root-logger-call(LOG015)len-test(PLC1802)shallow-copy-environ(PLW1507)os-listdir(PTH208)invalid-pathlib-with-suffix(PTH210)invalid-assert-message-literal-argument(RUF040)unnecessary-nested-literal(RUF041)unnecessary-cast-to-int(RUF046)map-int-version-parsing(RUF048)if-key-in-dict-del(RUF051)unsafe-markup-use(S704). This rule has also been renamed fromRUF035.split-static-string(SIM905)runtime-cast-value(TC006)unquoted-type-alias(TC007)non-pep646-unpack(UP044)The following behaviors have been stabilized:
bad-staticmethod-argument(PLW0211)invalid-first-argument-name-for-class-method(N804):__new__methods are now no longer flagged byinvalid-first-argument-name-for-class-method(N804) but instead bybad-staticmethod-argument(PLW0211)bad-str-strip-call(PLE1310): The rule now applies to objects which are known to have typestrorbytes.custom-type-var-for-self(PYI019): More accurate detection of customTypeVarsreplaceable bySelf. The range of the diagnostic is now the full function header rather than just the return annotation.invalid-argument-name(N803): Ignore argument names of functions decorated withtyping.overrideinvalid-envvar-default(PLW1508): Detect default value arguments toos.environ.getwith invalid type.pytest-raises-with-multiple-statements(PT012)pytest-warns-with-multiple-statements(PT031): Allowforstatements with an empty body inpytest.raisesandpytest.warnswithstatements.redundant-open-modes(UP015): The diagnostic range is now the range of the redundant mode argument where it previously was the range of the entire open call. You may have to replace yournoqacomments when suppressingUP015.stdlib-module-shadowing(A005): Changes the default value oflint.flake8-builtins.strict-checkingfromtruetofalse.type-none-comparison(FURB169): Now also recognizestype(expr) is type(None)comparisons whereexprisn't a name expression.The following fixes or improvements to fixes have been stabilized:
repeated-equality-comparison(PLR1714) (#16685)needless-bool(SIM103) (#16684)unused-private-type-var(PYI018) (#16682)Server
ruff.printDebugInformation(#16617)Configuration
flake8-builtins] Deprecate thebuiltins-prefixed options in favor of the unprefixed options (e.g.builtins-allowed-modulesis now deprecated in favor ofallowed-modules) (#16092)Bug fixes
CLI
ruff] Fixlast_tag/commits_since_last_tagforversioncommand (#16686)Contributors
Install ruff 0.10.0
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.10.0
v0.9.10Compare Source
Release Notes
Preview features
ruff] Add new ruleRUF059: Unused unpacked assignment (#16449)syntax-errors] Detect assignment expressions before Python 3.8 (#16383)syntax-errors] Named expressions in decorators before Python 3.9 (#16386)syntax-errors] Parenthesized keyword argument names after Python 3.8 (#16482)syntax-errors] Positional-only parameters before Python 3.8 (#16481)syntax-errors] Tuple unpacking inreturnandyieldbefore Python 3.8 (#16485)syntax-errors] Type parameter defaults before Python 3.13 (#16447)syntax-errors] Type parameter lists before Python 3.12 (#16479)syntax-errors]except*before Python 3.11 (#16446)syntax-errors]typestatements before Python 3.12 (#16478)Bug fixes
flake8-simplify] Exempt unittest context methods forSIM115rule (#16439)pyupgrade] Do not offer fix when at least one target isglobal/nonlocal(UP028) (#16451)flake8-builtins] Ignore variables matching module attribute names (A001) (#16454)pylint] Convertcodekeyword argument to a positional argument in fix for (PLR1722) (#16424)CLI
descriptiontocheck_namein GitLab output serializer (#16437)Documentation
pydocstyle] Clarify thatD417only checks docstrings with an arguments section (#16494)Contributors
Install ruff 0.9.10
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.10
v0.9.9Compare Source
Release Notes
Preview features
Bug fixes
Contributors
Install ruff 0.9.9
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.9
v0.9.8Compare Source
Release Notes
Preview features
Rule changes
pylint] Mark fix unsafe (PLW1507) (#16343)pylint] Catchcase np.nan/case math.naninmatchstatements (PLW0177) (#16378)ruff] Add more Pydantic models variants to the list of default copy semantics (RUF012) (#16291)Server
configurationPreferenceiseditorOnly(#16381)ruff.configurationto allow inline config (#16296)Configuration
per-file-target-versionoption (#16257)Bug fixes
refurb] Do not consider docstring(s) (FURB156) (#16391)flake8-self] Ignore attribute accesses on instance-like variables (SLF001) (#16149)pylint] Fix false positives, add missing methods, and support positional-only parameters (PLE0302) (#16263)flake8-pyi] MarkPYI030fix unsafe when comments are deleted (#16322)Documentation
S611(#16316)Contributors
Install ruff 0.9.8
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.8
v0.9.7Compare Source
Release Notes
Preview features
__new__methods as special function type for enforcing class method or static method rules (#13305)airflow] Improve the internal logic to differentiate deprecated symbols (AIR303) (#16013)refurb] Manual timezone monkeypatching (FURB162) (#16113)ruff] Implicit class variable in dataclass (RUF045) (#14349)ruff] Skip singleton starred expressions forincorrectly-parenthesized-tuple-in-subscript(RUF031) (#16083)refurb] Check for subclasses includes subscript expressions (FURB189) (#16155)Rule changes
flake8-debugger] Also flagsys.breakpointhookandsys.__breakpointhook__(T100) (#16191)pycodestyle] Exemptsite.addsitedir(...)calls (E402) (#16251)Formatter
Server
source.organizeImports.ruffandsource.fixAll.ruffcode actions for a notebook cell (#16154)ruff.printDebugInformation(#16215)ruff.printDebugInformation(#16214)CLI
noqaeven when there are no diagnostics (#16178)extends (#15658)Bug fixes
flake8-comprehensions] Handle trailing comma inC403fix (#16110)flake8-pyi] Avoid flaggingcustom-typevar-for-selfon metaclass methods (PYI019) (#16141)pydocstyle] Handle arguments with the same names as sections (D417) (#16011)pylint] Correct ordering of arguments in fix forif-stmt-min-max(PLR1730) (#16080)pylint] Do not offer fix for raw strings (PLE251) (#16132)pyupgrade] Do not upgrade functionalTypedDictswith private field names to the class-based syntax (UP013) (#16219)pyupgrade] Handle micro version numbers correctly (UP036) (#16091)pyupgrade] Unwrap unary expressions correctly (UP018) (#15919)refurb] Correctly handle lengths of literal strings inslice-to-remove-prefix-or-suffix(FURB188) (#16237)ruff] SkipRUF001diagnostics when visiting string type definitions (#16122)Documentation
source.*code actions in Notebook (#16212)SECURITY.md(#16224)Contributors
Install ruff 0.9.7
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.7
v0.9.6Compare Source
Release Notes
Preview features
airflow] Addexternal_task.{ExternalTaskMarker, ExternalTaskSensor}forAIR302(#16014)flake8-builtins] Make strict module name comparison optional (A005) (#15951)flake8-pyi] Extend fix to Python <= 3.9 forredundant-none-literal(PYI061) (#16044)pylint] Also report when the object isn't a literal (PLE1310) (#15985)ruff] Implementindented-form-feed(RUF054) (#16049)ruff] Skip type definitions formissing-f-string-syntax(RUF027) (#16054)Rule changes
flake8-annotations] Correct syntax fortyping.Unionin suggested return type fixes forANN20xrules (#16025)flake8-builtins] Match upstream module name comparison (A005) (#16006)flake8-comprehensions] Detect overshadowedlist/set/dict, ignore variadics and named expressions (C417) (#15955)flake8-pie] Remove following comma correctly when the unpacked dictionary is empty (PIE800) (#16008)flake8-simplify] Only triggerSIM401on known dictionaries (#15995)pylint] Do not report calls when object type and argument type mismatch, remove custom escape handling logic (PLE1310) (#15984)pyupgrade] Comments within parenthesized value ranges should not affect applicability (UP040) (#16027)pyupgrade] Don't introduce invalid syntax when upgrading old-style type aliases with parenthesized multiline values (UP040) (#16026)pyupgrade] Ensure we do not rename two type parameters to the same name (UP049) (#16038)pyupgrade] [ruff] Don't apply renamings if the new name is shadowed in a scope of one of the references to the binding (UP049,RUF052) (#16032)ruff] UpdateRUF009to behave similar toB008and ignore attributes with immutable types (#16048)Server
Bug fixes
flake8-datetime] Ignore.replace()calls while looking for.astimezone(#16050)flake8-type-checking] AvoidTC004false positive where the runtime definition is provided by__getattr__(#16052)Documentation
ruff-lspmigration document (#16072)ruff.nativeServer(#16039)Contributors
Install ruff 0.9.6
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.6
v0.9.5Compare Source
Release Notes
Preview features
TYPE_CHECKINGforin_type_checking_block(#15719)flake8-comprehensions] Handle builtins at top of file correctly forunnecessary-dict-comprehension-for-iterable(C420) (#15837)flake8-logging].exception()andexc_info=outside exception handlers (LOG004,LOG014) (#15799)flake8-pyi] Fix incorrect behaviour ofcustom-typevar-return-typepreview-mode autofix iftypingwas already imported (PYI019) (#15853)flake8-pyi] Fix more complex cases (PYI019) (#15821)flake8-pyi] MakePYI019autofixable for.pyfiles in preview mode as well as stubs (#15889)flake8-pyi] Remove type parameter correctly when it is the last (PYI019) (#15854)pylint] Fix missing parens in unsafe fix forunnecessary-dunder-call(PLC2801) (#15762)pyupgrade] Better messages and diagnostic range (UP015) (#15872)pyupgrade] Rename private type parameters in PEP 695 generics (UP049) (#15862)refurb] Also report non-name expressions (FURB169) (#15905)refurb] Mark fix as unsafe if there are comments (FURB171) (#15832)ruff] Classes with mixed type variable style (RUF053) (#15841)airflow]BashOperatorhas been moved toairflow.providers.standard.operators.bash.BashOperator(AIR302) (#15922)flake8-pyi] Add autofix for unused-private-type-var (PYI018) (#15999)flake8-pyi] Significantly improve accuracy ofPYI019if preview mode is enabled (#15888)Rule changes
flake8-comprehensions] Skip whenTypeErrorpresent from too many (kw)args forC410,C411, andC418(#15838)flake8-pyi] RenamePYI019and improve its diagnostic message (#15885)pep8-naming] Ignore@overridemethods (N803) (#15954)pyupgrade] Reuse replacement logic fromUP046andUP047to preserve more comments (UP040) (#15840)ruff] Analyze deferred annotations before enforcingmutable-(data)class-defaultandfunction-call-in-dataclass-default-argument(RUF008,RUF009,RUF012) (#15921)pycodestyle] Exemptsys.path += ...calls (E402) (#15980)Configuration
flake8-import-conventionsalias conflicts withisort.required-importsbound name (#15918)allOf(#15992)Bug fixes
flake8-comprehensions] Unnecessarylistcomprehension (rewrite as asetcomprehension) (C403) - Handle extraneous parentheses around list comprehension (#15877)flake8-comprehensions] Handle trailing comma in fixes forunnecessary-generator-list/set(C400,C401) (#15929)flake8-pyi] Fix several correctness issues withcustom-type-var-return-type(PYI019) (#15851)pep8-naming] Consider any number of leading underscore forN801(#15988)pyflakes] Visit forward annotations inTypeAliasTypeas types (F401) (#15829)pylint] Correct min/max auto-fix and suggestion for (PL1730) (#15930)refurb] Handle unparenthesized tuples correctly (FURB122,FURB142) (#15953)refurb] AvoidNone | Noneas well as better detection and fix (FURB168) (#15779)Documentation
ruff-lsprelated settings (#15850)linter.md): clarify that Python files are always searched for in subdirectories (#15882)non_pep695_generic_class.rs(#15946)lint.extendIgnoreeditor setting (#15844)UP049inUP046andUP047, addSee alsosection toUP040(#15956)RUF012(#15982)ignoreandselectconfig (#15883)Contributors
Install ruff 0.9.5
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.5
v0.9.4Compare Source
Release Notes
Preview features
airflow] Extend airflow context parameter check forBaseOperator.execute(AIR302) (#15713)airflow] UpdateAIR302to check for deprecated context keys (#15144)flake8-bandit] Permit suspicious imports within stub files (S4) (#15822)pylint] Do not triggerPLR6201on empty collections (#15732)refurb] Do not emit diagnostic when loop variables are used outside loop body (FURB122) (#15757)ruff] Add support for morerepatterns (RUF055) (#15764)ruff] Check for shadowedmapbefore suggesting fix (RUF058) (#15790)ruff] Do not emit diagnostic when all arguments tozip()are variadic (RUF058) (#15744)ruff] Parenthesize fix when argument spans multiple lines forunnecessary-round(RUF057) (#15703)Rule changes
flake8-bugbear] ExemptNewTypecalls where the original type is immutable (B008) (#15765)pylint] Honor banned top-level imports byTID253inPLC0415. (#15628)pyupgrade] Ignoreis_typeddictandTypedDictfordeprecated-import(UP035) (#15800)CLI
flake8-quotesoption (#15788)ruff config(#15603)Bug fixes
flake8-comprehensions] Do not emitunnecessary-mapdiagnostic when lambda has different arity (C417) (#15802)flake8-comprehensions] Parenthesizesortedwhen needed forunnecessary-call-around-sorted(C413) (#15825)pyupgrade] Handle end-of-line comments forquoted-annotation(UP037) (#15824)Documentation
trio.run_processandanyio.run_process(#15761)uv init --libin tutorial (#15718)Contributors
Install ruff 0.9.4
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.4
v0.9.3Compare Source
Release Notes
Preview features
airflow] Argumentfail_stopin DAG has been renamed asfail_fast(AIR302) (#15633)airflow] ExtendAIR303with more symbols (#15611)flake8-bandit] Report all references to suspicious functions (S3) (#15541)flake8-pytest-style] Do not emit diagnostics for emptyforloops (PT012,PT031) (#15542)flake8-simplify] Avoid double negations (SIM103) (#15562)pyflakes] Fix infinite loop with unused local import in__init__.py(F401) (#15517)pylint] Do not report methods with only oneEM101-compatibleraise(PLR6301) (#15507)pylint] Implementredefined-slots-in-subclass(W0244) (#9640)pyupgrade] Add rules to use PEP 695 generics in classes and functions (UP046,UP047) (#15565, #15659)refurb] Implementfor-loop-writes(FURB122) (#10630)ruff] Implementneedless-elseclause (RUF047) (#15051)ruff] Implementstarmap-zip(RUF058) (#15483)Rule changes
flake8-bugbear] Do not raise error if keyword argument is present and target-python version is less or equals than 3.9 (B903) (#15549)flake8-comprehensions] strip parentheses around generators inunnecessary-generator-set(C401) (#15553)flake8-pytest-style] Rewrite references to.exception(PT027) (#15680)flake8-simplify] Mark fixes as unsafe (SIM201,SIM202) (#15626)flake8-type-checking] Fix some safe fixes being labeled unsafe (TC006,TC008) (#15638)isort] Omit trailing whitespace inunsorted-imports(I001) (#15518)pydoclint] Allow ignoring one line docstrings forDOCrules (#13302)pyflakes] Apply redefinition fixes by source code order (F811) (#15575)pyflakes] Avoid removing too many imports inredefined-while-unused(F811) (#15585)pyflakes] Group redefinition fixes by source statement (F811) (#15574)pylint] Include name of base class in message forredefined-slots-in-subclass(W0244) (#15559)ruff] Update fix forRUF055to usevar == value(#15605)Formatter
Performance
Server
unsafe-fixessettings for code actions (#15666)Bug fixes
flake8-bandit] Add missing single-line/dotall regex flag (S608) (#15654)flake8-import-conventions] Fix infinite loop betweenICN001andI002(ICN001) (#15480)flake8-simplify] Do not emit diagnostics for expressions inside string type annotations (SIM222,SIM223) (#15405)pyflakes] Treat arguments passed to thedefault=parameter ofTypeVaras type expressions (F821) (#15679)pyupgrade] Avoid syntax error when the iterable is a non-parenthesized tuple (UP028) (#15543)ruff] ExemptNewTypecalls where the original type is immutable (RUF009) (#15588)Documentation
TRY300: Add some extra notes on not catching exceptions you didn't expect (#15036)Contributors
Install ruff 0.9.3
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.3
v0.9.2Compare Source
Release Notes
Preview features
airflow] Fix typo "security_managr" to "security_manager" (AIR303) (#15463)airflow] extend and fix AIR302 rules (#15525)fastapi] Handle parameters withDependscorrectly (FAST003) (#15364)flake8-pytest-style] Implement pytest.warns diagnostics (PT029,PT030,PT031) (#15444)flake8-pytest-style] Test function parameters with default arguments (PT028) (#15449)flake8-type-checking] Avoid false positives for|inTC008(#15201)Rule changes
flake8-todos] Allow VSCode GitHub PR extension style links inmissing-todo-link(TD003) (#15519)pyflakes] Show syntax error message forF722(#15523)Formatter
Preserve(#15524)Server
ruff.configurationerrors (#15452)Configuration
flattento improve deserialization error messages (#15414)Bug fixes
fastapi] UpdateAnnotatedfixes (FAST002) (#15462)flake8-bandit] Check forbuiltinsinstead ofbuiltin(S102,PTH123) (#15443)flake8-pathlib] Fix--selectforos-path-dirname(PTH120) (#15446)ruff] Fix false positive on global keyword (RUF052) (#15235)Contributors
Install ruff 0.9.2
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.2
v0.9.1Compare Source
Release Notes
Preview features
pycodestyle] Runtoo-many-newlines-at-end-of-fileon each cell in notebooks (W391) (#15308)ruff] Omit diagnostic for shadowed private function parameters inused-dummy-variable(RUF052) (#15376)Rule changes
flake8-bugbear] Improveassert-raises-exceptionmessage (B017) (#15389)Formatter
Server
Bug fixes
flake8-pie] Correctly remove wrapping parentheses (PIE800) (#15394)pyupgrade] Handle comments and multiline expressions correctly (UP037) (#15337)Contributors
Install ruff 0.9.1
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.1
v0.9.0Compare Source
Release Notes
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
Ruff now formats your code according to the 2025 style guide. As a result, your code might now get formatted differently. See the formatter section for a detailed list of changes.
This release doesn’t remove or remap any existing stable rules.
Stabilization
The following rules have been stabilized and are no longer in preview:
stdlib-module-shadowing(A005).This rule has also been renamed: previously, it was called
builtin-module-shadowing.builtin-lambda-argument-shadowing(A006)slice-to-remove-prefix-or-suffix(FURB188)boolean-chained-comparison(PLR1716)decimal-from-float-literal(RUF032)post-init-default(RUF033)useless-if-else(RUF034)The following behaviors have been stabilized:
pytest-parametrize-names-wrong-type(PT006): Detectpytest.parametrizecalls outside decorators and calls with keyword arguments.module-import-not-at-top-of-file(E402): Ignorepytest.importorskipcalls between import statements.mutable-dataclass-default(RUF008) andfunction-call-in-dataclass-default-argument(RUF009): Add support forattrs.bad-version-info-comparison(PYI006): Extend the rule to check non-stub files.The following fixes or improvements to fixes have been stabilized:
redundant-numeric-union(PYI041)duplicate-union-members(PYI016)Formatter
This release introduces the new 2025 stable style (#13371), stabilizing the following changes:
ISC001incompatibility warning (#15123)assertmessage over breaking the assertion expression (#9457)ifguards inmatchcaseclauses (#13513)matchcasepatterns (#6933)ifkeyword for comprehensions where the condition has a leading comment (#12282)withstatements with a single context manager for Python 3.8 or older (#10276)max-doc-code-line-length = "dynamic"(#13523)Preview features
flake8-bugbear] Implementclass-as-data-structure(B903) (#9601)flake8-type-checking] Applyquoted-type-aliasmore eagerly inTYPE_CHECKINGblocks and ignore it in stubs (TC008) (#15180)pylint] Ignoreeq-without-hashin stub files (PLW1641) (#15310)pyupgrade] SplitUP007into two individual rules:UP007forUnionandUP045forOptional(UP007,UP045) (#15313)ruff] New rule that detects classes that are both an enum and adataclass(RUF049) (#15299)ruff] RecodeRUF025toRUF037(RUF037) (#15258)Rule changes
flake8-builtins] Ignorestdlib-module-shadowingin stub files(A005) (#15350)flake8-return] Add support for functions returningtyping.Never(RET503) (#15298)Server
logLevelserver settingwhich defaults to
info. This addresses the issue where users were notified about an error and told to consult the log, but it didn’t contain any messages. (#15232)CLI
--config key=valuewhen thekeyis for a table and it’s a simplevalueBug fixes
eradicate] Ignore metadata blocks directly followed by normal blocks (ERA001) (#15330)flake8-django] Recognize other magic methods (DJ012) (#15365)pycodestyle] Avoid false positives related to type aliases (E252) (#15356)pydocstyle] Avoid treating newline-separated sections as sub-sections (D405) (#15311)pyflakes] Remove call when removing final argument fromformat(F523) (#15309)refurb] Mark fix as unsafe when the right-hand side is a string (FURB171) (#15273)ruff] Treat)as a regex metacharacter (RUF043,RUF055) (#15318)ruff] Parenthesize theint-call argument when removing theintcall would change semantics (RUF046) (#15277)Contributors
Install ruff 0.9.0
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.9.0
v0.8.6Compare Source
Release Notes
Preview features
format]: Preserve multiline implicit concatenated strings in docstring positions (#15126)ruff] Add rule to detect empty literal in deque call (RUF025) (#15104)ruff] Avoid reporting whenndigitsis possibly negative (RUF057) (#15234)Rule changes
flake8-todos] remove issue code length restriction (TD003) (#15175)pyflakes] Ignore errors in@no_type_checkstring annotations (F722,F821) (#15215)CLI
--verbose(#15237)Bug fixes
ruff] Avoid syntax error when removing int over multiple lines (RUF046) (#15230)pyupgrade] Revert "Add all PEP-585 names toUP006rule" (#15250)Contributors
Install ruff 0.8.6
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.8.6
v0.8.5Compare Source
Release Notes
Preview features
airflow] Extend names moved from core to provider (AIR303) (#15145, #15159, #15196, #15216)airflow] Extend rule to check class attributes, methods, arguments (AIR302) (#15054, #15083)fastapi] UpdateFAST002to check keyword-only arguments (#15119)flake8-type-checking] DisableTC006andTC007in stub files (#15179)pylint] Detect nested methods correctly (PLW1641) (#15032)ruff] Detect more strict-integer expressions (RUF046) (#14833)ruff] Implementfalsy-dict-get-fallback(RUF056) (#15160)ruff] Implementunnecessary-round(RUF057) (#14828)Rule changes
TypedDictkeys as non-type-expressions (#15073)flake8-comprehensions] SkipC416if comprehension contains unpacking (#14909)flake8-pie] Allowcast(SomeType, ...)(PIE796) (#15141)flake8-simplify] More precise inference for dictionaries (SIM300) (#15164)flake8-use-pathlib] Catch redundant joins inPTH201and avoid syntax errors (#15177)pycodestyle] Preserve original value format (E731) (#15097)pydocstyle] Split on first whitespace character (D403) (#15082)pyupgrade] Add all PEP-585 names toUP006rule (#5454)Configuration
flake8-type-checking] Improve flexibility ofruntime-evaluated-decorators(#15204)pydocstyle] Add setting to ignore missing documentation for*argsand**kwargsparameters (D417) (#15210)ruff] Add an allowlist forunsafe-markup-use(RUF035) (#15076)Bug fixes
TypeCheckerfor detectingfastapiroutes (#15093)pycodestyle] Avoid false positives and negatives related to type parameter default syntax (E225,E251) (#15214)Documentation
shebang-not-executable(EXE001) and add git+windows solution to executable bit (#15208)Contributors
Install ruff 0.8.5
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.8.5
v0.8.4Compare Source
Release Notes
Preview features
airflow] ExtendAIR302with additional functions and classes (#15015)airflow] Implementmoved-to-provider-in-3for modules that has been moved to Airflow providers (AIR303) (#14764)flake8-use-pathlib] Extend check for invalid path suffix to include the case"."(PTH210) (#14902)perflint] Fix panic inPERF401when list variable is after theforloop (#14971)perflint] Simplify finding the loop target inPERF401(#15025)pylint] Preserve original value format (PLR6104) (#14978)ruff] Avoid false positives forRUF027for typing context bindings (#15037)ruff] Check for ambiguous pattern passed topytest.raises()(RUF043) (#14966)Rule changes
flake8-bandit] CheckS105for annotated assignment (#15059)flake8-pyi] More autofixes forredundant-none-literal(PYI061) (#14872)pydocstyle] Skip leading whitespace forD403(#14963)ruff] SkipSQLModelbase classes formutable-class-default(RUF012) (#14949)Bug
perflint] Parenthesize walrus expressions in autofix formanual-list-comprehension(PERF401) (#15050)Server
Contributors
Install ruff 0.8.4
Install prebuilt binaries via shell script
Install prebuilt binaries via powershell script
Download ruff 0.8.4
v0.8.3Compare Source
Preview features
airflow] Add fix to remove deprecated keyword arguments (AIR302) (#14887)airflow]: Extend rule to include deprecated names for Airflow 3.0 (AIR302) (#14765 and #14804)flake8-bugbear] Improve error messages forexcept*(B025,B029,B030,B904) (#14815)flake8-bugbear]itertools.batched()without explicitstrict(B911) (#14408)flake8-use-pathlib] Dotless suffix passed toPath.with_suffix()(PTH210) (#14779)pylint] Include parentheses and multiple comparators in check forboolean-chained-comparison(PLR1716) (#14781)ruff] Do not simplifyround()calls (RUF046) (#14832)ruff] Don't emitused-dummy-variableon function parameters (RUF052) (#14818)ruff] Implementif-key-in-dict-del(RUF051) (#14553)ruff] Mark autofix forRUF052as always unsafe (#14824)ruff] Teach autofix forused-dummy-variableabout TypeVars etc. (RUF052) (#14819)Rule changes
flake8-bugbear] Offer unsafe autofix forno-explicit-stacklevel(B028) (#14829)flake8-pyi] Skip all type definitions instring-or-bytes-too-long(PYI053) (#14797)pyupgrade] Do not report when a UTF-8 comment is followed by a non-UTF-8 one (UP009) (#14728)pyupgrade] Mark fixes forconvert-typed-dict-functional-to-classandconvert-named-tuple-functional-to-classas unsafe if they will remove comments (UP013,UP014) (#14842)Bug fixes
exceptandexcept*(#14895)flake8-bugbear] FixB028to allowstacklevelto be explicitly assigned as a positional argument (#14868)flake8-bugbear] SkipB028ifwarnings.warnis called with*argsor**kwargs(#14870)flake8-comprehensions] Skip iterables with named expressions inunnecessary-map(C417) (#14827)flake8-pyi] Also removeselfandcls's annotation (PYI034) (#14801)flake8-pytest-style] Fixpytest-parametrize-names-wrong-type(PT006) to edit bothargnamesandargvaluesif both of them are single-element tuples/lists (#14699)perflint] Improve autofix forPERF401(#14369)pylint] FixPLW1508false positive for default string created via a mult operation (#14841)v0.8.2Compare Source
Preview features
airflow] Avoid deprecated values (AIR302) (#14582)airflow] Extend removed names forAIR302(#14734)ruff] Extendunnecessary-regular-expressionto non-literal strings (RUF055) (#14679)ruff] Implementused-dummy-variable(RUF052) (#14611)ruff] Implementunnecessary-cast-to-int(RUF046) (#14697)Rule changes
airflow] CheckAIR001from builtin or providersoperatorsmodule (#14631)flake8-pytest-style] Remove@inpytest.mark.parametrizerule messages (#14770)pandas-vet] Skip rules if thepandamodule hasn't been seen (#14671)pylint] Fix false negatives forasciiandsortedinlen-as-condition(PLC1802) (#14692)refurb] Guardhashlibimports and markhashlib-digest-hexfix as safe (FURB181) (#14694)Configuration
flake8-import-conventions] Improve syntax check for aliases supplied in configuration forunconventional-import-alias(ICN001) (#14745)Bug fixes
@no_type_checkcontexts (F821,F722) (#14615) (#14726)pep8-naming] Avoid false positive forclass Bar(type(foo))(N804) (#14683)pycodestyle] Handle f-strings properly forinvalid-escape-sequence(W605) (#14748)pylint] Ignore@overloadinPLR0904(#14730)refurb] Handle non-finite decimals inverbose-decimal-constructor(FURB157) (#14596)ruff] Avoid emittingassignment-in-assertwhen all references to the assigned variable are themselves insideasserts (RUF018) (#14661)Documentation
flake8-use-pathlibrules (#14741)flake8-comprehensionsrules (#14729)flake8-type-checking] ExpandsTC006docs to better explain itself (#14749)v0.8.1Compare Source
Preview features
**) in overlong f-string expressions (#14489)airflow] Avoid implicitscheduleargument toDAGand@dag(AIR301) (#14581)flake8-builtins] Exempt private built-in modules (A005) (#14505)flake8-pytest-style] Fixpytest.mark.parametrizerules to check calls instead of decorators (#14515)flake8-type-checking] Implementruntime-cast-value(TC006) (#14511)flake8-type-checking] Implementunquoted-type-alias(TC007) andquoted-type-alias(TC008) (#12927)flake8-use-pathlib] RecommendPath.iterdir()overos.listdir()(PTH208) (#14509)pylint] Extendinvalid-envvar-defaultto detectos.environ.get(PLW1508) (#14512)pylint] Implementlen-test(PLC1802) (#14309)refurb] Fix bug where methods defined using lambdas were flagged byFURB118(#14639)ruff] Auto-addrprefix when string has no backslashes forunraw-re-pattern(RUF039) (#14536)ruff] Implementinvalid-assert-message-literal-argument(RUF040) (#14488)ruff] Implementunnecessary-nested-literal(RUF041) (#14323)ruff] Implementunnecessary-regular-expression(RUF055) (#14659)Rule changes
pep8-naming] Eliminate false positives for single-letter names (N811,N814) (#14584)pyflakes] Avoid false positives in@no_type_checkcontexts (F821,F722) (#14615)ruff] Detect redirected-noqa in file-level comments (RUF101) (#14635)ruff] Mark fixes forunsorted-dunder-allandunsorted-dunder-slotsas unsafe when there are complex comments in the sequence (RUF022,RUF023) (#14560)Bug fixes
None | Noneforredundant-none-literal(PYI061) andnever-union(RUF020) (#14583, #14589)flake8-bugbear] Fixmutable-contextvar-defaultto resolve annotated function calls properly (B039) (#14532)flake8-pyi,ruff] Fix traversal of nested literals and unions (PYI016,PYI051,PYI055,PYI062,RUF041) (#14641)flake8-pyi] Avoid rewriting invalid type expressions inunnecessary-type-union(PYI055) (#14660)flake8-type-checking] Avoid syntax errors and type checking problem for quoted annotations autofix (TC003,TC006) (#14634)pylint] Do not wrap function calls in parentheses in the fix for unnecessary-dunder-call (PLC2801) (#14601)ruff] Handleattrs'sauto_attribscorrectly (RUF009) (#14520)v0.8.0Compare Source
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
See also, the "Remapped rules" section which may result in disabled rules.
Default to Python 3.9
Ruff now defaults to Python 3.9 instead of 3.8 if no explicit Python version is configured using
ruff.target-versionorproject.requires-python(#13896)Changed location of
pydoclintdiagnosticspydoclintdiagnostics now point to the first-line of the problematic docstring. Previously, this was not the case.If you've opted into these preview rules but have them suppressed using
noqacomments insome places, this change may mean that you need to move the
noqasuppressioncomments. Most users should be unaffected by this change.
Use XDG (i.e.
~/.local/bin) instead of the Cargo home directory in the standalone installerPreviously, Ruff's installer used
$CARGO_HOMEor~/.cargo/binfor its target install directory. Now, Ruff will be installed into$XDG_BIN_HOME,$XDG_DATA_HOME/../bin, or~/.local/bin(in that order).This change is only relevant to users of the standalone Ruff installer (using the shell or PowerShell script). If you installed Ruff using uv or pip, you should be unaffected.
Changes to the line width calculation
Ruff now uses a new version of the unicode-width Rust crate to calculate the line width. In very rare cases, this may lead to lines containing Unicode characters being reformatted, or being considered too long when they were not before (
E501).Removed Rules
The following deprecated rules have been removed:
missing-type-self(ANN101)missing-type-cls(ANN102)syntax-error(E999)pytest-missing-fixture-name-underscore(PT004)pytest-incorrect-fixture-name-underscore(PT005)unpacked-list-comprehension(UP027)Remapped rules
The following rules have been remapped to new rule codes:
flake8-type-checking:TCHtoTCStabilization
The following rules have been stabilized and are no longer in preview:
builtin-import-shadowing(A004)mutable-contextvar-default(B039)fast-api-redundant-response-model(FAST001)fast-api-non-annotated-dependency(FAST002)dict-index-missing-items(PLC0206)pep484-style-positional-only-parameter(PYI063)redundant-final-literal(PYI064)bad-version-info-order(PYI066)parenthesize-chained-operators(RUF021)unsorted-dunder-all(RUF022)unsorted-dunder-slots(RUF023)assert-with-print-message(RUF030)unnecessary-default-type-args(UP043)The following behaviors have been stabilized:
ambiguous-variable-name(E741): Violations in stub files are now ignored. Stub authors typically don't control variable names.printf-string-formatting(UP031): Report allprintf-like usages even if no autofix is availableThe following fixes have been stabilized:
zip-instead-of-pairwise(RUF007)Preview features
flake8-datetimez] Exemptmin.time()andmax.time()(DTZ901) (#14394)flake8-pie] Mark fix as unsafe if the following statement is a string literal (PIE790) (#14393)flake8-pyi] New ruleredundant-none-literal(PYI061) (#14316)flake8-pyi] Add autofix forredundant-numeric-union(PYI041) (#14273)ruff] New rulemap-int-version-parsing(RUF048) (#14373)ruff] New ruleredundant-bool-literal(RUF038) (#14319)ruff] New ruleunraw-re-pattern(RUF039) (#14446)pycodestyle] Exemptpytest.importorskip()calls (E402) (#14474)pylint] Autofix suggests using sets when possible (PLR1714) (#14372)Rule changes
invalid-pyproject-toml(RUF200): Updated to reflect the provisionally accepted PEP 639.flake8-pyi] Avoid panic in unfixable case (PYI041) (#14402)flake8-type-checking] Correctly handle quotes in subscript expression when generating an autofix (#14371)pylint] Suggest correct autofix for__contains__(PLC2801) (#14424)Configuration
ignores a rule that has been removed (#14435)lint.flake8-import-conventions.aliasesonly uses valid module names and aliases (#14477)v0.7.4Compare Source
Preview features
flake8-datetimez] Detect usages ofdatetime.max/datetime.min(DTZ901) (#14288)flake8-logging] Implementroot-logger-calls(LOG015) (#14302)flake8-no-pep420] Detect empty implicit namespace packages (INP001) (#14236)flake8-pyi] Add "replace withSelf" fix (PYI019) (#14238)perflint] Implement quick-fix formanual-list-comprehension(PERF401) (#13919)pylint] Implementshallow-copy-environ(W1507) (#14241)ruff] Implementnone-not-at-end-of-union(RUF036) (#14314)ruff] Implementationunsafe-markup-callfromflake8-markupsafeplugin (RUF035) (#14224)ruff] Report problems forattrsdataclasses (RUF008,RUF009) (#14327)Rule changes
flake8-boolean-trap] Exclude dunder methods that define operators (FBT001) (#14203)flake8-pyi] Add "replace withSelf" fix (PYI034) (#14217)flake8-pyi] Always autofixduplicate-union-members(PYI016) (#14270)flake8-pyi] Improve autofix for nested and mixed type unions forunnecessary-type-union(PYI055) (#14272)flake8-pyi] Mark fix as unsafe when type annotation contains comments forduplicate-literal-member(PYI062) (#14268)Server
ruff.configuration(#14352)Bug fixes
PLC014(useless-import-alias) andI002(missing-required-import) by consideringlint.isort.required-importsforPLC014(#14287)flake8-type-checking] Skip quoting annotation if it becomes invalid syntax (TCH001)flake8-pyi] Avoid usingtyping.Selfin stub files pre-Python 3.11 (PYI034) (#14230)flake8-pytest-style] Flagpytest.raisescall with keyword argumentexpected_exception(PT011) (#14298)flake8-simplify] Infer "unknown" truthiness for literal iterables whose items are all unpacks (SIM222) (#14263)flake8-type-checking] Fix false positives fortyping.Annotated(TCH001) (#14311)pylint] Allowawaitat the top-level scope of a notebook (PLE1142) (#14225)pylint] Fix miscellaneous issues inawait-outside-asyncdetection (PLE1142) (#14218)pyupgrade] Avoid applying PEP 646 rewrites in invalid contexts (UP044) (#14234)pyupgrade] Detect permutations in redundant open modes (UP015) (#14255)refurb] Avoid triggeringhardcoded-string-charsetfor reordered sets (FURB156) (#14233)refurb] Further special cases added toverbose-decimal-constructor(FURB157) (#14216)refurb] UseUserStringinstead of non-existentUserStr(FURB189) (#14209)ruff] Avoid treating lowercase letters as# noqacodes (RUF100) (#14229)ruff] Do not report whenOptionalhas no type arguments (RUF013) (#14181)Documentation
F704,PLE1142(#14266)v0.7.3Compare Source
Preview features
flake8-pyi] Include all Python file types forPYI006andPYI066(#14059)flake8-simplify] Implementsplit-of-static-string(SIM905) (#14008)refurb] Implementsubclass-builtin(FURB189) (#14105)ruff] Improve diagnostic messages and docs (RUF031,RUF032,RUF034) (#14068)Rule changes
B033,PLC0208) (#14064)eradicate] Better detection of IntelliJ language injection comments (ERA001) (#14094)flake8-pyi] Add autofix fordocstring-in-stub(PYI021) (#14150)flake8-pyi] Updateduplicate-literal-member(PYI062) to always provide an autofix (#14188)pyflakes] Detect items that hash to same value in duplicate dictionaries (F601) (#14065)ruff] Fix false positive for decorators (RUF028) (#14061)Bug fixes
# noqa(#12809)eradicate] ignore# language=in commented-out-code rule (ERA001) (#14069)flake8-bugbear] - do not runmutable-argument-defaulton stubs (B006) (#14058)flake8-builtins] Skip lambda expressions inbuiltin-argument-shadowing (A002)(#14144)flake8-comprehension] Also remove trailing comma while fixingC409andC419(#14097)flake8-simplify] Allowopenwithout context manager inreturnstatement (SIM115) (#14066)pylint] Respect hash-equivalent literals initeration-over-set(PLC0208) (#14063)pylint] Update known dunder methods for Python 3.13 (PLW3201) (#14146)pyupgrade] - ignore kwarg unpacking forUP044(#14053)refurb] Parse more exotic decimal strings inverbose-decimal-constructor(FURB157) (#14098)Documentation
v0.7.2Compare Source
Preview features
pyupgrade] Add PEP 646Unpackconversion to*with fix (UP044) (#13988)Rule changes
known_stdlibs.rswith stdlibs 2024.10.25 (#13963)flake8-no-pep420] Skip namespace package enforcement for PEP 723 scripts (INP001) (#13974)Server
Bug fixes
flake8-type-checking] Fix false positive forsingledispatchmethod(TCH003) (#13941)flake8-type-checking] Treat return type ofsingledispatchas runtime-required (TCH003) (#13957)Documentation
flake8-simplify] Include caveats of enablingif-else-block-instead-of-if-exp(SIM108) (#14019)v0.7.1Compare Source
Preview features
E221andE222to flag missing or extra whitespace around==operator (#13890)pylint] Restrictiteration-over-setto only work on sets of literals (PLC0208) (#13731)Rule changes
flake8-type-checking] Support auto-quoting when annotations contain quotes (#11811)Server
Bug fixes
ARG002compatible withEM101when raisingNotImplementedError(#13714)Other changes
v0.7.0Compare Source
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
PT001andPT023now default to omitting the decorator parentheses when there are no arguments(#12838, #13292).
This was a change that we attempted to make in Ruff v0.6.0, but only partially made due to an error on our part.
See the blog post for more details.
useless-try-exceptrule (in ourtryceratopscategory) has been recoded fromTRY302toTRY203(#13502). This ensures Ruff's code is consistent withthe same rule in the
tryceratopslinter.lint.allow-unused-importssetting has been removed (#13677). Uselint.pyflakes.allow-unused-importsinstead.
Formatter preview style
Preview linter features
refurb] implementhardcoded-string-charset(FURB156) (#13530)refurb] Count codepoints not bytes forslice-to-remove-prefix-or-suffix (FURB188)(#13631)Rule changes
pylint] MarkPLE1141fix as unsafe (#13629)flake8-async] Consider async generators to be "checkpoints" forcancel-scope-no-checkpoint(ASYNC100) (#13639)flake8-bugbear] Do not suggest setting parameterstrict=toFalseinB905diagnostic message (#13656)flake8-todos] Only flag the word "TODO", not words starting with "todo" (TD006) (#13640)pycodestyle] Fix whitespace-related false positives and false negatives inside type-parameter lists (E231,E251) (#13704)flake8-simplify] Stabilize preview behavior forSIM115so that the rule can detect filesbeing opened from a wider range of standard-library functions (#12959).
CLI
--statisticscommand (#13774)Bug fixes
pyflakes] Allowipytestcell magic (F401) (#13745)flake8-use-pathlib] FixPTH123false positive whenopenis passed a file descriptor (#13616)flake8-bandit] Detect patterns from multi line SQL statements (S608) (#13574)flake8-pyi] - Fix dropped expressions inPYI030autofix (#13727)v0.6.9Compare Source
Preview features
refurb] MarkFURB118fix as unsafe (#13613)Rule changes
pydocstyle] Don't raiseD208when last line is non-empty (#13372)pylint] Preserve trivia (i.e. comments) inPLR5501autofix (#13573)Configuration
pyflakes] Addallow-unused-importssetting forunused-importrule (F401) (#13601)Bug fixes
flake8-bugbear] Avoid short circuitingB017for multiple context managers (#13609)pylint] Do not offer an invalid fix forPLR1716when the comparisons contain parenthesis (#13527)pyupgrade] FixUP043to apply tocollections.abc.Generatorandcollections.abc.AsyncGenerator(#13611)refurb] Fix handling of slices in tuples forFURB118, e.g.,x[:, 1](#13518)Documentation
astral-sh/ruff-action(#13551)v0.6.8Compare Source
Preview features
match caseclauses (#13510)ifguards inmatch..caseclauses (#13513)ruff analyze graph(#13486)pylint] Implementboolean-chained-comparison(R1716) (#13435)Rule changes
lake8-simplify] DetectSIM910when using variadic keyword arguments, i.e.,**kwargs(#13503)pyupgrade] Avoid false negatives with non-reference shadowed bindings of loop variables (UP028) (#13504)Bug fixes
*args(#13512)Performance
BTreeSetsin module resolver (#13440)v0.6.7Compare Source
Preview features
excludesupport toruff analyze(#13425)Rule changes
pycodestyle] Fix: Don't autofix if the first line ends in a question mark? (D400) (#13399)Bug fixes
lint.excludein ruff check--add-noqa(#13427)Performance
forgetfor module resolver database (#13438)v0.6.6Compare Source
Preview features
refurb] Skipslice-to-remove-prefix-or-suffix(FURB188) when non-trivial slice steps are present (#13405)Formatter
Server
LineIndex::offsetcalculation (#13407)Bug fixes
fastapi] Respect FastAPI aliases in route definitions (#13394)pydocstyle] Respect word boundaries when detecting function signature in docs (#13388)Documentation
FURB188docs (#13406)v0.6.5Compare Source
Preview features
pydoclint] IgnoreDOC201when function name is "new" (#13300)refurb] Implementslice-to-remove-prefix-or-suffix(FURB188) (#13256)Rule changes
eradicate] Ignore script-comments with multiple end-tags (ERA001) (#13283)pyflakes] Improve error message forUndefinedNamewhen a builtin was added in a newer version than specified in Ruff config (F821) (#13293)Server
Bug fixes
ruff] Handle unary operators indecimal-from-float-literal(RUF032) (#13275)CLI
Playground
v0.6.4Compare Source
Preview features
flake8-builtins] Use dynamic builtins list based on Python version (#13172)pydoclint] Permit yieldingNoneinDOC402andDOC403(#13148)pylint] Update diagnostic message forPLW3201(#13194)ruff] Implementpost-init-default(RUF033) (#13192)ruff] Implement useless if-else (RUF034) (#13218)Rule changes
flake8-pyi] Respectpep8_naming.classmethod-decoratorssettings when determining if a method is a classmethod incustom-type-var-return-type(PYI019) (#13162)flake8-pyi] Teach various rules that annotations might be stringized (#12951)pylint] Avoidno-self-useforattrs-style validators (#13166)pylint] Recurse into subscript subexpressions when searching for list/dict lookups (PLR1733,PLR1736) (#13186)pyupgrade] Detectaiofiles.opencalls inUP015(#13173)pyupgrade] Marksys.version_info[0] < 3and similar comparisons as outdated (UP036) (#13175)CLI
ruff formatoutput (#13212)Bug fixes
pydocstyle] Improve heuristics for detecting Google-style docstrings (#13142)refurb] Treatseparguments with effects as unsafe removals (FURB105) (#13165)v0.6.3Compare Source
Preview features
flake8-simplify] Extendopen-file-with-context-handlerto work withdbm.sqlite3(SIM115) (#13104)pycodestyle] DisableE741in stub files (.pyi) (#13119)pydoclint] AvoidDOC201on explicit returns in functions that only returnNone(#13064)Rule changes
flake8-async] Disable check forasynciobefore Python 3.11 (ASYNC109) (#13023)Bug fixes
FastAPI] Avoid introducing invalid syntax in fix forfast-api-non-annotated-dependency(FAST002) (#13133)flake8-implicit-str-concat] Normalize octals before merging concatenated strings insingle-line-implicit-string-concatenation(ISC001) (#13118)flake8-pytest-style] Improve help message forpytest-incorrect-mark-parentheses-style(PT023) (#13092)pylint] Avoid autofix for calls that aren'tminormaxas starred expression (PLW3301) (#13089)ruff] Adddatetime.time,datetime.tzinfo, anddatetime.timezoneas immutable function calls (RUF009) (#13109)ruff] Extend comment deletion forRUF100to include trailing text fromnoqadirectives while preserving any following comments on the same line, if any (#13105)v0.6.2Compare Source
Preview features
flake8-simplify] Extendopen-file-with-context-handlerto work with other standard-library IO modules (SIM115) (#12959)ruff] Avoidunused-asyncfor functions with FastAPI route decorator (RUF029) (#12938)ruff] Ignorefstring-missing-syntax(RUF027) forfastAPIpaths (#12939)ruff] Implement check for Decimal called with a float literal (RUF032) (#12909)Rule changes
flake8-bugbear] Update diagnostic message when expression is at the end of function (B015) (#12944)flake8-pyi] Skip type annotations instring-or-bytes-too-long(PYI053) (#13002)flake8-type-checking] Always recognise relative imports as first-party (#12994)flake8-unused-arguments] Ignore unused arguments on stub functions (ARG001) (#12966)pylint] Ignore augmented assignment forself-cls-assignment(PLW0642) (#12957)Server
Bug fixes
pep8-naming] Don't flagfromimports following conventional import names (N817) (#12946)pylint] - Allow__new__methods to haveclsas their first argument even if decorated with@staticmethodforbad-staticmethod-argument(PLW0211) (#12958)Documentation
hyperfineinstallation instructions; updatehyperfinecode samples (#13034)PT001as per the new default behavior (#13019)perflint] Improve docs fortry-except-in-loop(PERF203) (#12947)pydocstyle] Add reference tolint.pydocstyle.ignore-decoratorssetting to rule docs (#12996)v0.6.1Compare Source
This is a hotfix release to address an issue with
ruff-pre-commit. In v0.6,Ruff changed its behavior to lint and format Jupyter notebooks by default;
however, due to an oversight, these files were still excluded by default if
Ruff was run via pre-commit, leading to inconsistent behavior.
This has now been fixed.
Preview features
fastapi] Implementfast-api-unused-path-parameter(FAST003) (#12638)Rule changes
pylint] Renametoo-many-positionaltotoo-many-positional-arguments(R0917) (#12905)Server
Other changes
flake8-naming]: Respect import conventions (N817) (#12922)v0.6.0Compare Source
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
See also, the "Remapped rules" section which may result in disabled rules.
srclayouts by default forisortrules (#12848)PT001andPT023now default to omitting the decorator parentheses when there are no arguments (#12838).Deprecations
The following rules are now deprecated:
pytest-missing-fixture-name-underscore(PT004)pytest-incorrect-fixture-name-underscore(PT005)unpacked-list-comprehension(UP027)Remapped rules
The following rules have been remapped to new rule codes:
unnecessary-dict-comprehension-for-iterable:RUF025toC420Stabilization
The following rules have been stabilized and are no longer in preview:
singledispatch-method(PLE1519)singledispatchmethod-function(PLE1520)bad-staticmethod-argument(PLW0211)if-stmt-min-max(PLR1730)invalid-bytes-return-type(PLE0308)invalid-hash-return-type(PLE0309)invalid-index-return-type(PLE0305)invalid-length-return-type(PLEE303)self-or-cls-assignment(PLW0642)byte-string-usage(PYI057)duplicate-literal-member(PYI062)redirected-noqa(RUF101)The following behaviors have been stabilized:
cancel-scope-no-checkpoint(ASYNC100): Supportasyncioandanyiocontext managers.async-function-with-timeout(ASYNC109): Supportasyncioandanyiocontext managers.async-busy-wait(ASYNC110): Supportasyncioandanyiocontext managers.async-zero-sleep(ASYNC115): Supportanyiocontext managers.long-sleep-not-forever(ASYNC116): Supportanyiocontext managers.The following fixes have been stabilized:
superfluous-else-return(RET505)superfluous-else-raise(RET506)superfluous-else-continue(RET507)superfluous-else-break(RET508)Preview features
flake8-simplify] Further simplify to binary in preview for (SIM108) (#12796)pyupgrade] Show violations without auto-fix (UP031) (#11229)Rule changes
flake8-import-conventions] Addxml.etree.ElementTreeto default conventions (#12455)flake8-pytest-style] Add a space after comma in CSV output (PT006) (#12853)Server
Bug fixes
flake8-async] Do not lint yield in context manager (ASYNC100) (#12896)flake8-comprehensions] Do not lintasync forcomprehensions (C419) (#12895)flake8-return] Only add returnNoneat end of a function (RET503) (#11074)flake8-type-checking] Avoid treatingdataclasses.KW_ONLYas typing-only (TCH003) (#12863)pep8-naming] Treattype(Protocol)et al as metaclass base (N805) (#12770)pydoclint] Don't enforce returns and yields in abstract methods (DOC201,DOC202) (#12771)ruff] Skip tuples with slice expressions in (RUF031) (#12768)ruff] Ignore unparenthesized tuples in subscripts when the subscript is a type annotation or type alias (RUF031) (#12762)ruff] Ignore template strings passed to logging andbuiltins._()calls (RUF027) (#12889)ruff] Do not remove parens for tuples with starred expressions in Python <=3.10 (RUF031) (#12784)Other changes
kernelspecnotebook metadata when detecting the preferred language for a Jupyter Notebook (#12875)v0.5.7Compare Source
Preview features
flake8-comprehensions] Account for list and set comprehensions inunnecessary-literal-within-tuple-call(C409) (#12657)flake8-pyi] Add autofix forfuture-annotations-in-stub(PYI044) (#12676)flake8-return] Avoid syntax error when auto-fixingRET505with mixed indentation (space and tabs) (#12740)pydoclint] Adddocstring-missing-yields(DOC402) anddocstring-extraneous-yields(DOC403) (#12538)pydoclint] AvoidDOC201if docstring begins with "Return", "Returns", "Yield", or "Yields" (#12675)pydoclint] Deduplicate collected exceptions after traversing function bodies (DOC501) (#12642)pydoclint] IgnoreDOCerrors for stub functions (#12651)pydoclint] Teach rules to understand reraised exceptions as being explicitly raised (DOC501,DOC502) (#12639)ruff] Implementincorrectly-parenthesized-tuple-in-subscript(RUF031) (#12480)ruff] MarkRUF023fix as unsafe if__slots__is not a set and the binding is used elsewhere (#12692)Rule changes
refurb] Add autofix forimplicit-cwd(FURB177) (#12708)ruff] Add autofix forzip-instead-of-pairwise(RUF007) (#12663)tryceratops] AddBaseExceptiontoraise-vanilla-classrule (TRY002) (#12620)Server
CLI
pyproject.tomlfiles (#12727)Bug fixes
flake8-async] Fix false positives with multipleasync withitems (ASYNC100) (#12643)flake8-bandit] Avoid false-positives for list concatenations in SQL construction (S608) (#12720)flake8-bugbear] Treatreturnas equivalent tobreak(B909) (#12646)flake8-comprehensions] Set comprehensions not a violation forsuminunnecessary-comprehension-in-call(C419) (#12691)flake8-simplify] Parenthesize conditions based on precedence when merging if arms (SIM114) (#12737)pydoclint] Try both 'Raises' section styles when convention is unspecified (DOC501) (#12649)v0.5.6Compare Source
Ruff 0.5.6 automatically enables linting and formatting of notebooks in preview mode.
You can opt-out of this behavior by adding
*.ipynbto theextend-excludesetting.Preview features
flake8-builtins] Implement import, lambda, and module shadowing (#12546)pydoclint] Adddocstring-missing-returns(DOC201) anddocstring-extraneous-returns(DOC202) (#12485)Rule changes
flake8-return] Exempt cached properties and other property-like decorators from explicit return rule (RET501) (#12563)Server
$/logTracefor server trace logs in Zed and VS Code (#12564)Configuration
flake8-implicit-str-concat] Always allow explicit multi-line concatenations when implicit concatenations are banned (#12532)Bug fixes
flake8-async] Avoid flaggingasyncio.timeouts as unused when the context manager includesasyncio.TaskGroup(#12605)flake8-slots] Avoid recommending__slots__for classes that inherit from more thannamedtuple(#12531)isort] Avoid marking required imports as unused (#12537)isort] Preserve trailing inline comments on import-from statements (#12498)pycodestyle] Add newlines before comments (E305) (#12606)pycodestyle] Don't attach comments with mismatched indents (#12604)pyflakes] Fix preview-mode bugs inF401when attempting to autofix unused first-party submodule imports in an__init__.pyfile (#12569)pylint] Respect start index inunnecessary-list-index-lookup(#12603)pyupgrade] Avoid recommending no-argument super inslots=Truedataclasses (#12530)pyupgrade] Use colon rather than dot formatting for integer-only types (#12534)Other changes
v0.5.5Compare Source
Preview features
fastapi] Implementfastapi-redundant-response-model(FAST001) andfastapi-non-annotated-dependency(FAST002) (#11579)pydoclint] Implementdocstring-missing-exception(DOC501) anddocstring-extraneous-exception(DOC502) (#11471)Rule changes
numpy] Fix NumPy 2.0 rule fornp.alltrueandnp.sometrue(#12473)numpy] IgnoreNPY201insideexceptblocks for compatibility with older numpy versions (#12490)pep8-naming] Avoid applyingignore-namestoselfandclsfunction names (N804,N805) (#12497)Formatter
Server
Bug fixes
Ordimplementation ofcmp_fix(#12471)pydoclint] Fix panic inDOC501reported in #12428 (#12435)flake8-bugbear] Allow singleton tuples with starred expressions inB013(#12484)Documentation
nvim-lspconfig(#12507)v0.5.4Compare Source
Rule changes
ruff] RenameRUF007tozip-instead-of-pairwise(#12399)Bug fixes
flake8-builtins] Avoid shadowing diagnostics for@overridemethods (#12415)flake8-comprehensions] Insert parentheses for multi-argument generators (#12422)pydocstyle] Handle escaped docstrings within docstring (D301) (#12192)Documentation
output-formatdefault in settings reference (#12409)v0.5.3Compare Source
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.
Preview features
pyupgrade] Implementunnecessary-default-type-args(UP043) (#12371)Rule changes
flake8-bugbear] Detect enumerate iterations inloop-iterator-mutation(B909) (#12366)flake8-bugbear] Removediscard,remove, andpopallowance forloop-iterator-mutation(B909) (#12365)pylint] Allowrepeated-equality-comparisonfor mixed operations (PLR1714) (#12369)pylint] Ignoreselfandclswhen counting arguments (PLR0913) (#12367)pylint] Use UTF-8 as default encoding inunspecified-encodingfix (PLW1514) (#12370)Server
--previewflag forserversubcommand for the linter and formatter (#12208)Bug fixes
flake8-comprehensions] Allow additional arguments forsumandmaxcomprehensions (C419) (#12364)pylint] Avoid dropping extra boolean operations inrepeated-equality-comparison(PLR1714) (#12368)pylint] Consider expression before statement when determining binding kind (PLR1704) (#12346)Documentation
Other changes
v0.5.2Compare Source
Preview features
spaceseparator before parenthesized expressions in comprehensions with leading comments (#12282)flake8-async] UpdateASYNC100to includeanyioandasyncio(#12221)flake8-async] UpdateASYNC109to includeanyioandasyncio(#12236)flake8-async] UpdateASYNC110to includeanyioandasyncio(#12261)flake8-async] UpdateASYNC115to includeanyioandasyncio(#12262)flake8-async] UpdateASYNC116to includeanyioandasyncio(#12266)Rule changes
flake8-return] Exempt properties from explicit return rule (RET501) (#12243)numpy] Addnp.NAN-to-np.nandiagnostic (#12292)refurb] Makelist-reverse-copyan unsafe fix (#12303)Server
includeandextend-includesettings in native server (#12252)CLI
D203(#12238)Bug fixes
notoperations as boolean tests (#12301)flake8-bandit] AvoidS310violations 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 withouttimeoutargument (#12213)pycodestyle] Remove "non-obvious" allowance for E721 (#12300)pyflakes] Considerwithblocks as single-item branches for redefinition analysis (#12311)refurb] Restrict forwarding fornewlineargument inopen()calls to Python versions >= 3.10 (#12244)Documentation
--output-format fulldefault (#12248)Performance
v0.5.1Compare Source
Preview features
flake8-bugbear] Implement mutable-contextvar-default (B039) (#12113)pycodestyle] Whitespace after decorator (E204) (#12140)pytest] ReversePT001andPT0023defaults (#12106)Rule changes
flake8-bandit] DetecthttpxforS113(#12174)numpy] UpdateNPY201to include exception deprecations (#12065)pylint] Generate autofix forduplicate-bases(PLE0241) (#12105)Server
Bug fixes
requires-pythoninference robust to==(#12091)str-width (#12135)pycodestyle] AvoidE275if keyword followed by comma (#12136)pycodestyle] AvoidE275if keyword is followed by a semicolon (#12095)pylint] Skip dummy variables forPLR1704(#12190)Performance
parse_identifier(#12103)CompactStringforIdentifierAST node (#12101)v0.5.0Compare Source
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
See also, the "Remapped rules" section which may result in disabled rules.
ALLnow excludes deprecated rules--strip-components=1when untarring./latestURLs on GitHub.flake8-banditrules were modified (#10667).Deprecations
The following rules are now deprecated:
syntax-error(E999): Syntax errors are now always shownRemapped rules
The following rules have been remapped to new rule codes:
blocking-http-call-in-async-function:ASYNC100toASYNC210open-sleep-or-subprocess-in-async-function:ASYNC101split intoASYNC220,ASYNC221,ASYNC230, andASYNC251blocking-os-call-in-async-function:ASYNC102has been merged intoASYNC220andASYNC221trio-timeout-without-await:TRIO100toASYNC100trio-sync-call:TRIO105toASYNC105trio-async-function-with-timeout:TRIO109toASYNC109trio-unneeded-sleep:TRIO110toASYNC110trio-zero-sleep-call:TRIO115toASYNC115repeated-isinstance-calls:PLR1701toSIM101Stabilization
The 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 detectsifexpressions with implicitelsebranchesmodule-import-not-at-top-of-file(E402) now allowsos.environmodifications between import statementstype-comparison(E721) now allows idioms such astype(x) is intyoda-condition(SIM300) now flags a wider range of expressionsRemovals
The following deprecated settings have been removed:
output-format=text; useoutput-format=conciseoroutput-format=fulltab-size; useindent-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>; useruff check <path>ruff --clean; useruff cleanruff --generate-shell-completion; useruff generate-shell-completionPreview features
ruff] Addassert-with-print-messagerule (#11981)CLI
--statistics(#11697)fullby default (#12010)Rule changes
ruff] Fix false positives ifgettextis imported using an alias (RUF027) (#12025)numpy] Updatetrapzandin1ddeprecation (NPY201) (#11948)flake8-bandit] Modify diagnostic ranges for shell-related rules (#10667)Server
logFile(#11945)Bug fixes
pycodestyle] AvoidE203for 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)Parser
Other changes
v0.4.10Compare Source
Parser
Rule changes
flake8-copyright] UpdateCPY001to check the first 4096 bytes instead of 1024 (#11927)pycodestyle] UpdateE999to show all syntax errors instead of just the first one (#11900)Server
Security
v0.4.9Compare Source
Preview features
pylint] Implementconsider-dict-items(C0206) (#11688)refurb] Implementrepeated-global(FURB154) (#11187)Rule changes
pycodestyle] Adapt fix forE203to work identical toruff format(#10999)Formatter
Server
ruff server(#11800)ruff.printDebugInformationcommand (#11831)CLI
Bug fixes
refurb] Avoid suggesting starmap when arguments are used outside call (FURB140) (#11830)flake8-bugbear] Avoid panic inB909when checking large loop blocks (#11772)refurb] Fix misbehavior ofoperator.itemgetterwhen getter param is a tuple (FURB118) (#11774)v0.4.8Compare Source
Performance
Preview features
flake8-bugbear] Implementreturn-in-generator(B901) (#11644)flake8-pyi] Implementpep484-style-positional-only-parameter(PYI063) (#11699)pygrep_hooks] Check blanket ignores via file-level pragmas (PGH004) (#11540)Rule changes
pyupgrade] UpdateUP035for Python 3.13 and the latest version oftyping_extensions(#11693)numpy] UpdateNPY001rule for NumPy 2.0 (#11735)Server
CLI
--output-formatflag (#11682)Bug fixes
pyupgrade] Write empty string in lieu of panic when fixingUP032(#11696)flake8-simplify] Simplify double negatives inSIM103(#11684)typestatements (#11720)v0.4.7Compare Source
Preview features
flake8-pyi] ImplementPYI064(#11325)flake8-pyi] ImplementPYI066(#11541)flake8-pyi] ImplementPYI057(#11486)pyflakes] EnableF822in__init__.pyfiles by default (#11370)Formatter
Server
ruff server(#11590)ruff server(#11615)Bug fixes
flake8-comprehension] Strip parentheses around generators inC400(#11607)repeated-isinstance-callsas unsafe on Python 3.10 and later (#11622)v0.4.6Compare Source
Breaking changes
Preview features
flake8-async] Sleep with >24 hour interval should usually sleep forever (ASYNC116) (#11498)Rule changes
numpy] Add missing functions to NumPy 2.0 migration rule (#11528)mccabe] Consider irrefutable pattern similar toif .. elseforC901(#11565)match-casestatements forC901,PLR0912, andPLR0915(#11521)UP032) (#11524)flake8-bandit]request-without-timeoutshould warn forrequests.request(#11548)flake8-self] Ignore sunder accesses inflake8-selfrules (#11546)pyupgrade] Lint forTypeAliasTypeusages (UP040) (#11530)Server
ruff serverconfiguration discovery (#11551)ruff servercorrectly treats.pyifiles as stub files (#11535)ruff serversearches for configuration in parent directories (#11537)ruff server: An empty code action filter no longer returns notebook source actions (#11526)Bug fixes
flake8-logging-format] Fix autofix title inlogging-warn(G010) (#11514)refurb] Avoid recommendingoperator.itemgetterwith dependence on lambda arguments (#11574)flake8-simplify] Avoid recommending context manager in__enter__implementations (#11575)--output-file(#11550)singledispatcharguments as runtime-required (#11523)v0.4.5Compare Source
Ruff's language server is now in Beta
v0.4.5marks the official Beta release ofruff server, an integrated language server built into Ruff.ruff serversupports the same feature set asruff-lsp, powering linting, formatting, andcode fixes in Ruff's editor integrations -- but with superior performance and
no installation required. We'd love your feedback!
You can enable
ruff serverin the VS Code extension today.To read more about this exciting milestone, check out our blog post!
Rule changes
flake8-future-annotations] Rewordfuture-rewritable-type-annotation(FA100) message (#11381)isort] Expanded the set of standard-library modules to include_string, etc. (#11374)pycodestyle] Consider soft keywords forE27rules (#11446)pyflakes] Recommend adding unused import bindings to__all__(#11314)pyflakes] Update documentation and deprecateignore_init_module_imports(#11436)pyupgrade] Mark quotes as unnecessary for non-evaluated annotations (#11485)Formatter
quote-style = preserve(#11490)Server
noqacomment code actions (#11276)CLI
--output-formatas a CLI option forruff config(#11438)Bug fixes
PLE0237for property with setter (#11377)TCH005forifstmt withelif/elseblock (#11376)__future__annotations as required for non-evaluated type annotations (#11414)flake8-pie] Preserve parentheses inunnecessary-dict-kwargs(#11372)pylint] Ignore__slots__with dynamic values (#11488)pylint] Removetrybody from branch counting (#11487)refurb] Respect operator precedence inFURB110(#11464)Documentation
--previewto the README (#11395)pycodestyle] Clarify motivation forE713andE714(#11483)pyflakes] Update docs to describe WAI behavior (F541) (#11362)pylint] Clearly indicate what is counted as a branch (#11423)v0.4.4Compare Source
Preview features
pycodestyle] Ignore end-of-line comments when determining blank line rules (#11342)pylint] Detectpathlib.Path.opencalls inunspecified-encoding(PLW1514) (#11288)flake8-pyi] ImplementPYI059(generic-not-last-base-class) (#11233)flake8-pyi] ImplementPYI062(duplicate-literal-member) (#11269)Rule changes
flake8-boolean-trap] Allow passing booleans as positional-only arguments in code such asset(True)(#11287)flake8-bugbear] Ignore enum classes incached-instance-method(B019) (#11312)Server
ruff serverhanging after Neovim closes (#11291)Bug fixes
pylint] Considerwithstatements fortoo-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)v0.4.3Compare Source
Enhancements
Preview features
refurb] Use function range forreimplemented-operatordiagnostics (#11271)refurb] Ignore methods inreimplemented-operator(FURB118) (#11270)refurb] Implementfstring-number-format(FURB116) (#10921)ruff] Implementredirected-noqa(RUF101) (#11052)pyflakes] Distinguish between first-party and third-party imports for fix suggestions (#11168)Rule changes
flake8-bugbear] Ignore non-abstract class attributes when enforcingB024(#11210)flake8-logging] Include inline instantiations when detecting loggers (#11154)pylint] Also emitPLR0206for properties with variadic parameters (#11200)ruff] Detect duplicate codes as part ofunused-noqa(RUF100) (#10850)Formatter
LSP
ruff serversetup guide for Helix (#11183)ruff serverno longer hangs after shutdown (#11222)ruff serverreads from a configuration TOML file in the user configuration directory if no local configuration exists (#11225)ruff serverrespectsper-file-ignoresconfiguration (#11224)ruff server: Support a custom TOML configuration file (#11140)ruff server: Support setting to prioritize project configuration over editor configuration (#11086)Bug fixes
pyflakes] Prioritizeredefined-while-unusedoverunused-import(#11173)ruff] Respectasyncexpressions in comprehension bodies (#11219)pygrep_hooks] Fixblanket-noqapanic when last line has noqa with no newline (PGH004) (#11108)perflint] Ignore list-copy recommendations for asyncforloops (#11250)pyflakes] Improveinvalid-print-syntaxdocumentation (#11171)Performance
Windows
v0.4.2Compare Source
Rule changes
flake8-pyi] Allow for overloaded__exit__and__aexit__definitions (PYI036) (#11057)pyupgrade] Catch usages of"%s" % varand provide an unsafe fix (UP031) (#11019)refurb] Implement new rule that suggests min/max oversorted()(FURB192) (#10868)Server
noqacodes (#11096)Bug fixes
macos-12for building release wheels to enable macOS 11 compatibility (#11146)flake8-blind-expect] Allow raise from inBLE001(#11131)flake8-pyi] Allow simple assignments toNonein enum class scopes (PYI026) (#11128)flake8-simplify] Avoid raisingSIM911for non-zipattribute calls (#11126)refurb] Avoidoperator.itemgettersuggestion for single-item tuple (#11095)ruff] Respect per-file-ignores forRUF100with no other diagnostics (#11058)ruff] Fix async comprehension false positive (RUF029) (#11070)Documentation
flake8-bugbear] Document explicitly disabling strict zip (B905) (#11040)flake8-type-checking] Mentionlint.typing-modulesinTCH001,TCH002, andTCH003(#11144)isort] Improve documentation around customisortsections (#11050)pylint] Fix documentation oversight forinvalid-X-returns(#11094)Performance
matchitto resolve per-file settings (#11111)v0.4.1Compare Source
Parser
Rule changes
flake8-copyright] UpdateCPY001to check the first 4096 bytes instead of 1024 (#11927)pycodestyle] UpdateE999to show all syntax errors instead of just the first one (#11900)Server
Security
v0.4.0Compare Source
A new, hand-written parser
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.
A new language server in Rust
With this release, we also want to highlight our new language server.
ruff serveris a Rust-powered languageserver 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-analyzerand it will open the door for a lotof exciting features. It’s also faster than our previous Python-based language server
-- but you probably guessed that already.
ruff serveris only in alpha, but it has a lot of features that you can try out today:ruff.applyAutofix,ruff.applyFormat, andruff.applyOrganizeImportssource.fixAllandsource.organizeImportssource actionsTo setup
ruff serverwith your editor, refer to the README.md.Preview features
pycodestyle] Do not triggerE3rules ondefs following a function/method with a dummy body (#10704)pylint] Implementinvalid-bytes-returned(E0308) (#10959)pylint] Implementinvalid-length-returned(E0303) (#10963)pylint] Implementself-cls-assignment(W0642) (#9267)pylint] Omit stubs frominvalid-boolandinvalid-str-return-type(#11008)ruff] New ruleunused-async(RUF029) to detect unneededasynckeywords on functions (#9966)Rule changes
flake8-bandit] Allowurllib.request.urlopencalls with staticRequestargument (S310) (#10964)flake8-bugbear] Treatraise NotImplemented-only bodies as stub functions (B006) (#10990)flake8-slots] Respect same-fileEnumsubclasses (SLOT000) (#11006)pylint] Support inverted comparisons (PLR1730) (#10920)Linter
--show-settings(#11003)BuiltinTypeChecker(#10976)RuleTable::any_enabled(#10971)Server
This section is devoted to updates for our new language server, written in Rust.
Configuration
RUFF_OUTPUT_FILEenvironment variable support (#10992)Bug fixes
non-augmented-assignmentfor reversed, non-commutative operators (PLR6104) (#10909)PLR6104) (#10912)per-file-ignoresforRUF100on blanket# noqa(#10908)ifexpression for parenthesized with items parsing (#11010)FOR_TARGETcontext for all kinds of parentheses (#11009)v0.3.7Compare Source
Preview features
flake8-bugbear] Implementloop-iterator-mutation(B909) (#9578)pylint] Implement rule to prefer augmented assignment (PLR6104) (#9932)Bug fixes
pylint] Recodenan-comparisonrule toW0177(#10894)pylint] Reverse min-max logic inif-stmt-min-max(#10890)v0.3.6Compare Source
Preview features
pylint] Implementbad-staticmethod-argument(PLW0211) (#10781)pylint] Implementif-stmt-min-max(PLR1730,PLR1731) (#10002)pyupgrade] Replacestr,Enummultiple inheritance withStrEnumUP042(#10713)refurb] Implementif-expr-instead-of-or-operator(FURB110) (#10687)refurb] Implementint-on-sliced-str(FURB166) (#10650)refurb] Implementwrite-whole-file(FURB103) (#10802)refurb] Supportitemgetterinreimplemented-operator(FURB118) (#10526)flake8_comprehensions] Addsum/min/maxto unnecessary comprehension check (C419) (#10759)Rule changes
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-basedtyping.NamedTuples as well as subclasses ofcollections.namedtuple()(SLOT002) (#10808)pyflakes] Allow forward references in class bases in stub files (F821) (#10779)pygrep-hooks] Improveblanket-noqaerror message (PGH004) (#10851)CLI
FORCE_COLORenv var (#10839)Configuration
[extend-]per-file-ignores(#10852)Bug fixes
flake8-import-conventions] Accept non-aliased (but correct) import inunconventional-import-alias(ICN001) (#10729)flake8-quotes] Add semantic model flag when inside f-string replacement field (#10766)pep8-naming] Recursively resolveTypeDictsfor N815 violations (#10719)flake8-quotes] RespectQ00*ignores inflake8-quotesrules (#10728)flake8-simplify] Show negated condition inneedless-booldiagnostics (SIM103) (#10854)ruff] Use within-scope shadowed bindings inasyncio-dangling-task(RUF006) (#10793)flake8-pytest-style] Fix single-tuple conversion inpytest-parametrize-values-wrong-type(PT007) (#10862)flake8-return] Ignore assignments to annotated variables inunnecessary-assign(RET504) (#10741)refurb] Do not allow any keyword arguments forread-whole-fileinrbmode (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)# noqadirectives on__all__openers (#10798)v0.3.5Compare Source
Preview features
pylint] Implementmodified-iterating-set(E4703) (#10473)refurb] Implementfor-loop-set-mutations(FURB142) (#10583)refurb] Implementunnecessary-from-float(FURB164) (#10647)refurb] Implementverbose-decimal-constructor(FURB157) (#10533)Rule changes
flake8-comprehensions] Handled special case forC401which also matchesC416(#10596)flake8-pyi] Markunaliased-collections-abc-set-importfix as "safe" for more cases in stub files (PYI025) (#10547)numpy] Addrow_stackto 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)Configuration
flake8-boolean-trap] Add setting for user defined allowed boolean trap (#10531)Bug fixes
__all__definitions when renaming symbols in autofixes (#10527)__all__definitions (#10525)flake8-bugbear] Avoid false positive for usage aftercontinue(B031) (#10539)flake8-copyright] Accept commas in default copyright pattern (#9498)flake8-datetimez] Allow f-strings with%zforDTZ007(#10651)flake8-pytest-style] FixPT014autofix for last item in list (#10532)flake8-quotes] IgnoreQ000,Q001when 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 whenfrom __future__ import annotationsis active (attempt 2) (#10524)pyflakes] Makeunnecessary-lambdaan always-unsafe fix (#10668)pylint] Fixed false-positive on the rulePLW1641(eq-without-hash) (#10566)ruff] Fix panic in unused# noqaremoval with multi-byte space (RUF100) (#10682)Documentation
CONTRIBUTING.md(#10665)flake8-loggingnext to the other flake8 plugins in registry (#10587)flake8-bandit] Update warning message for ruleS305to address insecure block cipher mode use (#10602)flake8-bugbear] Document use of anonymous assignment inuseless-expression(#10551)flake8-datetimez] Clarify error messages and docs forDTZrules (#10621)pycodestyle] Use same before vs. after numbers forspace-around-operator(#10640)ruff] Changequadratic-list-summationdocs to useiaddconsistently (#10666)v0.3.4Compare Source
Preview features
flake8-simplify] Detect implicitelsecases inneedless-bool(SIM103) (#10414)pylint] Implementnan-comparison(PLW0117) (#10401)pylint] Implementnonlocal-and-global(E115) (#10407)pylint] Implementsingledispatchmethod-function(PLE5120) (#10428)refurb] Implementlist-reverse-copy(FURB187) (#10212)Rule changes
flake8-pytest-style] Add automatic fix forpytest-parametrize-values-wrong-type(PT007) (#10461)pycodestyle] Allow SPDX license headers to exceed the line length (E501) (#10481)Formatter
Bug fixes
C409) (#10491)namefrom being reformatted (#10442)W605(#10480).pyifiles (#10512)E231bug: Inconsistent catch compared to pycodestyle, such as when dict nested in list (#10469)Optionsreferences to blank line docs (#10498)from __future__ import annotationsis active (#10362)"' (#10513)flake8-bugbear] Allow tuples of exceptions (B030) (#10437)flake8-quotes] Avoid syntax errors due to invalid quotes (Q000, Q002) (#10199)v0.3.3Compare Source
Preview features
flake8-bandit]: ImplementS610rule (#10316)pycodestyle] Implementblank-line-at-end-of-file(W391) (#10243)pycodestyle] Implementredundant-backslash(E502) (#10292)pylint] - implementredeclared-assigned-name(W0128) (#9268)Rule changes
flake8_comprehensions] Handled special case forC400which also matchesC416(#10419)flake8-bandit] Implement upstream updates forS311,S324andS605(#10313)pyflakes] RemoveF401fix for__init__imports by default and allow opt-in to unsafe fix (#10365)pylint] Implementinvalid-bool-return-type(E304) (#10377)pylint] Include builtin warnings in useless-exception-statement (PLW0133) (#10394)CLI
ruff check(#8631)Bug fixes
PIE970] Allow trailing ellipsis intyping.TYPE_CHECKING(#10413)TRIO115if the argument is a variable (#10376)F811] Avoid removing shadowed imports that point to different symbols (#10387)F821andF822false positives in.pyifiles (#10341)F821false negatives in.pyfiles whenfrom __future__ import annotationsis active (#10362)Indexerfails to identify continuation preceded by newline #10351 (#10354)Settingsdisplay (#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 triggerE225andE275when the next token is a ')' (#10315)pylint] Avoid false-positive slot non-assignment for__dict__(PLE0237) (#10348)Documentation
ruff.tomlformat 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 ininvalid-str-return-type(E307) (#10400).fromcheckandformatcommands (#10217)v0.3.2Compare Source
Preview features
withitem formatting for Python 3.8 or older (#10276)Rule changes
pyupgrade] Allow fixes for f-string rule regardless of line length (UP032) (#10263)pycodestyle] Include actual conditions in E712 diagnostics (#10254)Bug fixes
withitems formatting (#10274)Parameterrange for*argsand**kwargs(#10283)typing.Annotatedsubscripts as type definitions (#10285)v0.3.1Compare Source
Preview features
pycodestyle] Fix E301 not triggering on decorated methods. (#10117)pycodestyle] Respectisortsettings in blank line rules (E3*) (#10096)pycodestyle] Make blank lines in typing stub files optional (E3*) (#10098)pylint] Implementsingledispatch-method(E1519) (#10140)pylint] Implementuseless-exception-statement(W0133) (#10176)Rule changes
flake8-debugger] Check for use ofdebugpyandptvsddebug modules (#10177) (#10194)pyupgrade] Generate diagnostic for all valid f-string conversions regardless of line length (UP032) (#10238)pep8_naming] Add fixes forN804andN805(#10215)CLI
ruff format --diff(#10110)--configand--isolatedglobal flags (#10150)--config(#10219)Configuration
required-version(#10216)default-sectionsetting (#10149)Bug fixes
CapWordsmessage (#10220)flake8-raise] Avoid false-positives for parens-on-raise withfuture.exception()(RSE102) (#10206)pylint] Add fix for unary expressions inPLC2801(#9587)ruff] Fix RUF028 not allowing# fmt: skipon match cases (#10178)v0.3.0Compare Source
This release introduces the new Ruff formatter 2024.2 style and adds a new lint rule to
detect invalid formatter suppression comments.
Preview features
flake8-bandit] Remove suspicious-lxml-import (S410) (#10154)pycodestyle] Allowos.environmodifications between imports (E402) (#10066)pycodestyle] Don't warn about a single whitespace character before a comma in a tuple (E203) (#10094)Rule changes
eradicate] Detect commented outcasestatements (ERA001) (#10055)eradicate] Detect single-line code fortry:,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 Ruledict-iter-missing-items(PLE1141) (#9845)pylint] Ignoresys.versionandsys.platform(PLR1714) (#10054)pyupgrade] Detect literals with unary operators (UP018) (#10060)ruff] Expand rule forlist(iterable).pop(0)idiom (RUF015) (#10148)Formatter
This release introduces the Ruff 2024.2 style, stabilizing the following changes:
withparentheses when targeting Python 3.9 or newer (#9222)...) in typing stub files (#9155)...) body (#7440, #9240)CLI
extendas part of a--configflag (#10135)buildfrom the default exclusion list (#10093)ruff <path>,ruff --explain,ruff --clean, andruff --generate-shell-completionin favor ofruff check <path>,ruff rule,ruff clean, andruff generate-shell-completion(#10169)--formatfromruff ruleandruff linter(#10170)Bug fixes
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 ingettextcalls (RUF027) (#10118)ruffcrashing on PowerPC systems because of too small page size (#10080)Performance
Documentation
line-lengthoption: fix link topycodestyle.max-line-length(#10136)v0.2.2Compare Source
Highlights include:
--preview).--configargument (e.g.,--config "lint.isort.combine-as-imports=false").Preview features
pycodestyle] Add blank line(s) rules (E301,E302,E303,E304,E305,E306) (#9266)refurb] Implementreadlines_in_for(FURB129) (#9880)Rule changes
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] Detectmark_safeusages in decorators (#9887)ruff] Expandasyncio-dangling-task(RUF006) to includenew_event_loop(#9976)flake8-pyi] Ignore 'unused' private type dicts in class scopes (#9952)Formatter
indent-style=tabs(#9915)preservemode (#9922)CLI
Bug fixes
show-settingsfilters directory-agnostic (#9866)DebugText(#9953)flake8-simplify] Avoid false positive withasyncfor loops (SIM113) (#9996)flake8-trio] Respectasync withintimeout-without-await(#9859)perflint] Catch a wider range of mutations inPERF101(#9955)pycodestyle] FixE30Xpanics on blank lines with trailing white spaces (#9907)pydocstyle] Allow usingparametersas 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)Performance
memchrfor string lexing (#9888)memchrfor tab-indentation detection (#9853)Result<Tok, LexicalError>size by usingBox<str>instead ofString(#9885)Exprfrom 80 to 64 bytes (#9900)v0.2.1Compare Source
This release includes support for range formatting (i.e., the ability to format specific lines
within a source file).
Preview features
refurb] Implementmissing-f-string-syntax(RUF027) (#9728)Formatter
--rangeoption toruff format(#9733)Bug fixes
__get__and__set__fromunnecessary-dunder-call(#9791)Protocolin ellipsis removal (#9841)Performance
C408(#9822)C400,C401,C410, andC418(#9819)AhoCorasickto speed up quote match (#9773)C405andC409(#9821)zero-sleep-call(#9766)C403(#9818)Documentation
max-pos-argsexample tomax-positional-args(#9797)weak_cryptographic_key.rs(#9774)ANNrules in changelog (#9771)max-positional-args(#9838)v0.2.0Compare Source
Breaking changes
NURSERYselector cannot be used anymoreSee also, the "Remapped rules" section which may result in disabled rules.
Deprecations
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 fullinstead--no-show-source; use--output-format conciseinstead--output-format text; usefullorconciseinsteadThe 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.unfixableRemapped rules
The following rules have been remapped to new codes:
raise-without-from-inside-except:TRY200toB904suspicious-eval-usage:PGH001toS307logging-warn:PGH002toG010static-key-dict-comprehension:RUF011toB035runtime-string-union:TCH006toTCH010Stabilizations
The 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) allowssys.pathmodifications between importsreimplemented-container-builtin(PIE807) includes lambdas that can be replaced withdictunnecessary-placeholder(PIE790) applies to unnecessary ellipses (...)if-else-block-instead-of-dict-get(SIM401) applies toif-elseexpressionsPreview features
refurb] Implementmetaclass_abcmeta(FURB180) (#9658)blank_line_after_nested_stub_classpreview style (#9155)and-or-ternary(PLR1706) was removedBug fixes
flake8-async] Takepathlib.Pathinto 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 inmagic-value-comparison(PLR2004) (#9694)IfExpwith dual string arms ininvalid-envvar-default(#9734)pylint] Add__mro_entries__to known dunder methods (PLW3201) (#9706)Documentation
v0.1.15Compare Source
Preview features
NURSERYselector is used with--preview(#9682)flake8-return] Add fixes for all rules (RET505,RET506,RET507,RET508) (#9595)flake8-simplify] Add fix forif-with-same-arms(SIM114) (#9591)pycodestyle] Add fix formultiple-imports-on-one-line(E401) (#9518)pylint] Add fix forcollapsible-else-if(PLR5501) (#9594)pylint] Add fix foruseless-else-on-loop(PLW0120) (#9590)pylint] Implementassigning-non-slot(E0237) (#9623)pylint] Implementpotential-index-error(PLE0643) (#9545)pylint] Implementtoo-many-nested-blocks(PLR1702) (#9172)ruff] Add rule to sort__slots__and__match_args__(#9564)ruff] Detect unnecessarydictcomprehensions for iterables (RUF025) (#9613)ruff] Guard against use ofdefault_factoryas a keyword argument (RUF026) (#9651)ruff] Implementmutable-fromkeys-value(RUF024) (#9597)CLI
--helpoutput (#9633)Bug fixes
flake8-no-pep420] Include global--configwhen determining namespace packages (#9603)flake8-pie] Omit bound tuples passed to.startswithor.endswith(#9661)flake8-return] Avoid panic when fixing inlined else blocks (#9657)flake8-return] Consider exception suppression in unnecessary assignment (#9673)flake8-return] TakeNoReturnannotation into account when analyzing implicit returns (#9636)flake8-simplify] Support inverted returns inneedless-bool(SIM103) (#9619)flake8-type-checking] Add Pydantic'sBaseConfigto default-copy list (#9650)flake8-type-checking] Avoid markingInitVaras a typing-only annotation (#9688)pycodestyle] Allowdtypecomparisons intype-comparison(#9676)pydocstyle] Re-implementlast-line-after-section(D413) (#9654)Documentation
flake8-pytest-style] Add fix safety documentation forduplicate-parameterize-test-cases(#9678)pylint] Documentliteral-membershipfix safety conditions (#9677)isort] Fix reference toisortrule code (#9598)v0.1.14Compare Source
Preview features
flake8-bugbear] Add fix forduplicate-value(B033) (#9510)flake8-simplify] Implementenumerate-for-loop(SIM113) (#7777)pygrep_hooks] Add fix fordeprecated-log-warn(PGH002) (#9519)pylint] Implementimport-private-name(C2701) (#5920)refurb] Implementregex-flag-aliaswith fix (FURB167) (#9516)ruff] Add rule and fix to sort contents of__all__(RUF022) (#9474)tryceratops] Add fix forerror-instead-of-exception(TRY400) (#9520)Rule changes
flake8-pyi] FixPYI047false negatives on PEP-695 type aliases (#9566)flake8-pyi] FixPYI049false negatives on call-basedTypedDicts (#9567)pylint] Excludeselfandclswhen counting method arguments (PLR0917) (#9563)CLI
--show-settingsdisplays active settings in a far more readable format (#9464)--extensionsupport to the formatter (#9483)Configuration
pycodestyle] Use the configured tab size when expanding indents (#9506)Bug fixes
flake8-simplify] Avoid some moreenumerate-for-loopfalse 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 whenreimplemented-operatoris called on function (FURB118) (#9556)ruff] Avoid treating named expressions as static keys (RUF011) (#9494)Documentation
noqawith isort rules (#9555)cargo bench -p ruff_benchmark(#9535)emacs-ruff-format(#9403)flake8-blind-except] Document exceptions toblind-exceptrule (#9580)v0.1.13Compare Source
Bug fixes
flake8-simplify] Account for possibly-empty f-string values in truthiness logic (#9484)pylint] Add the missing period inunnecessary-dunder-call(#9485)pylint] Fix__aenter__message inunnecessary-dunder-call(#9492)v0.1.12Compare Source
Preview features
flake8-bandit] Addssl-with-no-version(S504) (#9384)flake8-bandit] Implementssl-insecure-version(S502) (#9390)flake8-bandit] Implementssl-with-bad-defaults(S503) (#9391)flake8-bandit] Implement suspicious import rules (S4XX) (#8831)flake8-simplify] Implementzip-dict-keys-and-values(SIM911) (#9460)pyflakes] Add a fix forredefined-while-unused(F811) (#9419)pylint] Implementunnecessary-dunder-call(C2801) (#9166)ruff] Addparenthesize-chained-operators(RUF021) to enforce parentheses ina or b and c(#9440)Rule changes
flake8-boolean-trap] Allow Boolean positional arguments in setters (#9429)flake8-builtins] Restrictbuiltin-attribute-shadowing(A003) to actual shadowed references (#9462)flake8-pyi] Add fix forgenerator-return-from-iter-method(PYI058) (#9355)pyflakes] Don't flagredefined-while-unused(F811) inifbranches (#9418)pyupgrade] Add some additional Python 3.12 typing members todeprecated-import(#9445)ruff] Add fix forparenthesize-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)Formatter
# fmt: skipwith interspersed same-line comments (#9395)Bug fixes
Nonecomparisons (#9376)DisplayParseErrorfor stdin parser errors (#9409)comment_rangesfor isort directive extraction (#9414)flake8-pyi] Excludewarnings.deprecatedandtyping_extensions.deprecatedarguments (#9423)flake8-pyi] Fix false negative forunused-private-protocol(PYI046) with unused generic protocols (#9405)pydocstyle] Disambiguate argument descriptors from section headers (#9427)pylint] HomogenizePLR0914message to match otherPLR09XXrules (#9399)ruff] AllowHashable = Nonein type annotations (RUF013) (#9442)Documentation
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.
dfd32c576ftob601648d6bUpdate dependency ruff to v0.2.0to Update dependency ruff to v0.2.1b601648d6bto9269e34342Update dependency ruff to v0.2.1to Update dependency ruff to v0.2.29269e34342to58ca3fb060Update dependency ruff to v0.2.2to Update dependency ruff to v0.3.0Update dependency ruff to v0.3.0to Update dependency ruff to v0.3.158ca3fb060toabfcaafc57abfcaafc57to741d966bdaUpdate dependency ruff to v0.3.1to Update dependency ruff to v0.3.3741d966bdato9314e917ffUpdate dependency ruff to v0.3.3to Update dependency ruff to v0.3.49314e917ffto135918b9c6Update dependency ruff to v0.3.4to Update dependency ruff to v0.3.5135918b9c6to4915886ed0Update dependency ruff to v0.3.5to Update dependency ruff to v0.3.64915886ed0tod9e45e48cdUpdate dependency ruff to v0.3.6to Update dependency ruff to v0.3.7Update dependency ruff to v0.3.7to Update dependency ruff to v0.4.0d9e45e48cdto6bf2418deeUpdate dependency ruff to v0.4.0to Update dependency ruff to v0.4.16bf2418deetod5b7ee1834Update dependency ruff to v0.4.1to Update dependency ruff to v0.4.2d5b7ee1834to19a7e632cd19a7e632cdto86201722ceUpdate dependency ruff to v0.4.2to Update dependency ruff to v0.4.3Update dependency ruff to v0.4.3to Update dependency ruff to v0.4.486201722ceto6ad90938696ad9093869to084755b620Update dependency ruff to v0.4.4to Update dependency ruff to v0.4.5084755b620to81662765efUpdate dependency ruff to v0.4.5to Update dependency ruff to v0.4.681662765eftoef126e6142Update dependency ruff to v0.4.6to Update dependency ruff to v0.4.7ef126e6142to85d3c1792eUpdate dependency ruff to v0.4.7to Update dependency ruff to v0.4.885d3c1792etoc2df463626Update dependency ruff to v0.4.8to Update dependency ruff to v0.4.9c2df463626to62f5f71a28Update dependency ruff to v0.4.9to Update dependency ruff to v0.4.1062f5f71a28to2cfeaacf04Update dependency ruff to v0.4.10to Update dependency ruff to v0.5.02cfeaacf04to0abaf89fabUpdate dependency ruff to v0.5.0to Update dependency ruff to v0.5.10abaf89fabtob841f514dbUpdate dependency ruff to v0.5.1to Update dependency ruff to v0.5.2b841f514dbto7b4052c611Update dependency ruff to v0.5.2to Update dependency ruff to v0.5.37b4052c611to2d78485b64Update dependency ruff to v0.5.3to Update dependency ruff to v0.5.42d78485b64to39ab28bc3dUpdate dependency ruff to v0.5.4to Update dependency ruff to v0.5.539ab28bc3dtof03dced999Update dependency ruff to v0.5.5to Update dependency ruff to v0.5.6f03dced999toc61049fbccUpdate dependency ruff to v0.5.6to Update dependency ruff to v0.5.7c61049fbcctofe592bd9e5Update dependency ruff to v0.5.7to Update dependency ruff to v0.6.0fe592bd9e5to4df606eb9fUpdate dependency ruff to v0.6.0to Update dependency ruff to v0.6.14df606eb9fto1097de0f15Update dependency ruff to v0.6.1to Update dependency ruff to v0.6.2Update dependency ruff to v0.6.2to Update dependency ruff to v0.6.31097de0f15tobb6adc39f2bb6adc39f2tod890d60047Update dependency ruff to v0.6.3to Update dependency ruff to v0.6.4d890d60047to885a30a720Update dependency ruff to v0.6.4to Update dependency ruff to v0.6.5885a30a720to1436c14719Update dependency ruff to v0.6.5to Update dependency ruff to v0.6.61436c14719to2b585d117eUpdate dependency ruff to v0.6.6to Update dependency ruff to v0.6.72b585d117etof479496decUpdate dependency ruff to v0.6.7to Update dependency ruff to v0.6.8f479496dectof117062a16Update dependency ruff to v0.6.8to Update dependency ruff to v0.6.9f117062a16to30e7885b27Update dependency ruff to v0.6.9to Update dependency ruff to v0.7.030e7885b27to92b3017a4eUpdate dependency ruff to v0.7.0to Update dependency ruff to v0.7.1Update dependency ruff to v0.7.1to Update dependency ruff to v0.7.292b3017a4etocca7624f7ccca7624f7ctoe14ff172b6Update dependency ruff to v0.7.2to Update dependency ruff to v0.7.3e14ff172b6tob9aef80e3eUpdate dependency ruff to v0.7.3to Update dependency ruff to v0.7.4b9aef80e3etoe1839ec68bUpdate dependency ruff to v0.7.4to Update dependency ruff to v0.8.0e1839ec68bto7b47c4fac9Update dependency ruff to v0.8.0to Update dependency ruff to v0.8.17b47c4fac9to8e49a44021Update dependency ruff to v0.8.1to Update dependency ruff to v0.8.28e49a44021toa22f3e90b7Update dependency ruff to v0.8.2to Update dependency ruff to v0.8.3a22f3e90b7tof995b4ccf5Update dependency ruff to v0.8.3to Update dependency ruff to v0.8.4f995b4ccf5toa10f3f6f53Update dependency ruff to v0.8.4to Update dependency ruff to v0.8.5a10f3f6f53tob865c57e82Update dependency ruff to v0.8.5to Update dependency ruff to v0.8.6b865c57e82to730a03cdd1Update dependency ruff to v0.8.6to Update dependency ruff to v0.9.0Update dependency ruff to v0.9.0to Update dependency ruff to v0.9.1730a03cdd1to7414d7ade67414d7ade6toeb64fdbed4Update dependency ruff to v0.9.1to Update dependency ruff to v0.9.2eb64fdbed4tod1c307a8a6Update dependency ruff to v0.9.2to Update dependency ruff to v0.9.3Update dependency ruff to v0.9.3to Update dependency ruff to v0.9.4d1c307a8a6to3764b2e2a23764b2e2a2to23bef7d9cbUpdate dependency ruff to v0.9.4to Update dependency ruff to v0.9.523bef7d9cbtofb2dcda9d0Update dependency ruff to v0.9.5to Update dependency ruff to v0.9.6fb2dcda9d0tocbe8e5b97aUpdate dependency ruff to v0.9.6to Update dependency ruff to v0.9.7cbe8e5b97ato8063861eb4Update dependency ruff to v0.9.7to Update dependency ruff to v0.9.8Update dependency ruff to v0.9.8to Update dependency ruff to v0.9.98063861eb4to38845bcd89Update dependency ruff to v0.9.9to Update dependency ruff to v0.9.1038845bcd89to87d22a520687d22a5206to15eac8a465Update dependency ruff to v0.9.10to Update dependency ruff to v0.10.015eac8a465to2434080dc5Update dependency ruff to v0.10.0to Update dependency ruff to v0.11.02434080dc5to285d382890Update dependency ruff to v0.11.0to Update dependency ruff to v0.11.1285d382890to83b094763dUpdate dependency ruff to v0.11.1to Update dependency ruff to v0.11.283b094763dtof604cbdb27Update dependency ruff to v0.11.2to Update dependency ruff to v0.11.3f604cbdb27to0e6e88d2a1Update dependency ruff to v0.11.3to Update dependency ruff to v0.11.40e6e88d2a1to039ae0db42Update dependency ruff to v0.11.4to Update dependency ruff to v0.11.5039ae0db42tob712a69136Update dependency ruff to v0.11.5to Update dependency ruff to v0.11.6b712a69136to6ae971f5eeUpdate dependency ruff to v0.11.6to Update dependency ruff to v0.11.76ae971f5eetoab4cd973c8Update dependency ruff to v0.11.7to Update dependency ruff to v0.11.8ab4cd973c8tobb0ec3915aUpdate dependency ruff to v0.11.8to Update dependency ruff to v0.11.9bb0ec3915atoc74d3c4ea0Update dependency ruff to v0.11.9to Update dependency ruff to v0.11.10c74d3c4ea0to5ce523cfb2Update dependency ruff to v0.11.10to Update dependency ruff to v0.11.115ce523cfb2tob547104813Update dependency ruff to v0.11.11to Update dependency ruff to v0.11.12b547104813to87bd7258f7Update dependency ruff to v0.11.12to Update dependency ruff to v0.11.1387bd7258f7toac25433b32Update dependency ruff to v0.11.13to Update dependency ruff to v0.12.0ac25433b32toe2cc8f3254Update dependency ruff to v0.12.0to Update dependency ruff to v0.12.1e2cc8f3254to166fb7f8c7Update dependency ruff to v0.12.1to Update dependency ruff to v0.12.2166fb7f8c7to05fd18bcf7Update dependency ruff to v0.12.2to Update dependency ruff to v0.12.305fd18bcf7to6c5407455dUpdate dependency ruff to v0.12.3to Update dependency ruff to v0.12.46c5407455dtoa0aa2e23cdUpdate dependency ruff to v0.12.4to Update dependency ruff to v0.12.5a0aa2e23cdtof160406798Update dependency ruff to v0.12.5to Update dependency ruff to v0.12.6f160406798todab02fcbe8Update dependency ruff to v0.12.6to Update dependency ruff to v0.12.7dab02fcbe8to0f21344a8fUpdate dependency ruff to v0.12.7to Update dependency ruff to v0.12.80f21344a8fto005afd1b1cUpdate dependency ruff to v0.12.8to Update dependency ruff to v0.12.9Update dependency ruff to v0.12.9to Update dependency ruff to v0.12.10005afd1b1cto6e4dde52c06e4dde52c0to9d9b423703Update dependency ruff to v0.12.10to Update dependency ruff to v0.12.119d9b423703tob9d27d590eUpdate dependency ruff to v0.12.11to Update dependency ruff to v0.12.12b9d27d590eto09e012c08eUpdate dependency ruff to v0.12.12to Update dependency ruff to v0.13.009e012c08eto58fefc3d97Update dependency ruff to v0.13.0to Update dependency ruff to v0.13.158fefc3d97toc76cba2cc6Update dependency ruff to v0.13.1to Update dependency ruff to v0.13.2c76cba2cc6to0de6104586Update dependency ruff to v0.13.2to Update dependency ruff to v0.13.30de6104586toc9304cabf6Update dependency ruff to v0.13.3to Update dependency ruff to v0.14.0c9304cabf6tof183ac5a0cUpdate dependency ruff to v0.14.0to Update dependency ruff to v0.14.1Update dependency ruff to v0.14.1to Update dependency ruff to v0.14.2f183ac5a0cto10ea89b080View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.