-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
cliRelated to the command-line interfaceRelated to the command-line interfacehelp wantedContributions especially welcomeContributions especially welcome
Milestone
Description
Summary
My case - was trying out Ruff and enabled UP
. Going through the log of found errors, I've found that UP038 from my point of view seems unreasonable, checking the documentation I've found that it's actually deprecated and will be removed soon.
A suggestion - ruff check
to warn that found error is related to a deprecated rule, so it will be possible to find deprecated rules just by using ruff
, without checking documentation. This would improve rule deprecation discoverability.
(I'm hope I'm not missing some option that already does that, but couldn't find anything related in https://docs.astral.sh/ruff/settings/)
a = 25
print(isinstance(25, (str, int)))
# ruff check L:\1_test.py --select UP --target-version py311
# UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)`
# |
# 2 | a = 25
# 3 | print(isinstance(25, (str, int)))
# | ^^^^^^^^^^^^^^^^^^^^^^^^^^ UP038
# |
# = help: Convert to `X | Y`
#
# Found 1 error.
# No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).
Avasam, mscheifer and LoicRiegel
Metadata
Metadata
Assignees
Labels
cliRelated to the command-line interfaceRelated to the command-line interfacehelp wantedContributions especially welcomeContributions especially welcome