Dotenv Linter

0.7.0 · active · verified Fri Apr 17

dotenv-linter is a command-line utility for linting `.env` files, ensuring they adhere to best practices and common standards. It helps prevent syntax errors, enforce naming conventions, and identify issues like duplicate keys or incorrect line endings. The current version is `0.7.0`, with releases typically driven by new features, Python version support updates, and dependency upgrades.

Common errors

Warnings

Install

Quickstart

This quickstart demonstrates how to create a simple `.env` file and then lint it using the `dotenv-linter` command-line tool. It also shows an example with a duplicate key to illustrate how the linter identifies common issues.

echo 'APP_ENV=development
DATABASE_URL=postgres://localhost:5432/db
# This is a comment
' > .env
dotenv-linter .env

# Example with an error (duplicate key)
echo 'FOO=bar
FOO=baz' > .env_with_error
dotenv-linter .env_with_error

view raw JSON →