Skip to content

Ruff

902 rules ruff@0.16.8

Complete effective rule inventory.

Docs

Rules

40 rules on this page · 902 total

  • S602

    subprocess call with shell=True seems safe, but may be changed in the future; consider rewriting without shell

    No autofix
  • S603

    subprocess call: check for execution of untrusted input

    No autofix
  • S604

    Function call with shell=True parameter identified, security issue

    No autofix
  • S605

    Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without shell

    No autofix
  • S606

    Starting a process without a shell

    No autofix
  • S607

    Starting a process with a partial executable path

    No autofix
  • S608

    Possible SQL injection vector through string-based query construction

    No autofix
  • S609

    Possible wildcard injection in call due to * usage

    No autofix
  • S610

    Use of Django extra can lead to SQL injection vulnerabilities

    No autofix
  • S611

    Use of RawSQL can lead to SQL injection vulnerabilities

    No autofix
  • S612

    Use of insecure logging.config.listen detected

    No autofix
  • S701

    Using jinja2 templates with autoescape=False is dangerous and can lead to XSS. Ensure autoescape=True or use the select_autoescape function.

    No autofix
  • S702

    Mako templates allow HTML and JavaScript rendering by default and are inherently open to XSS attacks

    No autofix
  • S704

    Unsafe use of {name} detected

    No autofix
  • SIM101

    Multiple isinstance calls for {name}, merge into a single call

    Some reports are autofixable
  • SIM102

    Use a single if statement instead of nested if statements

    Some reports are autofixable
  • SIM103

    Return the condition {condition} directly

    Some reports are autofixable
  • SIM105

    Use contextlib.suppress({exception}) instead of try-except-pass

    Some reports are autofixable
  • SIM107

    Don't use return in try-except and finally

    No autofix
  • SIM108

    Use ternary operator {contents} instead of if-else-block

    Some reports are autofixable
  • SIM109

    Use {replacement} instead of multiple equality comparisons

    Always autofixable
  • SIM110

    Use {replacement} instead of for loop

    Some reports are autofixable
  • SIM112

    Use capitalized environment variable {expected} instead of {actual}

    Some reports are autofixable
  • SIM113

    Use enumerate() for index variable {index} in for loop

    No autofix
  • SIM114

    Combine if branches using logical or operator

    Some reports are autofixable
  • SIM115

    Use a context manager for opening files

    No autofix
  • SIM116

    Use a dictionary instead of consecutive if statements

    No autofix
  • SIM117

    Use a single with statement with multiple contexts instead of nested with statements

    Some reports are autofixable
  • SIM118

    Use key {operator} dict instead of key {operator} dict.keys()

    Always autofixable
  • SIM201

    Use {left} != {right} instead of not {left} == {right}

    Always autofixable
  • SIM202

    Use {left} == {right} instead of not {left} != {right}

    Always autofixable
  • SIM208

    Use {expr} instead of not (not {expr})

    Always autofixable
  • SIM210

    Remove unnecessary True if ... else False

    Some reports are autofixable
  • SIM211

    Use not ... instead of False if ... else True

    Always autofixable
  • SIM212

    Use {expr_else} if {expr_else} else {expr_body} instead of {expr_body} if not {expr_else} else {expr_else}

    Always autofixable
  • SIM220

    Use False instead of {name} and not {name}

    Always autofixable
  • SIM221

    Use True instead of {name} or not {name}

    Always autofixable
  • SIM222

    Use {expr} instead of {replaced}

    Always autofixable
  • SIM223

    Use {expr} instead of {replaced}

    Always autofixable
  • SIM300

    Yoda condition detected

    Some reports are autofixable