rules:
- id: no-strings-as-booleans
  message: >-
    Using strings as booleans in Python has unexpected results.
    `"one" and "two"` will return "two".
    `"one" or "two"` will return "one".
    In Python, strings are truthy, and strings with a non-zero length evaluate to
    True.
  languages: [python]
  severity: ERROR
  pattern-either:
  - pattern: |
      if <... "..." and ... ...>:
          ...
  - pattern: |
      if <... "..." or ... ...>:
          ...
  - patterns:
    - pattern-not: |
        if $X in "...":
          ...
    - pattern: |
        if "...":
            ...
  metadata:
    category: correctness
    technology:
    - python
