Skip to content

Conversation

tjkuson
Copy link
Contributor

@tjkuson tjkuson commented Oct 28, 2023

Summary

Implement no-isinstance-type-none as isinstance-type-none (FURB168).

Auto-fixes calls to isinstance to check if an object is None to a None identity check. For example,

isinstance(foo, type(None))

becomes

foo is None

Related to #1348.

Test Plan

cargo test

@tjkuson tjkuson marked this pull request as ready for review October 28, 2023 16:17
@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no linter changes.

@charliermarsh charliermarsh self-assigned this Oct 28, 2023
@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Oct 28, 2023
Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great -- thank you!

@charliermarsh charliermarsh enabled auto-merge (squash) October 28, 2023 22:34
@charliermarsh charliermarsh merged commit 10a50bf into astral-sh:main Oct 28, 2023
@tjkuson tjkuson deleted the isinstance-type-none branch October 30, 2023 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants