mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
[refurb
] Implement isinstance-type-none
(FURB168
) (#8308)
## Summary Implement [`no-isinstance-type-none`](https://github.com/dosisod/refurb/blob/master/refurb/checks/builtin/no_isinstance_type_none.py) as `isinstance-type-none` (`FURB168`). Auto-fixes calls to `isinstance` to check if an object is `None` to a `None` identity check. For example, ```python isinstance(foo, type(None)) ``` becomes ```python foo is None ``` Related to #1348. ## Test Plan `cargo test` --------- Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
parent
a151e50ad3
commit
10a50bf1e2
9 changed files with 368 additions and 0 deletions
|
@ -1134,6 +1134,7 @@ mod tests {
|
|||
Rule::AssignmentInAssert,
|
||||
Rule::DirectLoggerInstantiation,
|
||||
Rule::InvalidGetLoggerArgument,
|
||||
Rule::IsinstanceTypeNone,
|
||||
Rule::ManualDictComprehension,
|
||||
Rule::ReimplementedStarmap,
|
||||
Rule::SliceCopy,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue