It checks .env files for problems that may cause the application to malfunction:
✅Duplicated Key ✅Incorrect delimiter ✅Key without value ✅Leading character ✅Lowercase key ✅Quote character (Will be available in v2.0.0) ✅Space character ✅Unordered Key
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 alternatives and similar packages
Based on the "Code Analysis" category.
Alternatively, view dotenv-linter alternatives based on common mentions on social networks and blogs.
credo10.0 7.0 dotenv-linter VS credoA static code analysis tool for the Elixir language with a focus on code consistency and teaching.
dialyxir9.7 3.9 dotenv-linter VS dialyxirMix tasks to simplify use of Dialyzer in Elixir projects.
excoveralls9.4 8.3 dotenv-linter VS excoverallsCoverage report tool for Elixir with coveralls.io integration.
dogma9.0 0.0 dotenv-linter VS dogma:closed_lock_with_key: A code style linter for Elixir
ex_check7.8 10.0 dotenv-linter VS ex_checkOne task to efficiently run all code analysis & testing tools in an Elixir project. Born out of 💜 to Elixir and pragmatism.
DepViz7.2 0.0 dotenv-linter VS DepVizA visual tool to help developers understand Elixir recompilation in their projects
excellent_migrationsAn Elixir tool for checking safety of database migrations.
exprof7.1 0.0 dotenv-linter VS exprofA simple code profiler for Elixir using eprof.
coverex6.8 0.0 dotenv-linter VS coverexCoverage Reports for Elixir
belvedere3.2 0.0 dotenv-linter VS belvedereAn example of CircleCI integration with Elixir
int_set2.0 10.0 dotenv-linter VS int_setA time- and memory-efficient data structure for positive integers.
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of dotenv-linter or a related project?
⚡️Lightning-fast linter for .env files. Written in Rust 🦀
dotenv-linter can [check](#-check) / [fix](#-fix) / [compare](#-compare)
.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 ✅ Substitution Key ✅ Trailing whitespace ✅ Unordered Key
What is a
💡 A .env file or dotenv file is a simple text file containing all the environment variables of a project. Storing configuration in the environment variables is one of the tenets of the Manifesto of Twelve-Factor App. The .env file has a simple key-value format, for example: FOO=BAR. More information you can find in articles in English and Russian.
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 and Super-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 ## 🚀 Usage #### ✅ Check By default, `dotenv-linter` checks all `.env` files in the current directory: ```shell $ dotenv-linter Checking .env .env:2 DuplicatedKey: The FOO key is duplicated .env:3 UnorderedKey: The BAR key should go before the FOO key Checking .env.test .env.test:1 LeadingCharacter: Invalid leading character detected Found 3 problems
It can also fix the found warnings with the
$ dotenv-linter fix Fixing .env 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
dotenv-linter can compare
.env files with each other and output the difference between them:
$ dotenv-linter compare .env .env.example Comparing .env Comparing .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):
🚦 Continuous Integration
dotenv-linter can also be used with CI services such as: GitHub Actions and Circle CI.
Benchmarking dotenv-linter/dotenv-linter and wemake-services/dotenv-linter has done using the hyperfine utility:
|Command||Mean [ms]||Min [ms]||Max [ms]||Relative|
||2.7 ± 0.4||2.0||4.3||1.00|
||162.6 ± 12.1||153.0||201.3||60.83 ± 10.20|
Content of .env file used for benchmarking
SPACED= KEY = VALUE SECRET="my value" SECRET=Already defined kebab-case-name=1 snake_case_name=2
dotenv-linter is not just a linter for
.env files — it is also a contributor-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 — to promote 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 act as a mentor within this project and help 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:
👍 Similar projects
- wemake-services/dotenv-linter (Python)
This project exists thanks to all the people who contribute. [Contribute].
dotenv-linter is created & supported by Evrone. What else we develop with Rust.
Become a financial contributor and help us sustain our community.
*Note that all licence references and agreements mentioned in the dotenv-linter README section above are relevant to that project's source code only.