This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
chore(deps): update dependency refurb to v2 #239
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:
^1.16.0
->^2.0.0
Release Notes
dosisod/refurb (refurb)
v2.0.0
Compare Source
This new release greatly improves the type checking capabilities of Refurb. You might find that you are getting a lot more errors in your projects, as well as a few false positives. Please report any incorrect changes you might find!
Add better type deduction
Refurb now makes better use of Mypy's type deduction system, allowing Refurb to find more errors and with better accuracy.
For example, the following is not detected in older versions of Refurb:
With this new version of Refurb, the type of
nums[0]
is inferred as alist
:While this new type deduction is a great improvement on what existed before, there is still a lot of room for improvement. If you find any typing related bugs, please report it!
Add
use-isinstance-bool
check (FURB191)Don't check if a value is
True
orFalse
usingin
, use anisinstance()
call.Bad:
Good:
Add
use-str-method
check (FURB190)Don't use a lambda function to call a no-arg method on a string, use the name of the string method directly. It is faster, and often times improves readability.
Bad:
Good:
Add
no-subclass-builtin
check (FURB189)Subclassing
dict
,list
, orstr
objects can be error prone, use theUserDict
,UserList
, andUserStr
objects from thecollections
module instead.Bad:
Good:
Note:
isinstance()
checks fordict
,list
, andstr
types will fail when using the corresponding User class. If you need to pass customdict
orlist
objects to code you don't control, ignore this check. If you do control the code, consider using the following type checks instead:dict
->collections.abc.MutableMapping
list
->collections.abc.MutableSequence
str
-> No such conversion existsRename
no-del
touse-clear
(FURB131)Read
dbe3126
for more info. In short, FURB131 will now detect both of the following snippets:Running Refurb:
What's Changed
no-subclass-builtin
check by @dosisod in https://github.com/dosisod/refurb/pull/324Full Changelog: dosisod/refurb@v1.28.0...v2.0.0
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.