Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on duplicate value for variable #7

Open
arvindell opened this issue Mar 1, 2022 · 3 comments
Open

Warn on duplicate value for variable #7

arvindell opened this issue Mar 1, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@arvindell
Copy link
Owner

This feature proposes adding a warning/error on the case that a user's environment defines two variables with the same name. For example:


NEXT_PUBLIC_API_URL=http://localhost:4000
SOME_OTHER_VARS=12345


NEXT_PUBLIC_API_URL=https://api.quentli.com

This could catch situations in a user runs runs a process with an unintended env.

@arvindell arvindell added the enhancement New feature or request label Mar 1, 2022
@micalevisk
Copy link

Although I like this feat, I vote for it to be an optional feature because sometimes we may need to have multiple variables just for rapid testing purposes as the env file will be still valid (I'm thinking of dotenv here)

Maybe under the flag --no-duplicate, idk

@arvindell
Copy link
Owner Author

Although I like this feat, I vote for it to be an optional feature because sometimes we may need to have multiple variables just for rapid testing purposes as the env file will be still valid (I'm thinking of dotenv here)

Maybe under the flag --no-duplicate, idk

Interesting, can you explain why you would have multiple values for a variable? Doesn't a line comment (#) cover this use case? 🤔

@micalevisk
Copy link

Doesn't a line comment (#) cover this use case?

it does but (for me, while I'm testing various values) duplicating the line + changing it is quickler than duplicating + comment-in + changing the other one

But yeah, at same time I might not need to use envful before removing those duplicated values

My real concern here is that: before, I was using envful to check the presence of env. vars, but now (after that feat) it's also doing some validation that could be too strict (as dotenv won't complain on duplicate values)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants