Rewrite `os.environ.get` as `os.getenv`
Open
needs-decision
rule
- Dominant language
- Rust
- Stars
- 49.7k
- Forks
- 2.4k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 458
Description
**Bad**
```py
os.environ.get(secret)
os.environ.get(secret, "fallback")
```
**Good**
```py
os.getenv(secret)
os.getenv(secret, "fallback")
```
Contributor guide
Research direction
Start by locating Ruff's implementation and tests for rules that rewrite Python expressions involving os.environ. Verify how the rule recognizes both one-argument and fallback forms shown in the issue, and confirm that the resulting code uses os.getenv with equivalent arguments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100