[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:
Tom Kuson 2023-10-28 23:37:02 +01:00 committed by GitHub
parent a151e50ad3
commit 10a50bf1e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 368 additions and 0 deletions

View file

@ -1134,6 +1134,7 @@ mod tests {
Rule::AssignmentInAssert,
Rule::DirectLoggerInstantiation,
Rule::InvalidGetLoggerArgument,
Rule::IsinstanceTypeNone,
Rule::ManualDictComprehension,
Rule::ReimplementedStarmap,
Rule::SliceCopy,