question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for renaming the cookiecutter dict

See original GitHub issue

Description:

Is there any support for renaming the cookiecutter object to something shorter? I’m finding cookiecutter to be one of those words that are hard to type, and would like to use something like cc in Jinja templates instead

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Granitosauruscommented, Apr 23, 2020

@wadkar sorry I can’t really follow you. How do you even make out such a simple issue as additional alias so complicated. How could anyone have trouble reading cc instead of cookiecutter.
You can close this issue and my PR for all I care, I raised my proposal and clearly there’s nothing of value to discuss here.

For those who want the alias I’m maintaining a fork and pypi repo:

https://github.com/Granitosaurus/cookiecutter-cc https://pypi.org/project/cookiecutter-cc/

bye.

1reaction
wadkarcommented, Apr 17, 2020

Personally, I am not worried about typing cookiecutter because one reads a variable an order of magnitude more than one writes. Perhaps explicit is better than implicit can be considered useful here?

Not to disregard any usability concerns, I do like the third option suggested earlier, i.e. {{foo}}.{{bar}} though I am not sure how it can be achieved without surprising the user too much.

As it stands, I don’t mind the status-quo and use the cookiecutter variable in jinja2 template. As for providing a shorter alias or renaming, wouldn’t something like {%- cc = cookiecutter -%} at the beginning of template work for those who want shorter/cryptic name?

Finally, please understand this issue is the hardest problem in CS/SE : Naming Things! I would be happy to hear what other users/developers have to say about it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove 'cookiecutter' namespacing · Issue #380 - GitHub
Support for renaming the cookiecutter dict #1166 - Renaming cookiecutter dictionary; Parametrize namespace #1233 - Parametrize namespace; alias ...
Read more >
cookiecutter Documentation
Supports unlimited levels of directory nesting. ... Don't worry about naming/pinpointing the issue properly. • Ask for help on Slack if you ...
Read more >
Cookiecutter: how do you override a dictionary variable using ...
but the former does nothing and the latter just replaces the entire app parameter with the string {\"name\":\"my-new-name\"} (it doesn't parse ...
Read more >
Cookiecutter V2 Context Specification Documentation
Special Overwrite Syntax for Renaming a Variable . ... support features in the future that will enhance the overall user experience.
Read more >
Project Templates with Cookiecutter - YouTube
When we start new projects we want to solve a problem, not write boilerplate. Cookiecutter helps you to stop writing boilerplate.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found