Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion changelogs/0.1.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ _New rules are added in [preview](https://docs.astral.sh/ruff/preview/)._
- Default to following the system dark/light mode ([#7888](https://github.com/astral-sh/ruff/pull/7888))
- Add documentation for fixes ([#7901](https://github.com/astral-sh/ruff/pull/7901))
- Fix typo in docs of `PLR6301` ([#7831](https://github.com/astral-sh/ruff/pull/7831))
- Update `UP038` docs to note that it results in slower code ([#7872](https://github.com/astral-sh/ruff/pull/7872))
- crlf -> cr-lf ([#7766](https://github.com/astral-sh/ruff/pull/7766))
- Add an example of an unsafe fix ([#7924](https://github.com/astral-sh/ruff/pull/7924))
- Fix documented examples for `unnecessary-subscript-reversal` ([#7774](https://github.com/astral-sh/ruff/pull/7774))
Expand Down
1 change: 0 additions & 1 deletion changelogs/0.10.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ See also, the "Remapped rules" section which may result in disabled rules.

The following rules have been deprecated:

- [`non-pep604-isinstance`](https://docs.astral.sh/ruff/rules/non-pep604-isinstance/) (`UP038`)
- [`suspicious-xmle-tree-usage`](https://docs.astral.sh/ruff/rules/suspicious-xmle-tree-usage/) (`S320`)

### Remapped rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
isinstance(1, int | float) # OK
issubclass("yes", int | str) # OK
isinstance(1, ()) # OK
isinstance(1, (int, *(str, bytes))) # OK
isinstance(1, (int, *(str, bytes))) # OK
2 changes: 1 addition & 1 deletion crates/ruff_linter/src/codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ UP038.py:2:1: UP038 [*] Use `X | Y` in `issubclass` call instead of `(X, Y)`
2 |+issubclass("yes", int | float | str) # UP038
3 3 |
4 4 | isinstance(1, int) # OK
5 5 | issubclass("yes", int) # OK
5 5 | issubclass("yes", int) # OK
3 changes: 0 additions & 3 deletions python/py-fuzzer/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion ruff.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading