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
Added: The ability to use conditional prompts #1645
base: main
Are you sure you want to change the base?
Added: The ability to use conditional prompts #1645
Conversation
Added the ability to use conditional prompts based on an old issue (cookiecutter#913)
…et_cookiecutter_values based on codeclimate
I love this thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this feature, we are looking forward to using it in our on-going work.
Let us know if there is anything else we can do to help!
(@Ninjagod1251 too)
Great addition! Co-authored-by: Juliya Smith <yingthi@live.com>
Great! Co-authored-by: Juliya Smith <yingthi@live.com>
Thanks! Co-authored-by: Juliya Smith <yingthi@live.com>
Thanks! Co-authored-by: Juliya Smith <yingthi@live.com>
This is the first version, so I can imagine that this is 'rough around the edges'. We could have a quick chat and discuss possible next steps, happy to bring this further! |
@nilsdebruin Happy to connect! I am telegram with the same handle @Ninjagod1251 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes based on suggestions of @unparalleled-js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if more changes are needed or that we should take a different route, happy to help!
Thank you very much for implementing this functionality @nilsdebruin 👏 Is there a timeline for cutting a |
@@ -183,8 +183,11 @@ def prompt_for_config(context, no_input=False): | |||
:param dict context: Source for field names and sample values. | |||
:param no_input: Prompt the user at command line for manual configuration? | |||
""" | |||
conditional_keyword = "_if_use_" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since _
already has a meaning in cookiecutter identifiers, I would tend to use a different syntax here.
Ideas:
[if use VARNAME]
? use VARNAME
(more ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As currently it is vatiable, I think we can leave it as it. For now. naming is not my best )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming matters. And it is confusing, if a prefix like _
has two different meanings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jensens, great suggestion! I can see what I can do about the naming issue. For example, as a third option, I could introduce ___ (3x _) as a prefix. I will try and see!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nilsdebruin any update on this? I'd like to see this land as I have a need for the conditional questions as well
Conflicts need to be resolved. |
Co-authored-by: Andrey Shpak <insspb@users.noreply.github.com>
Co-authored-by: Andrey Shpak <insspb@users.noreply.github.com>
Co-authored-by: Andrey Shpak <insspb@users.noreply.github.com>
hi everyone! just checking the current status of this issue and if there is any intention to move that forward or if we can help to move this forward. thanks!! |
Hi @xmnlab , @insspb , @jensens , @malcolmgreaves , @nilsdebruin , @Ninjagod1251 , @unparalleled-js , @moskrc We started working on a new community fork of the Cookiecutter project, named Cookieninja. We have re-opened and merged your PR in the Cookieninja project at: cookieninja-generator/cookieninja#26 We're trying to bring the life back to this amazing project. Thank you :) |
hi guys, I am in great need for this feature, is there any integration of it in any of the official releases? just from reading the release notes I would say now :( |
It needs someone to work on it and fix the open issues. |
Has this issue been resolved? if not, i would like to help attempt to resolve it. |
@austinbenny, I assume you didn't progress it in the end? @jensens, it's just the naming and the tests missing (a part from a master rebase)? |
It's been a while, as far as I can remember that is it. |
Added the ability to use conditional prompts based on an old issue (#913: #913).
I was looking for a solution, but I could not find it. I have created the first version for this including docs and tests.