Ruff
902 rules ruff@0.16.8
Complete effective rule inventory.
Rules
No enabled Ruff rules match this search.
-
ASYNC210Async functions should not call blocking HTTP methods
-
ASYNC212Blocking httpx method {name}.{call}() in async context, use httpx.AsyncClient
-
ASYNC220Async functions should not create subprocesses with blocking methods
-
ASYNC221Async functions should not run processes with blocking methods
-
ASYNC222Async functions should not wait on processes with blocking methods
-
ASYNC230Async functions should not open files with blocking methods like
open -
ASYNC240Async functions should not perform blocking {path_library} operations
-
ASYNC250Blocking call to
input()in async context -
ASYNC251Async functions should not call
time.sleep -
B002Python does not support the unary prefix increment operator (
++) -
B003Assigning to
os.environdoesn't clear the environment -
B004Using
hasattr(x, "__call__")to test if x is callable is unreliable. Usecallable(x)for consistent results. -
B005Using
.strip()with multi-character strings is misleading -
B006Do not use mutable data structures for argument defaults
-
B007Loop control variable
{name}not used within loop body -
B008Do not perform function call
{name}in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable -
B009Do not call
getattrwith a constant attribute value. It is not any safer than normal property access. -
B010Do not call
setattrwith a constant attribute value. It is not any safer than normal property access. -
B011Do not
assert False(python -Oremoves these calls), raiseAssertionError() -
B012{name}insidefinallyblocks cause exceptions to be silenced -
B013A length-one tuple literal is redundant in exception handlers
-
B014Exception handler with duplicate exception:
{name} -
B015Pointless comparison. Did you mean to assign a value? Otherwise, prepend
assertor remove it. -
B016Cannot raise a literal. Did you intend to return it or raise an Exception?
-
B017Do not assert blind exception:
{exception} -
B018Found useless expression. Either assign it to a variable or remove it.
-
B019Use of
functools.lru_cacheorfunctools.cacheon methods can lead to memory leaks -
B020Loop control variable
{name}overrides iterable it iterates -
B021f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
-
B022No arguments passed to
contextlib.suppress. No exceptions will be suppressed and therefore this context manager is redundant -
B023Function definition does not bind loop variable
{name} -
B024{name}is an abstract base class, but it has no abstract methods or properties -
B025try-except* block with duplicate exception
{name} -
B026Star-arg unpacking after a keyword argument is strongly discouraged
-
B027{name}is an empty method in an abstract base class, but has no abstract decorator -
B028No explicit
stacklevelkeyword argument found -
B029Using
except* ():with an empty tuple does not catch anything; add exceptions to handle -
B030except*handlers should only be exception classes or tuples of exception classes -
B031Using the generator returned from
itertools.groupby()more than once will do nothing on the second usage -
B032Possible unintentional type annotation (using
:). Did you mean to assign (using=)?