8000 load custom extensions in pre-hook by cheungnj · Pull Request #860 · cookiecutter/cookiecutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

load custom extensions in pre-hook #860

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

Merged
merged 2 commits into from
Dec 10, 2016

Conversation

cheungnj
Copy link

Fixes #850

StrictEnvironment is used instead of Template when processing the pre-hook. I changed the hooks for the tests because strings weren't getting returned.

@codecov-io
Copy link
codecov-io commented Nov 28, 2016

Current coverage is 100% (diff: 100%)

Merging #860 into master will not change coverage

@@           master   #860   diff @@
====================================
  Files          16     16          
  Lines         661    663     +2   
  Methods         0      0          
  Messages        0      0          
  Branches        0      0          
====================================
+ Hits          661    663     +2   
  Misses          0      0          
  Partials        0      0          

Powered by Codecov. Last update 03dc984...5c300d4

@cheungnj
Copy link
Author
cheungnj commented Nov 28, 2016

I have no idea where force_delete was getting called. Should I add a test for it?

@hackebrot hackebrot added bug This issue/PR relates to a bug. needs-review PR Only: This PR require review from other developer labels Nov 29, 2016
@hackebrot
Copy link
Member

Hi @cheungnj! 👋

Thank you for resolving this issue. Great work!

Don't worry too much about the code coverage. I don't really see a reason why your changes would cause force_delete to be missed.

I'm happy to merge this. Let's see what the others think.

@audreyr @pydanny @michaeljoseph

@hackebrot hackebrot added this to the 1.5.0 Alfajor milestone Nov 29, 2016
@@ -106,23 +105,25 @@ def run_script_with_context(script_path, cwd, context):
mode='wb',
suffix=extension
) as temp:
output = Template(contents).render(**context)
template = env.from_string(contents)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just instantiate StrictEnvironment here, instead of passing the env through all these function calls?

@hackebrot hackebrot merged commit 74d529a into cookiecutter:master Dec 10, 2016
@hackebrot
Copy link
Member

Thank you @cheungnj! 🍪

hackebrot added a commit that referenced this pull request Dec 10, 2016
@cheungnj cheungnj deleted the custom-extension-in-pre-hooks branch January 27, 2019 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug. needs-review PR Only: This PR require review from other developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0