I happy to announce a simple yet very useful tool to lint your
As a part of our “not blaming but fixing” corporate culture we build a lot of tools that prevent us from making the same mistakes over and over again.
dotenv-linter is one of these tools.
Some time ago we had several problems with
- Some developers used
CONSTANT_CASEfor variable names and some developers used
snake_casefor that. While this is not a technical issue, but it is not very practical to mix these two cases and then think: what case I have used for this particular variable? Consistency is important!
- We also had a problem with quotes and extra spaces. Some developers used
KEY=VALUEand some used
KEY = "VALUE"while in fact, these two examples will resolve in exactly the same thing - we prefer to have one– and preferably only one –obvious way to do it. So, we now stick to
- We also once had a duplicate key that ruined my day. I have spent several hours debugging my app because of this simple issue. That was a turning point for me and I have decided: let’s automate it!
You can install it via
pip (or any other similar tool):
$ pip install dotenv-linter
python is present almost on all Linux setups. And we try to make this tool as portable as possible.
Usage is really simple:
$ dotenv-linter path/to/your/.env even/multiple/files/are/fine/.env
We also have a full list of linting rules in our docs, check it out.
I hope this simple tool will save you some time, make your project more consistent, and your life slightly better. Add me on github to stay informed about the tools I am building!