Severity: Error | Category: Linting
Detects when the same key is defined multiple times in a single .env file.
Duplicate keys create ambiguity:
DATABASE_URL=postgres://localhost:5432/db
DATABASE_URL=postgres://prod-server:5432/db
DATABASE_URL=postgres://prod-server:5432/db
$ envcheck lint .env
.env:5: E001: Duplicate key: DATABASE_URL (first defined at line 3)
The fix command cannot automatically resolve duplicate keys (requires manual decision).
$ envcheck fix .env
⚠ E001: Duplicate keys must be resolved manually:
- DATABASE_URL at lines 3, 5
# .envcheckrc.yaml
rules:
E001:
severity: error # Can downgrade to warning if needed
auto_fix: false # Always false for this rule