dotenv-linter
Simple linter for .env
files.
While .env
files are very simple it is required to keep them consistent.
This tool offers a wide range of consistency rules and best practices.
And it integrates perfectly to any existing workflow.
Read the announcing post.
Installation and usage
pip install dotenv-linter
And then run it:
dotenv-linter .env .env.template
See Usage
section for more information.
Examples
There are many things that can go wrong in your .env
files:
SPACED=
KEY = VALUE
SECRET="my value"
SECRET=Already defined
kebab-case-name=1
snake_case_name=2
And much more! You can find the full list of violations in our docs.
Pre-commit hooks
dotenv-linter
can also be used as a pre-commit hook.
To do so, add the following to the .pre-commit-config.yaml
file at the root of your project:
repos:
- repo: https://github.com/wemake-services/dotenv-linter
rev: 0.2.0
hooks:
- id: dotenv-linter
For the more detailed instructions on the pre-commit tool itself,
please refer to its website.
Gratis
Special thanks goes to Ignacio Toledo
for creating an awesome logo for the project.