mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:14:52 +00:00
[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:
parent
d8e43bf9f7
commit
3dbdd2b883
4 changed files with 3 additions and 7 deletions
|
@ -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, "035") => (RuleGroup::Stable, rules::pyupgrade::rules::DeprecatedImport),
|
||||||
(Pyupgrade, "036") => (RuleGroup::Stable, rules::pyupgrade::rules::OutdatedVersionBlock),
|
(Pyupgrade, "036") => (RuleGroup::Stable, rules::pyupgrade::rules::OutdatedVersionBlock),
|
||||||
(Pyupgrade, "037") => (RuleGroup::Stable, rules::pyupgrade::rules::QuotedAnnotation),
|
(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, "039") => (RuleGroup::Stable, rules::pyupgrade::rules::UnnecessaryClassParentheses),
|
||||||
(Pyupgrade, "040") => (RuleGroup::Stable, rules::pyupgrade::rules::NonPEP695TypeAlias),
|
(Pyupgrade, "040") => (RuleGroup::Stable, rules::pyupgrade::rules::NonPEP695TypeAlias),
|
||||||
(Pyupgrade, "041") => (RuleGroup::Stable, rules::pyupgrade::rules::TimeoutErrorAlias),
|
(Pyupgrade, "041") => (RuleGroup::Stable, rules::pyupgrade::rules::TimeoutErrorAlias),
|
||||||
|
|
|
@ -33,8 +33,8 @@ impl CallKind {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ## Deprecation
|
/// ## Removed
|
||||||
/// This rule was deprecated as using [PEP 604] syntax in `isinstance` and `issubclass` calls
|
/// 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]
|
/// 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
|
/// would be supported by `isinstance` and `issubclass`. Using the [PEP 604] syntax
|
||||||
/// is also slightly slower.
|
/// is also slightly slower.
|
||||||
|
|
|
@ -62,9 +62,6 @@ ignore = [
|
||||||
# These are enforced by, or incompatible with, the ruff formatter:
|
# These are enforced by, or incompatible with, the ruff formatter:
|
||||||
"E203",
|
"E203",
|
||||||
"E501",
|
"E501",
|
||||||
# Makes code slower and more verbose
|
|
||||||
# https://github.com/astral-sh/ruff/issues/7871
|
|
||||||
"UP038",
|
|
||||||
]
|
]
|
||||||
unfixable = [
|
unfixable = [
|
||||||
"F841", # unused variable. ruff keeps the call, but mostly it's best to get rid of it all
|
"F841", # unused variable. ruff keeps the call, but mostly it's best to get rid of it all
|
||||||
|
|
1
ruff.schema.json
generated
1
ruff.schema.json
generated
|
@ -4306,7 +4306,6 @@
|
||||||
"UP035",
|
"UP035",
|
||||||
"UP036",
|
"UP036",
|
||||||
"UP037",
|
"UP037",
|
||||||
"UP038",
|
|
||||||
"UP039",
|
"UP039",
|
||||||
"UP04",
|
"UP04",
|
||||||
"UP040",
|
"UP040",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue