Checks your .env against .env.example, so a missing variable turns into a
lint error instead of a 3am incident.
$ envlint
.env:4: missing: STRIPE_KEY is declared in the example but not set
.env:7: empty: DB_PASSWORD is set to an empty value
.env:9: placeholder: API_KEY still holds the placeholder 'changeme'
3 problem(s)Exit code is 1 when something is wrong, 0 when the file is clean, 2 when a file is missing — so it drops straight into CI.
| Rule | What it catches |
|---|---|
missing |
key is in the example but not in your .env |
empty |
key is set to nothing |
duplicate |
the same key assigned twice |
placeholder |
value is still changeme, todo, xxx... |
extra |
key is not documented in the example (--strict) |
envlint # .env against .env.example
envlint config/.env --example config/.env.example
envlint --strict # also report undocumented keys
envlint --allow-empty DEBUG,PROXYrepos:
- repo: https://github.com/Flash-ware/envlint
rev: v0.2.0
hooks:
- id: envlintfrom envlint import lint
for problem in lint(".env", ".env.example", strict=True):
print(problem.format(".env"))MIT