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

Preserve comments in the produced .env.example file. #3

Closed
dashmug opened this issue Mar 18, 2024 · 2 comments
Closed

Preserve comments in the produced .env.example file. #3

dashmug opened this issue Mar 18, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@dashmug
Copy link

dashmug commented Mar 18, 2024

It would be great if this tool can preserve comments.

For example, with this example .env...

# Copy and paste the credentials here.
#
# Restart running containers whenever these values are updated.

AWS_PROFILE="default"

# Alternatively, if you wish to use keys directly, uncomment the 
# following lines and provide the values. Comment out or remove the 
# AWS_PROFILE line above.

# AWS_ACCESS_KEY_ID=""
# AWS_SECRET_ACCESS_KEY=""
# AWS_SESSION_TOKEN=""

I would expect to get this as the .env.example.

# Copy and paste the credentials here.
#
# Restart running containers whenever these values are updated.

AWS_PROFILE=""

# Alternatively, if you wish to use keys directly, uncomment the 
# following lines and provide the values. Comment out or remove the 
# AWS_PROFILE line above.

# AWS_ACCESS_KEY_ID=""
# AWS_SECRET_ACCESS_KEY=""
# AWS_SESSION_TOKEN=""

Currently, the tool produces this...

AWS_PROFILE=
@hija
Copy link
Owner

hija commented Mar 20, 2024

Hi @dashmug,

thank you for trying out the pre-commit hook and for giving feedback!

I really like your idea and think this should definitely be implemented. Unfortunately, from a quick glimpse it does not seem like the .env file parser we are using currently is (out of the box) suitable for this task. I think we need to choose another .env parser or write our own one.

I will add this feature to the feature request list, but since I am a bit busy, I do not think I am able to implement it in the near future. However, feel free to contribute to the package :)

@hija hija added enhancement New feature or request help wanted Extra attention is needed labels Mar 20, 2024
@hija
Copy link
Owner

hija commented Mar 29, 2024

Implemented in #4. 🚀

Feel free to open a new issue in case anything does not work as expected.

@hija hija closed this as completed Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants