godotenv icon indicating copy to clipboard operation
godotenv copied to clipboard

godotenv removes trailing `#..` as comment

Open ndeloof opened this issue 4 years ago • 4 comments

Comments in .env files must be preceded by a space character godotenv looking for comments delimiter must check previous character is a blanck one

see https://github.com/theskumar/python-dotenv/blob/master/tests/test_parser.py#L20-L23 as an explicit test case to check a=b#c should be parsed as key=a, value=b#c, but a=b #c should be parsed as key=a, value=b.

ndeloof avatar Jun 29 '21 07:06 ndeloof

image Hello, I have made a fix by myself and that let you make your string variables with # readable without single or double quotation. You should change the function parseLine. It makes that library works like nodejs dotenv library.

gzapatas avatar Jul 01 '21 17:07 gzapatas

@gzapatas nice. Why don't you propose this as a pull-request?

ndeloof avatar Jul 01 '21 18:07 ndeloof

Just to chime in and +1 this, we also need this :+1:

decentral1se avatar Jul 31 '21 08:07 decentral1se

Tried https://github.com/Autonomic-Cooperative/godotenv/commit/075e12e95fa159e261062da75b3a89d500427a50 but actually https://github.com/Autonomic-Cooperative/godotenv/commit/b031ea1211e7fd297af4c7747ffb562ebe00cd33 was the winner :upside_down_face:

decentral1se avatar Jul 31 '21 10:07 decentral1se