python-dotenv icon indicating copy to clipboard operation
python-dotenv copied to clipboard

Add example env file generator

Open ethsanders opened this issue 4 years ago • 8 comments

Closes #354

ethsanders avatar Nov 10 '21 02:11 ethsanders

What tests would you recommend adding?

ethsanders avatar Nov 19 '21 18:11 ethsanders

Added a test. Would you consider merging this?

ethsanders avatar Dec 14 '21 04:12 ethsanders

Hi, looks good, waiting for this feature to be merged.

roy-pstr avatar Feb 01 '22 11:02 roy-pstr

I just implemented the suggestions you mention here @theskumar.

ethsanders avatar May 31 '22 03:05 ethsanders

@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:

  1. dotenv generate-sample (This implementation)
  2. dotenv list --format=sample (if we follow the implementation in #407)
  3. dotenv export --format=[sample|json|export|shell]. (New alternate implementation of (2))

@bbc2 Any thoughts?

theskumar avatar Jun 05 '22 18:06 theskumar

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.

ethsanders avatar Jun 06 '22 03:06 ethsanders

@ProfessorPiggos Try generate-sample instead of generate_sample and don't bother about the commit spam :D

theskumar avatar Jun 06 '22 08:06 theskumar