python-dotenv
python-dotenv copied to clipboard
Add example env file generator
Closes #354
What tests would you recommend adding?
Added a test. Would you consider merging this?
Hi, looks good, waiting for this feature to be merged.
I just implemented the suggestions you mention here @theskumar.
@ProfessorPiggos Thanks a lot. This looks much better. Can you add some test cases specific to this new feature? It would be great to check for things like lines # are included in the output and also values are removed properly, to ensure there are no future regressions.
You can also clean/remove up any modifications to CHANGELOG.md, setup.cfg and src/dotenv/version.py. We'll update these after merging.
Also, I'm having a second thought about having this as an additional new command or having it as part of https://github.com/theskumar/python-dotenv/pull/407.
Some of the variations we can go with at this point are:
dotenv generate-sample(This implementation)dotenv list --format=sample(if we follow the implementation in #407)dotenv export --format=[sample|json|export|shell]. (New alternate implementation of (2))
@bbc2 Any thoughts?
Concerningly, tests are failing as the generate_sample command cannot be found when running the tests with the error Error: No such command 'generate_sample'. As such, none of the tests are working. Does anyone have any idea why this might be? I'll look at it more later.
Other than that, test_generate_sample_comment_preservation and test_generate_sample_value_removal have both been added.
By the way, VSCode wasn't letting me squash commits for some reason. Sorry for commit spam on the PR.
@ProfessorPiggos Try generate-sample instead of generate_sample and don't bother about the commit spam :D