It checks .env
files for problems that may cause the application to malfunction:
✅ Duplicated Key
✅ Ending Blank Line
✅ Extra Blank Line
✅ Incorrect delimiter
✅ Key without value
✅ Leading character
✅ Lowercase key
✅ Quote character
✅ Space character
✅ Trailing whitespace
✅ Unordered Key
And automatically fixes them all 😱
The key features:
⚡️ Lightning-fast because it is written in Rust 🦀
💣 Can be used on any project regardless of the programming language 💥
🚀 Can be integrated with reviewdog and other CI services (including GitHub Actions) 🔥
Articles about dotenv-linter:
Dotenv-linter is created & supported by Evrone. What else we develop with Rust.
# Linux / macOS / Windows (MINGW and etc). Installs it into ./bin/ by default
$ curl -sSfL https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s
# Specify installation directory and version
$ curl -sSfL https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s -- -b usr/local/bin v2.0.0
# Alpine Linux (wget)
$ wget -q -O - https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s
You can find other installation methods here: https://dotenv-linter.github.io/#/installation
By default, dotenv-linter
checks all .env
files in the current directory:
$ dotenv-linter
.env:2 DuplicatedKey: The FOO key is duplicated
.env:3 UnorderedKey: The BAR key should go before the FOO key
.env.test:1 LeadingCharacter: Invalid leading character detected
Found 3 problems
It can also fix found warnings. You should use the argument --fix
(or its short version -f
) for this:
$ dotenv-linter -f
Original file was backed up to: ".env_1601378896"
.env:2 DuplicatedKey: The BAR key is duplicated
.env:3 LowercaseKey: The foo key should be in uppercase
All warnings are fixed. Total: 2
Other use cases you can find here: https://dotenv-linter.github.io/#/usage
dotenv-linter
can also be used with CI services such as: GitHub Actions and Circle CI.
If you've ever wanted to contribute to open source, now you have a great opportunity:
- wemake-services/dotenv-linter (Python)
This project exists thanks to all the people who contribute. [Contribute].
Become a financial contributor and help us sustain our community.