Coder Social home page Coder Social logo

aashu23 / dotenv-linter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dotenv-linter/dotenv-linter

0.0 0.0 0.0 511 KB

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

Home Page: https://dotenv-linter.github.io

License: MIT License

Rust 96.64% Dockerfile 0.23% Shell 3.13%

dotenv-linter's Introduction

dotenv-linter

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

GitHub Actions Coverage Status License Releases

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.

👨‍💻 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

# 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

🚀 Usage

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

🚦 Continuous Integration

dotenv-linter can also be used with CI services such as: GitHub Actions and Circle CI.

🤝 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.