Skip to main content

Linting dotenv files like a charm!

Project description

dotenv-linter

wemake.services Build Status 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.5.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

dotenv_linter-0.5.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dotenv_linter-0.5.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.11.5 Darwin/23.0.0

File hashes

Hashes for dotenv_linter-0.5.0.tar.gz
Algorithm Hash digest
SHA256 4862a8393e5ecdfb32982f1b32dbc006fff969a7b3c8608ba7db536108beeaea
MD5 79dcb18d58d22902363603db69513095
BLAKE2b-256 effe77e184ccc312f6263cbcc48a9579eec99f5c7ff72a9b1bd7812cafc22bbb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dotenv_linter-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.11.5 Darwin/23.0.0

File hashes

Hashes for dotenv_linter-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd01cca7f2140cb1710f49cbc1bf0e62397a75a6f0522d26a8b9b2331143c8bd
MD5 3788785bb9dd05f12a5522ce3e06b5fe
BLAKE2b-256 f00162ed4374340e6cf17c5084828974d96db8085e4018439ac41dc3cbbbcab3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page