---
source: crates/ruff/src/rules/pylint/mod.rs
---
invalid_envvar_default.py:3:29: PLW1508 Invalid type for environment variable default; expected `str` or `None`
  |
3 | import os
4 | 
5 | tempVar = os.getenv("TEST", 12)  # [invalid-envvar-default]
  |                             ^^ PLW1508
6 | goodVar = os.getenv("TESTING", None)
7 | dictVarBad = os.getenv("AAA", {"a", 7})  # [invalid-envvar-default]
  |

invalid_envvar_default.py:5:31: PLW1508 Invalid type for environment variable default; expected `str` or `None`
  |
5 | tempVar = os.getenv("TEST", 12)  # [invalid-envvar-default]
6 | goodVar = os.getenv("TESTING", None)
7 | dictVarBad = os.getenv("AAA", {"a", 7})  # [invalid-envvar-default]
  |                               ^^^^^^^^ PLW1508
8 | print(os.getenv("TEST", False))  # [invalid-envvar-default]
9 | os.getenv("AA", "GOOD")
  |

invalid_envvar_default.py:6:25: PLW1508 Invalid type for environment variable default; expected `str` or `None`
   |
 6 | goodVar = os.getenv("TESTING", None)
 7 | dictVarBad = os.getenv("AAA", {"a", 7})  # [invalid-envvar-default]
 8 | print(os.getenv("TEST", False))  # [invalid-envvar-default]
   |                         ^^^^^ PLW1508
 9 | os.getenv("AA", "GOOD")
10 | os.getenv("AA", f"GOOD")
   |

invalid_envvar_default.py:10:17: PLW1508 Invalid type for environment variable default; expected `str` or `None`
   |
10 | os.getenv("AA", f"GOOD")
11 | os.getenv("AA", "GOOD" + "BAD")
12 | os.getenv("AA", "GOOD" + 1)
   |                 ^^^^^^^^^^ PLW1508
13 | os.getenv("AA", "GOOD %s" % "BAD")
14 | os.getenv("B", Z)
   |


