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

Expand cli documentation relating to the no-input flag (#1543) #1587

Merged
merged 3 commits into from Jun 6, 2022

Conversation

jeremyswerdlow
Copy link
Contributor

Addresses the concerns in #1543 that not all side effects are clearly documented

@glumia glumia self-requested a review August 22, 2021 08:12
@glumia
Copy link
Contributor

glumia commented Aug 22, 2021

Hey @jeremyswerdlow thanks for taking time for this, and sorry for the delay on the review!

While we're at it, I'd like to be able to fix other problems with flag's documentation within the codebase.

I tracked down all the places where no_input appears, and this is what I noticed:

  • cookiecutter/main.py::cookiecutter
  • cookiecutter/prompt.py::prompt_for_config
  • cookiecutter/prompt.py::prompt_choice_for_config
  • cookiecutter/repository.py::determine_repo_dir

In all those places the docstring just says "Prompt the user at command line for
manual configuration?"
. But as a user of this function, I ask myself: what
happens if the end-user isn't prompted for manual configuration? (I
should be able to understand it by looking only at the docstring)

  • cookiecutter/zipfile.py::unzip

"Suppress any prompts" doesn't say anything about how the function
behaves in this case. Take a look at cookiecutter/utils.py::prompt_and_delete,
this is an example of good documentation: if I read the docstring I
don't have to guess what happens.

  • cookiecutter/vcs.py::clone

Same as above, how does the function behave if the flag is True? (there's no mention
about the cache being refreshed).

  • docs/advanced/suppressing_prompts.rst:6

We should document also here the fact that no_input causes a refresh of the cached resources.
I would also add a comment on line 6 to say that no_input corresponds to --no-input flag on the CLI.

Would you mind taking care of them?

@glumia
Copy link
Contributor

glumia commented Sep 18, 2021

Hey @jeremyswerdlow are you still interested on working on this?

I don't want to put pressure, it's just to know if I should wait or add those changes by myself and merge the pr.


Update (2021-10-26)
Added the missing bits and assigned the review to someone else as this pull request now contains code submitted by myself.

@glumia glumia self-assigned this Sep 18, 2021
@glumia glumia requested review from audreyfeldroy and removed request for glumia October 26, 2021 20:28
cookiecutter/prompt.py Outdated Show resolved Hide resolved
@insspb insspb added documentation This issue/PR relates to or includes documentation. code style This issue/PR relates to the project code style modification labels Jun 6, 2022
@insspb
Copy link
Member

insspb commented Jun 6, 2022

@jeremyswerdlow @glumia Thank you for contribution, will be in next release.

@insspb insspb merged commit b6e32d3 into cookiecutter:master Jun 6, 2022
@insspb insspb removed the code style This issue/PR relates to the project code style modification label Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This issue/PR relates to or includes documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants