Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork154
⚡️Lightning-fast linter for .env files. Written in Rust 🦀
License
dotenv-linter/dotenv-linter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
dotenv-linter
cancheck /fix /compare.env
files for problems that may cause the application to malfunction.
Available checks:
✅ Duplicated key
✅ Ending blank line
✅ Extra blank line
✅ Incorrect delimiter
✅ Key without value
✅ Leading character
✅ Lowercase key
✅ Quote character
✅ Space character
✅ Substitution key
✅ Trailing whitespace
✅ Unordered key
✅ Value without quotes
What is a.env
file?
💡 A.env
file ordotenv
file is a simple text file containing all the environment variables of a project.
Storingconfiguration in the environment variables is one of the tenets of theManifesto of Twelve-Factor App.
The.env
file has a simple key-value format, for example:FOO=BAR
.
More information you can find in articles inEnglish andRussian.
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 withreviewdog and other CI services (includingGitHub Actions andSuper-Linter) 🔥
Articles about dotenv-linter:
- [EN]Dotenv-linter: looking after the environment for you
- [EN]What's new in dotenv-linter v2.2.0?
- [EN]What are the key changes in dotenv-linter v3.0.0 release?
- [RU]Dotenv-linter: линтер .env файлов
- [RU]Что нового в dotenv-linter v2.2.1?
- [RU]Что нового в dotenv-linter v3.0.0?
# 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# Or a shorter way$ curl -sSfL https://git.io/JLbXn| sh -s# Specify installation directory and version$ curl -sSfL https://git.io/JLbXn| sh -s -- -b usr/local/bin v2.0.0# Alpine Linux (using wget)$ wget -q -O - https://git.io/JLbXn| 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-linterChecking .env.env:2 DuplicatedKey: The FOO key is duplicated.env:3 UnorderedKey: The BAR key should go before the FOO keyChecking .env.test.env.test:1 LeadingCharacter: Invalid leading character detectedFound 3 problems
It can also fix the found warnings with thefix
command:
$ dotenv-linter fixFixing .envOriginal file was backed up to:".env_1601378896".env:2 DuplicatedKey: The BAR key is duplicated.env:3 LowercaseKey: The foo key should bein uppercaseAll warnings are fixed. Total: 2
In addition,dotenv-linter
can compare.env
files with each other and output the difference between them:
$ dotenv-linter compare .env .env.exampleComparing .envComparing .env.example.env is missing keys: BAR.env.example is missing keys: FOO
Other use cases you can find on the documentation site (https://dotenv-linter.github.io):
dotenv-linter
can also be used with CI services such as:GitHub Actions andCircle CI.
Benchmarkingdotenv-linter/dotenv-linter andwemake-services/dotenv-linter has done using thehyperfine utility:
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
dotenv-linter/dotenv-linter .env | 2.7 ± 0.4 | 2.0 | 4.3 | 1.00 |
wemake-services/dotenv-linter .env | 162.6 ± 12.1 | 153.0 | 201.3 | 60.83 ± 10.20 |
Content of.env
file used for benchmarking
SPACED=KEY=VALUESECRET="my value"SECRET=Already definedkebab-case-name=1snake_case_name=2
dotenv-linter
is not just a linter for.env
files — it is also acontributor-friendly open-source project with the purpose of helping others learn Rust using a simple, but useful tool. 😊
In addition to studying Rust, this project has another goal — topromote love for open-source, help you with the first steps in it and give an opportunity to contribute to the open-source project written in Rust. ❤️
We actas a mentor within this project andhelp developers follow the path of a novice contributor from start to the top. 🤗
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].
dotenv-linter is created & supported byEvrone. What else we develop withRust.
Become a financial contributor and help us sustain our community.
About
⚡️Lightning-fast linter for .env files. Written in Rust 🦀
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.