[pyupgrade] Remove non-pep604-isinstance (UP038) (#19156)

## Summary
This PR Removes deprecated UP038 as per instructed in #18727 
closes #18727 
## Test Plan
I have run tests non of them failing 

One Question i have is do we have to document that UP038 is removed?

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
This commit is contained in:
हिमांशु 2025-09-05 19:38:04 +05:30 committed by Brent Westbrook
parent d8e43bf9f7
commit 3dbdd2b883
4 changed files with 3 additions and 7 deletions

View file

@ -563,7 +563,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
(Pyupgrade, "035") => (RuleGroup::Stable, rules::pyupgrade::rules::DeprecatedImport),
(Pyupgrade, "036") => (RuleGroup::Stable, rules::pyupgrade::rules::OutdatedVersionBlock),
(Pyupgrade, "037") => (RuleGroup::Stable, rules::pyupgrade::rules::QuotedAnnotation),
(Pyupgrade, "038") => (RuleGroup::Deprecated, rules::pyupgrade::rules::NonPEP604Isinstance),
(Pyupgrade, "038") => (RuleGroup::Removed, rules::pyupgrade::rules::NonPEP604Isinstance),
(Pyupgrade, "039") => (RuleGroup::Stable, rules::pyupgrade::rules::UnnecessaryClassParentheses),
(Pyupgrade, "040") => (RuleGroup::Stable, rules::pyupgrade::rules::NonPEP695TypeAlias),
(Pyupgrade, "041") => (RuleGroup::Stable, rules::pyupgrade::rules::TimeoutErrorAlias),

View file

@ -33,8 +33,8 @@ impl CallKind {
}
}
/// ## Deprecation
/// This rule was deprecated as using [PEP 604] syntax in `isinstance` and `issubclass` calls
/// ## Removed
/// This rule was removed as using [PEP 604] syntax in `isinstance` and `issubclass` calls
/// isn't recommended practice, and it incorrectly suggests that other typing syntaxes like [PEP 695]
/// would be supported by `isinstance` and `issubclass`. Using the [PEP 604] syntax
/// is also slightly slower.

View file

@ -62,9 +62,6 @@ ignore = [
# These are enforced by, or incompatible with, the ruff formatter:
"E203",
"E501",
# Makes code slower and more verbose
# https://github.com/astral-sh/ruff/issues/7871
"UP038",
]
unfixable = [
"F841", # unused variable. ruff keeps the call, but mostly it's best to get rid of it all

1
ruff.schema.json generated
View file

@ -4306,7 +4306,6 @@
"UP035",
"UP036",
"UP037",
"UP038",
"UP039",
"UP04",
"UP040",