chore(deps): update dependency ruff to ^0.5.0 - autoclosed #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.0.291->^0.5.0Release Notes
astral-sh/ruff (ruff)
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.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)npy] 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] ImplementPYI063(#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)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
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
Preview features
pylint] Implementinvalid-hash-returned(PLE0309) (#10961)pylint] Implementinvalid-index-returned(PLE0305) (#10962)Bug fixes
pylint] AllowNoReturn-like functions for__str__,__len__, etc. (PLE0307) (#11017)ruff] Ignore stub functions inunused-async(RUF029) (#11026)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)[`
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 Mend Renovate. View repository job log here.