Ruff
902 rules ruff@0.16.8
Complete effective rule inventory.
Rules
No enabled Ruff rules match this search.
-
PLW0642Reassigned
{}variable in {method_type} method -
PLW0711Exception to catch is the result of a binary
andoperation -
PLW0717Try clause contains too many statements ({statements} > {max_statements})
-
PLW1501{mode}is not a valid mode foropen -
PLW1507Shallow copy of
os.environviacopy.copy(os.environ) -
PLW1508Invalid type for environment variable default; expected
strorNone -
PLW1509preexec_fnargument is unsafe when using threads -
PLW1510subprocess.runwithout explicitcheckargument -
PLW1514{function_name}in text mode without explicitencodingargument -
PLW1641Object does not implement
__hash__method -
PLW2101Threading lock directly created in
withstatement has no effect -
PLW2901Outer {outer_kind} variable
{name}overwritten by inner {inner_kind} target -
PLW3201Dunder method
{name}has no special meaning in Python 3 -
PLW3301Nested
{func}calls can be flattened -
PT001Use
@pytest.fixture{expected}over@pytest.fixture{actual} -
PT002Configuration for fixture
{function}specified via positional args, use kwargs -
PT003scope='function'is implied in@pytest.fixture() -
PT006Wrong type passed to first argument of
pytest.mark.parametrize; expected {expected_string} -
PT007Wrong values type in
pytest.mark.parametrizeexpected{values} -
PT008Use
return_value=instead of patching withlambda -
PT009Use a regular
assertinstead of unittest-style{assertion} -
PT010Set the expected exception in
pytest.raises() -
PT011pytest.raises({exception})is too broad, set thematchparameter or use a more specific exception -
PT012pytest.raises()block should contain a single simple statement -
PT013Incorrect import of
pytest; useimport pytestinstead -
PT014Duplicate of test case at index {index} in
pytest.mark.parametrize -
PT015Assertion always fails, replace with
pytest.fail() -
PT016No message passed to
pytest.fail() -
PT017Found assertion on exception
{name}inexceptblock, usepytest.raises()instead -
PT018Assertion should be broken down into multiple parts
-
PT019Fixture
{name}without value is injected as parameter, use@pytest.mark.usefixturesinstead -
PT020@pytest.yield_fixtureis deprecated, use@pytest.fixture -
PT021Use
yieldinstead ofrequest.addfinalizer -
PT022No teardown in fixture
{name}, usereturninstead ofyield -
PT023Use
@pytest.mark.{mark_name}{expected_parens}over@pytest.mark.{mark_name}{actual_parens} -
PT024pytest.mark.asynciois unnecessary for fixtures -
PT025pytest.mark.usefixtureshas no effect on fixtures -
PT026Useless
pytest.mark.usefixtureswithout parameters -
PT027Use
pytest.raisesinstead of unittest-style{assertion} -
PT028Test function parameter
{}has default argument