All Projects → dotenv-linter → Dotenv Linter

dotenv-linter / Dotenv Linter

Licence: mit
⚡️Lightning-fast linter for .env files. Written in Rust 🦀

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Dotenv Linter

Dotenv Linter
☺️ Linting dotenv files like a charm!
Stars: ✭ 207 (-74.19%)
Mutual labels:  linter, dotenv
Sonarts
Static code analyzer for TypeScript
Stars: ✭ 776 (-3.24%)
Mutual labels:  linter
Hadolint
Dockerfile linter, validate inline bash, written in Haskell
Stars: ✭ 6,284 (+683.54%)
Mutual labels:  linter
Standard
🌟 JavaScript Style Guide, with linter & automatic code fixer
Stars: ✭ 26,433 (+3195.89%)
Mutual labels:  linter
Devskim
DevSkim is a set of IDE plugins and rules that provide security "linting" capabilities.
Stars: ✭ 576 (-28.18%)
Mutual labels:  linter
Tslint
🚦 An extensible linter for the TypeScript language
Stars: ✭ 5,922 (+638.4%)
Mutual labels:  linter
Shellcheck
ShellCheck, a static analysis tool for shell scripts
Stars: ✭ 27,211 (+3292.89%)
Mutual labels:  linter
Jupyterlab Lsp
Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
Stars: ✭ 796 (-0.75%)
Mutual labels:  linter
Pydocstyle
docstring style checker
Stars: ✭ 752 (-6.23%)
Mutual labels:  linter
Pre Commit
A framework for managing and maintaining multi-language pre-commit hooks.
Stars: ✭ 7,024 (+775.81%)
Mutual labels:  linter
Xo
❤️ JavaScript/TypeScript linter (ESLint wrapper) with great defaults
Stars: ✭ 6,277 (+682.67%)
Mutual labels:  linter
Scalafix
Refactoring and linting tool for Scala
Stars: ✭ 597 (-25.56%)
Mutual labels:  linter
Dockerfilelint
An opinionated Dockerfile linter.
Stars: ✭ 736 (-8.23%)
Mutual labels:  linter
Undercover
Actionable code coverage - detects untested code blocks in recent changes
Stars: ✭ 574 (-28.43%)
Mutual labels:  linter
Super Linter
Combination of multiple linters to install as a GitHub Action
Stars: ✭ 7,445 (+828.3%)
Mutual labels:  linter
Esprint
Fast eslint runner
Stars: ✭ 556 (-30.67%)
Mutual labels:  linter
Phplint
🐛 A tool that can speed up linting of php files by running several lint processes at once.
Stars: ✭ 646 (-19.45%)
Mutual labels:  linter
Interfacer
A linter that suggests interface types
Stars: ✭ 706 (-11.97%)
Mutual labels:  linter
Sublime Phpcs
🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter and Mess Detector Support for Sublime Text
Stars: ✭ 805 (+0.37%)
Mutual labels:  linter
Awesome Go Linters
A curated list of awesome Go linters. More than 60 linters and tools!
Stars: ✭ 801 (-0.12%)
Mutual labels:  linter

dotenv-linter

⚡️Lightning-fast linter for .env files. Written in Rust 🦀

GitHub Actions Coverage Status License Releases

Dotenv-linter can check / 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
    ✅ Trailing whitespace
    ✅ Unordered Key

What is a .env file?

    💡 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:

Dotenv-linter is created & supported by Evrone. What else we develop with Rust.

👨‍💻 Installation

Pre-compiled binary

# 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:

$ 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

🛠 Fix

It can also fix the found warnings with the fix command:

$ 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

🤲 Compare

In addition, 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.

🚧 Benchmark

Benchmarking dotenv-linter/dotenv-linter and wemake-services/dotenv-linter has done using the hyperfine 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 = VALUE

SECRET="my value"

SECRET=Already defined

kebab-case-name=1
snake_case_name=2

✌️ Mentorship

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. 🤗

🤝 Contributing

If you've ever wanted to contribute to open source, now you have a great opportunity:

👍 Similar projects

✨ Contributors

This project exists thanks to all the people who contribute. [Contribute].

♥️ Sponsors

Sponsored by Evrone

Become a financial contributor and help us sustain our community.

📃 License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].