Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refurb] Implement type-none-comparison (FURB169) #8487

Merged
merged 6 commits into from
Nov 6, 2023

Conversation

tjkuson
Copy link
Contributor

@tjkuson tjkuson commented Nov 4, 2023

Summary

Implement no-is-type-none as type-none-comparison (FURB169).

Auto-fixes comparisons that use type to compare the type of an object to type(None) to a None identity check. For example,

type(foo) is type(None)

becomes

foo is None

Related to #1348.

Test Plan

cargo test

@tjkuson tjkuson changed the title Implement rule [refurb] Implement type-none-comparison (FURB169) Nov 4, 2023
Copy link
Contributor

github-actions bot commented Nov 4, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@tjkuson tjkuson marked this pull request as ready for review November 4, 2023 15:15
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, thanks!

@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Nov 5, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) November 5, 2023 19:55
@charliermarsh charliermarsh merged commit de2d7e9 into astral-sh:main Nov 6, 2023
16 checks passed
@tjkuson tjkuson deleted the type-none-comparison branch November 6, 2023 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants