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:
# Next line has leading space which will be removed:
SPACED=
# Equal signs should not be spaced:
KEY = VALUE
# Quotes won't be preserved after parsing, do not use them:
SECRET="my value"
# Beware of duplicate keys!
SECRET=Already defined ;(
# Respect the convention, use `UPPER_CASE`:
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.8.0 # Use the ref you want to point at
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.
Metadata
Release files for dotenv-linter 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dotenv_linter-0.9.0.tar.gz | 16.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dotenv_linter-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.0 kB
Release files / dotenv_linter-0.9.0.tar.gz
| Download URL | dotenv_linter-0.9.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2adf8f6d1e70cbb6faca2240926960e5cfcc450c3fdb8bd2da345fbc52bcfa8d
|
|
BLAKE2b-256 checksum How to use checksums |
2254bb420b27c943d2ed2df82a5341a3ad687b029072e150e30efcf97eadbb15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.9 Darwin/24.6.0
|
Release files / dotenv_linter-0.9.0-py3-none-any.whl
| Download URL | dotenv_linter-0.9.0-py3-none-any.whl |
|---|---|
| Size | 24.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e04c9a9d77dc3d36765d8d06d5131eb15f6177640e07ed9bc857262fa2c64e1
|
|
BLAKE2b-256 checksum How to use checksums |
0cd7e1349cd3d04e8eb6392e5122ce85f9795017ff16685de5b0d36b567d459e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.9 Darwin/24.6.0
|