Skip to content

Ruff

902 rules ruff@0.16.8

Complete effective rule inventory.

Docs

Rules

40 rules on this page · 902 total

  • RUF061

    Use context-manager form of pytest.{}()

    Some reports are autofixable
  • RUF063

    Use {suggestion} instead of __dict__ access

    No autofix
  • RUF064

    Non-octal mode

    Some reports are autofixable
  • RUF065

    Unnecessary oct() conversion when formatting with %s. Use %#o instead of %s

    No autofix
  • RUF066

    {name} is a property without a return statement

    No autofix
  • RUF067

    __init__ module should not contain any code

    No autofix
  • RUF069

    Unreliable floating point equality comparison {left} {operator} {right}

    No autofix
  • RUF070

    Unnecessary assignment to {name} before yield from statement

    Always autofixable
  • RUF071

    os.path.commonprefix() compares strings character-by-character

    Some reports are autofixable
  • RUF072

    Empty finally clause

    Some reports are autofixable
  • RUF073

    % operator used on an f-string

    No autofix
  • RUF074

    @{outer_decorator} should be placed after @{inner_decorator}

    No autofix
  • RUF075

    Context manager does not catch exceptions

    No autofix
  • RUF077

    Receiver parameter should not have a default value

    Always autofixable
  • RUF100

    Unused {}

    Always autofixable
  • RUF101

    {original} is a redirect to {target}

    Always autofixable
  • RUF102

    Invalid rule code in {}: {}

    Always autofixable
  • RUF103

    Invalid suppression comment: {msg}

    Always autofixable
  • RUF104

    Suppression comment without matching #ruff:enable comment

    No autofix
  • RUF105

    noqa comment used instead of ruff: ignore

    Some reports are autofixable
  • RUF106

    Rule code used instead of name in suppression comment

    Always autofixable
  • RUF200

    Failed to parse pyproject.toml: {message}

    No autofix
  • RUF201

    Rule code used instead of name in lint.{selector}

    Always autofixable
  • S101

    Use of assert detected

    No autofix
  • S102

    Use of exec detected

    No autofix
  • S103

    os.chmod setting a permissive mask {mask:#o} on file or directory

    No autofix
  • S104

    Possible binding to all interfaces

    No autofix
  • S105

    Possible hardcoded password assigned to: "{}"

    No autofix
  • S106

    Possible hardcoded password assigned to argument: "{}"

    No autofix
  • S107

    Possible hardcoded password assigned to function default: "{}"

    No autofix
  • S108

    Probable insecure usage of temporary file or directory: "{}"

    No autofix
  • S110

    try-except-pass detected, consider logging the exception

    No autofix
  • S112

    try-except-continue detected, consider logging the exception

    No autofix
  • S113

    Probable use of {module} call without timeout

    No autofix
  • S201

    Use of debug=True in Flask app detected

    No autofix
  • S202

    Uses of tarfile.extractall()

    No autofix
  • S301

    pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue

    No autofix
  • S302

    Deserialization with the marshal module is possibly dangerous

    No autofix
  • S303

    Use of insecure MD2, MD4, MD5, or SHA1 hash function

    No autofix
  • S304

    Use of insecure cipher, replace with a known secure cipher such as AES

    No autofix