Skip to content

Commit 3dbdd2b

Browse files
CodeMan62AlexWaygoodntBre
committed
[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>
1 parent d8e43bf commit 3dbdd2b

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

crates/ruff_linter/src/codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
563563
(Pyupgrade, "035") => (RuleGroup::Stable, rules::pyupgrade::rules::DeprecatedImport),
564564
(Pyupgrade, "036") => (RuleGroup::Stable, rules::pyupgrade::rules::OutdatedVersionBlock),
565565
(Pyupgrade, "037") => (RuleGroup::Stable, rules::pyupgrade::rules::QuotedAnnotation),
566-
(Pyupgrade, "038") => (RuleGroup::Deprecated, rules::pyupgrade::rules::NonPEP604Isinstance),
566+
(Pyupgrade, "038") => (RuleGroup::Removed, rules::pyupgrade::rules::NonPEP604Isinstance),
567567
(Pyupgrade, "039") => (RuleGroup::Stable, rules::pyupgrade::rules::UnnecessaryClassParentheses),
568568
(Pyupgrade, "040") => (RuleGroup::Stable, rules::pyupgrade::rules::NonPEP695TypeAlias),
569569
(Pyupgrade, "041") => (RuleGroup::Stable, rules::pyupgrade::rules::TimeoutErrorAlias),

crates/ruff_linter/src/rules/pyupgrade/rules/use_pep604_isinstance.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ impl CallKind {
3333
}
3434
}
3535

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

python/py-fuzzer/pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ ignore = [
6262
# These are enforced by, or incompatible with, the ruff formatter:
6363
"E203",
6464
"E501",
65-
# Makes code slower and more verbose
66-
# https://github.com/astral-sh/ruff/issues/7871
67-
"UP038",
6865
]
6966
unfixable = [
7067
"F841", # unused variable. ruff keeps the call, but mostly it's best to get rid of it all

ruff.schema.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)