dotenv-linter icon indicating copy to clipboard operation
dotenv-linter copied to clipboard

Check for missing keys

Open KristobalJunta opened this issue 4 years ago • 2 comments

Have you considered adding a rule to check for missing keys?

One possible use for that: on a system where application is running for some time and with periodical updates, a situation is possible, where an update will introduce a new key and that should be checked in .env

Not sure if this is in scope of a linter though, or should this be enforced by sane defaults/exceptions on application end.

KristobalJunta avatar Mar 24 '20 13:03 KristobalJunta

Can you please provide an example?

Something like dotenv-linter .env --strict-keys=SHOULD_BE_PRESENT,OTHER_REQUIRED?

sobolevn avatar Mar 24 '20 14:03 sobolevn

I was more about validating a .env file against some example or template one. Like, validating the current .env against version-controlled .env.example.

KristobalJunta avatar Mar 24 '20 19:03 KristobalJunta