In VSCode, when you install the dotenv extension, it greys out sections following a hashtag, e.g.:
SOME_VAR=HELLO # explanation of SOME_VAR, or why it's assigned the value HELLO
^--------------------this part is greyed out------------------^
However, dotenv _the package_ does not respect that. In fact, I often got burned by the fact that dotenv just straight up includes the comments in the actual value for the environment variable, which is super unintuitive.
I'd love it if I could have inline comments without fear of screwing up the environment variables.
Love the work you're doing,
thanks!
I'll like to second this request. I just got bit by this expectation as well.
Issue #156 addressed this, but was closed saying that dotenv is expected to be just like a .ini file. Except that it's in the format of Unix shell variables, and most shells support inline comments in their configuration files. So the expectation is that this is supported.
Nor is the issue immediately obvious, since dotenv does not throw an error, but merely includes the comment as part of the variable value, so it can take a while to track down the issue as a .env file issue.
I got the same issue. After searching for comment syntax, I found https://github.com/vlucas/phpdotenv#comments which is a PHP implementation that allows comments after the key-value. I think it is important to keep parity between .env implementations so that the same .env file can be used across different implementations. E.i. Ruby dotenv, PHP dotenv and Nodejs Dotenv.
Original Ruby Dotenv comment syntax: https://github.com/bkeepers/dotenv#comments
Most helpful comment
I'll like to second this request. I just got bit by this expectation as well.
Issue #156 addressed this, but was closed saying that dotenv is expected to be just like a .ini file. Except that it's in the format of Unix shell variables, and most shells support inline comments in their configuration files. So the expectation is that this is supported.
Nor is the issue immediately obvious, since
dotenvdoes not throw an error, but merely includes the comment as part of the variable value, so it can take a while to track down the issue as a.envfile issue.