Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wemake-services/dotenv-linter
:relaxed: Linting dotenv files like a charm!
https://github.com/wemake-services/dotenv-linter
code-quality dotenv dotenv-parser linter linting
Last synced: 5 days ago
JSON representation
:relaxed: Linting dotenv files like a charm!
- Host: GitHub
- URL: https://github.com/wemake-services/dotenv-linter
- Owner: wemake-services
- License: mit
- Created: 2018-11-30T16:03:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T07:32:21.000Z (7 months ago)
- Last Synced: 2024-04-14T07:11:39.143Z (7 months ago)
- Topics: code-quality, dotenv, dotenv-parser, linter, linting
- Language: Python
- Homepage: https://dotenv-linter.rtfd.io
- Size: 1.39 MB
- Stars: 270
- Watchers: 7
- Forks: 8
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Run dotenv-linter - Lints your .env files like a charm, with optional reviewdog output on the PR
- fucking-awesome-actions - Run dotenv-linter - Lints your .env files like a charm, with optional reviewdog output on the PR
- awesome-workflows - Run dotenv-linter - Lints your .env files like a charm, with optional reviewdog output on the PR
README
# dotenv-linter
[![wemake.services](https://img.shields.io/badge/%20-wemake.services-green.svg?label=%20&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC%2FxhBQAAAAFzUkdCAK7OHOkAAAAbUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP%2F%2F%2F5TvxDIAAAAIdFJOUwAjRA8xXANAL%2Bv0SAAAADNJREFUGNNjYCAIOJjRBdBFWMkVQeGzcHAwksJnAPPZGOGAASzPzAEHEGVsLExQwE7YswCb7AFZSF3bbAAAAABJRU5ErkJggg%3D%3D)](https://wemake-services.github.io)
[![test](https://github.com/wemake-services/dotenv-linter/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/wemake-services/dotenv-linter/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/wemake-services/dotenv-linter/branch/master/graph/badge.svg)](https://codecov.io/gh/wemake-services/dotenv-linter)
[![Github Action](https://github.com/wemake-services/dotenv-linter/workflows/dotenv/badge.svg)](https://github.com/wemake-services/dotenv-linter/actions?query=workflow%3Adotenv)
[![Python Version](https://img.shields.io/pypi/pyversions/dotenv-linter.svg)](https://pypi.org/project/dotenv-linter/)
[![Documentation Status](https://readthedocs.org/projects/dotenv-linter/badge/?version=latest)](https://dotenv-linter.readthedocs.io/en/latest/?badge=latest)---
Simple linter for `.env` files.
![dotenv-logo](https://raw.githubusercontent.com/wemake-services/dotenv-linter/master/docs/_static/[email protected])
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](https://sobolevn.me/2019/01/announcing-dotenv-linter).
## Installation and usage
```bash
pip install dotenv-linter
```And then run it:
```bash
dotenv-linter .env .env.template
```See [Usage](https://dotenv-linter.readthedocs.io/en/latest/#usage)
section for more information.## Examples
There are many things that can go wrong in your `.env` files:
```ini
# 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](https://dotenv-linter.readthedocs.io/en/latest/pages/violations/).
## Pre-commit hooks
`dotenv-linter` can also be used as a [pre-commit](https://github.com/pre-commit/pre-commit) hook.
To do so, add the following to the `.pre-commit-config.yaml` file at the root of your project:```yaml
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](https://pre-commit.com/).## Gratis
Special thanks goes to [Ignacio Toledo](https://ign.uy)
for creating an awesome logo for the project.