Update dependency ruff to v0.4.3 #357
Merged
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.3.6->==0.4.3Release Notes
astral-sh/ruff (ruff)
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)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.