---
source: crates/ruff/src/rules/flake8_simplify/mod.rs
---
SIM112.py:4:12: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo`
  |
4 | # Bad
5 | os.environ['foo']
  |            ^^^^^ SIM112
6 | 
7 | os.environ.get('foo')
  |
  = help: Replace `foo` with `FOO`

ℹ Suggested fix
1 1 | import os
2 2 | 
3 3 | # Bad
4   |-os.environ['foo']
  4 |+os.environ['FOO']
5 5 | 
6 6 | os.environ.get('foo')
7 7 | 

SIM112.py:6:16: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo`
   |
 6 | os.environ['foo']
 7 | 
 8 | os.environ.get('foo')
   |                ^^^^^ SIM112
 9 | 
10 | os.environ.get('foo', 'bar')
   |
   = help: Replace `foo` with `FOO`

SIM112.py:8:16: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo`
   |
 8 | os.environ.get('foo')
 9 | 
10 | os.environ.get('foo', 'bar')
   |                ^^^^^ SIM112
11 | 
12 | os.getenv('foo')
   |
   = help: Replace `foo` with `FOO`

SIM112.py:10:11: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo`
   |
10 | os.environ.get('foo', 'bar')
11 | 
12 | os.getenv('foo')
   |           ^^^^^ SIM112
13 | 
14 | env = os.environ.get('foo')
   |
   = help: Replace `foo` with `FOO`

SIM112.py:12:22: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo`
   |
12 | os.getenv('foo')
13 | 
14 | env = os.environ.get('foo')
   |                      ^^^^^ SIM112
15 | 
16 | env = os.environ['foo']
   |
   = help: Replace `foo` with `FOO`

SIM112.py:14:18: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo`
   |
14 | env = os.environ.get('foo')
15 | 
16 | env = os.environ['foo']
   |                  ^^^^^ SIM112
17 | 
18 | if env := os.environ.get('foo'):
   |
   = help: Replace `foo` with `FOO`

ℹ Suggested fix
11 11 | 
12 12 | env = os.environ.get('foo')
13 13 | 
14    |-env = os.environ['foo']
   14 |+env = os.environ['FOO']
15 15 | 
16 16 | if env := os.environ.get('foo'):
17 17 |     pass

SIM112.py:16:26: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo`
   |
16 | env = os.environ['foo']
17 | 
18 | if env := os.environ.get('foo'):
   |                          ^^^^^ SIM112
19 |     pass
   |
   = help: Replace `foo` with `FOO`

SIM112.py:19:22: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo`
   |
19 |     pass
20 | 
21 | if env := os.environ['foo']:
   |                      ^^^^^ SIM112
22 |     pass
   |
   = help: Replace `foo` with `FOO`

ℹ Suggested fix
16 16 | if env := os.environ.get('foo'):
17 17 |     pass
18 18 | 
19    |-if env := os.environ['foo']:
   19 |+if env := os.environ['FOO']:
20 20 |     pass
21 21 | 
22 22 | 


