Skip to main content

dotenv-linter

wemake.services test codecov Github Action Python Version Documentation Status


Simple linter for .env files.

dotenv-logo

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dotenv_linter-0.9.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dotenv_linter-0.9.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file dotenv_linter-0.9.0.tar.gz.

File metadata

  • Download URL: dotenv_linter-0.9.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.9 Darwin/24.6.0

File hashes

Hashes for dotenv_linter-0.9.0.tar.gz
Algorithm Hash digest
SHA256 2adf8f6d1e70cbb6faca2240926960e5cfcc450c3fdb8bd2da345fbc52bcfa8d
MD5 e0629d0c26ba57560252bc2aacec7d32
BLAKE2b-256 2254bb420b27c943d2ed2df82a5341a3ad687b029072e150e30efcf97eadbb15

See more details on using hashes here.

File details

Details for the file dotenv_linter-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: dotenv_linter-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.9 Darwin/24.6.0

File hashes

Hashes for dotenv_linter-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e04c9a9d77dc3d36765d8d06d5131eb15f6177640e07ed9bc857262fa2c64e1
MD5 847ffd78fe69fb9e3eba35da01dba89c
BLAKE2b-256 0cd7e1349cd3d04e8eb6392e5122ce85f9795017ff16685de5b0d36b567d459e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page