Ruff
903 rules ruff@0.17.0
Complete effective rule inventory.
Rules
No enabled Ruff rules match this search.
-
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=)? -
B033Sets should not contain duplicate item
{value} -
B034{method}should pass{param_name}andflagsas keyword arguments to avoid confusion due to unintuitive argument positions -
B035Dictionary comprehension uses static key:
{key} -
B039Do not use mutable data structures for
ContextVardefaults -
B043Do not call
delattrwith a constant attribute value. It is not any safer than normal property deletion. -
B901Using
yieldandreturn {value}in a generator function can lead to confusing behavior -
B903Class could be dataclass or namedtuple
-
B904Within an
except*clause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling -
B905zip()without an explicitstrict=parameter -
B909Mutation to loop iterable
{name}during iteration -
B911itertools.batched()without an explicitstrictparameter -
B912map()without an explicitstrict=parameter -
BLE001Do not catch blind exception:
{name} -
C400Unnecessary generator (rewrite using
list()) -
C401Unnecessary generator (rewrite using
set()) -
C402Unnecessary generator (rewrite as a dict comprehension)