feat: implement dict questions#2231
Open
dellekappa wants to merge 6 commits intocopier-org:masterfrom
Open
Conversation
Author
|
@sisp any chance for reviewing this? I know it is a quite big implementation, but it will bring copier to the next level in my opinion. Thanks for your awesome work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Probably a better implementation for issue #751 compared to PR #2223
This PR relates to issue #751
Some reasoning follows:
implemented the question type dict that will be rendered, as expected, as a dict in jinja context. This is why I used dict instead of nested
on the answers file side, the answers are still a flat list that includes only the leafs of the question tree, but, to be able to traverse the question tree hierarchy, a classical property.property synthax has been used. Under the hood this is handled by dpath. This permits the user to easily specify an answer value from the command line at any hierarchy level.
the deepness in prompt have been rendered just with indentation. Even if what have been proposed in #751 is much more appealing, is also much harder to implement because requires to know in advance the questions that will be rendered