Linting dotenv files like a charm!
Project description
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.2.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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dotenv-linter-0.2.0.tar.gz
.
File metadata
- Download URL: dotenv-linter-0.2.0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Darwin/18.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c99b981966450e48007b92547ed8e16355ec88f1dac5494a4576440546467cf7 |
|
MD5 | d3ddd4187abdc4aacc5c0a3e681d0005 |
|
BLAKE2b-256 | d247f791b1ad6ea881255daafc62afb6cf58758194cc99b2597bccd3eae98ae9 |
File details
Details for the file dotenv_linter-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: dotenv_linter-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Darwin/18.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 536992ef6f6bf803e58e2984cf428486491059ca750b13bd9eb6b5186110709a |
|
MD5 | e8a1c75b3475983cf7f9c7519412d0ef |
|
BLAKE2b-256 | e4fed62837f38dabd38f4200f0b6f5f0f9ed7f22dac8e200889725e0a5059df0 |