Skip to content

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

Merged
charliermarsh merged 6 commits intoastral-sh:mainfrom
tjkuson:type-none-comparison
Nov 6, 2023
Merged

[refurb] Implement type-none-comparison (FURB169)#8487
charliermarsh merged 6 commits intoastral-sh:mainfrom
tjkuson:type-none-comparison

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
@github-actions
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
@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