Skip to main content

Linting dotenv files like a charm!

Project description

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.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


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.7.0.tar.gz (14.0 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.7.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dotenv_linter-0.7.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.11.9 Darwin/23.5.0

File hashes

Hashes for dotenv_linter-0.7.0.tar.gz
Algorithm Hash digest
SHA256 24ed93c1028d6305d6787e51773badf3346e53012ad4f5ada9cf747d2da6de13
MD5 2c35a25035c7d8b4339f9767dbc7a636
BLAKE2b-256 1ee5515ca4e069b70ba0be477ab0a193855c08066f9ef1a9350dcfbdc8f12f87

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dotenv_linter-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.11.9 Darwin/23.5.0

File hashes

Hashes for dotenv_linter-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ffdf0c7435bd638aba5ff6cc9ea53bf093488bf1c722e363e902008659bb1fb
MD5 73de1fb89f3cc7dc10c7d9a5d6e2ad15
BLAKE2b-256 6e5ee26881b8d6bd6498c1a7225fba8ead3626a9f4b2d7d29dd272a875753d0d

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 Pingdom Monitoring Sentry Error logging StatusPage Status page