Skip to content

Added: CLI option to ignore hooks#992

Merged
insspb merged 3 commits intocookiecutter:masterfrom
rgreinho:ignore-hooks-switch
May 29, 2020
Merged

Added: CLI option to ignore hooks#992
insspb merged 3 commits intocookiecutter:masterfrom
rgreinho:ignore-hooks-switch

Conversation

@rgreinho
Copy link
Copy Markdown
Contributor

@rgreinho rgreinho commented Oct 7, 2017

In some cases we want to generate the cookiecutters without running the
hooks. This patch adds a CLI switch which allows that behavior.

The documentation and the unit tests were updated to reflect this
change.

Drive-by:

  • Update .gitgnore file

@rgreinho
Copy link
Copy Markdown
Contributor Author

rgreinho commented Oct 7, 2017

I saw the issue #429 about the hooks, and I would be more than happy to update the PR to reflect the outcome of this conversation, but I wanted to show my changes to in order to revive the conversation.

@rgreinho rgreinho force-pushed the ignore-hooks-switch branch 4 times, most recently from 0fe9f2b to 8db4c2e Compare October 10, 2017 03:50
@rgreinho rgreinho force-pushed the ignore-hooks-switch branch from 8db4c2e to 47e7878 Compare October 15, 2017 15:57
@rgreinho
Copy link
Copy Markdown
Contributor Author

@michaeljoseph Anything else I could help with to get this PR reviewed? I'm just trying to ensure it does not get forgotten ;)

@rgreinho rgreinho force-pushed the ignore-hooks-switch branch 2 times, most recently from 216eec2 to 1796f7d Compare December 18, 2017 16:00
@rgreinho
Copy link
Copy Markdown
Contributor Author

@michaeljoseph Thanks a lot for your review. I updated the PR to address your remarks.

@michaeljoseph
Copy link
Copy Markdown
Contributor

lgtm 🎉 🍪

@rgreinho
Copy link
Copy Markdown
Contributor Author

Awesome! Can an admin/collaborator merge this PR please?

@rgreinho
Copy link
Copy Markdown
Contributor Author

ping

@rgreinho
Copy link
Copy Markdown
Contributor Author

Can an admin/collaborator merge this PR please? It got the green lights quite some time ago already, there should not be any blockers left.

@pydanny
Copy link
Copy Markdown
Member

pydanny commented Jan 25, 2018

Apologies, but as our current financing is only at $49 (https://www.patreon.com/hackebrot), it's hard for us to find professional quality time to work on Cookiecutter.

However, on my next day off from paid work I'll take a look at this pull request.

@rgreinho
Copy link
Copy Markdown
Contributor Author

I understand. But @michaeljoseph already approved it before, saving you some review time ;)

@rgreinho
Copy link
Copy Markdown
Contributor Author

Hi everyone! Any update regarding this PR? Thanks a lot!

@rgreinho
Copy link
Copy Markdown
Contributor Author

Hello hello! Still no news regarding merging this PR?

@michaeljoseph michaeljoseph added the enhancement This issue/PR relates to a feature request. label Dec 28, 2018
@insspb insspb added the 1.8.0 label Dec 22, 2019
@ssbarnea
Copy link
Copy Markdown
Member

ssbarnea commented Jan 8, 2020

I am closing as this was in conflict for a very long time. Ping me to reopen if you rebase it and it pases CI.

@ssbarnea ssbarnea closed this Jan 8, 2020
@rgreinho
Copy link
Copy Markdown
Contributor Author

rgreinho commented Jan 8, 2020

Well, if you are thinking of merging it I'll re-update it.

@ssbarnea ssbarnea reopened this Jan 9, 2020
@rgreinho rgreinho force-pushed the ignore-hooks-switch branch from 2c60c21 to f77a160 Compare January 9, 2020 00:35
@rgreinho
Copy link
Copy Markdown
Contributor Author

rgreinho commented Jan 9, 2020

@ssbarnea Updated and all green!

Copy link
Copy Markdown
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

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

Something is clearly wrong about the README!!!

@rgreinho rgreinho force-pushed the ignore-hooks-switch branch 2 times, most recently from 36a97e1 to 024a416 Compare January 29, 2020 22:51
@rgreinho
Copy link
Copy Markdown
Contributor Author

I removed the old README.rst!!!

However, the CI is not happy about Python 2.7 🤔 Any clue why? I could not see anything interesting in the logs.

@rgreinho rgreinho force-pushed the ignore-hooks-switch branch from 024a416 to 5018209 Compare February 7, 2020 21:45
@rgreinho
Copy link
Copy Markdown
Contributor Author

rgreinho commented Feb 7, 2020

@ssbarnea Chocolatey is not happy with Python2:

The command "choco install python2" failed and exited with 1 during .

@ssbarnea ssbarnea added this to the 1.8.0 milestone Mar 30, 2020
@ssbarnea ssbarnea removed the 1.8.0 label Mar 30, 2020
@paulpach
Copy link
Copy Markdown

Please note #429 is not resolved by disabling hooks. People can still put arbitrary code in jinja templates. Disabling hooks does not improve security.

@rgreinho
Copy link
Copy Markdown
Contributor Author

That's OK, I did not implement it to solve the security concern, but to make it work for a use case.

@insspb insspb modified the milestones: 1.8.0, 2.0.0 May 26, 2020
@cookiecutter cookiecutter deleted a comment from codecov-io May 28, 2020
In some cases we want to generate the cookiecutters without running the
hooks, or ask the user to confirm whether to run them. This patch adds
a CLI switch which allows that behavior.

The documentation and the unit tests were updated to reflect this
change.

Drive-by:
* Update .gitgnore file
* Update tox.ini to add fail fast option to pytest
@insspb insspb force-pushed the ignore-hooks-switch branch from 5018209 to 63872a1 Compare May 29, 2020 18:55
@insspb insspb changed the title Add CLI option to ignore hooks Added: CLI option to ignore hooks May 29, 2020
@insspb
Copy link
Copy Markdown
Member

insspb commented May 29, 2020

@rgreinho Thank you for contribution.
I updated it to current codebase, fixed tests. And merged.
If you have some time, please look at issue #1416 and write some related docs.

@insspb insspb self-assigned this May 29, 2020
@insspb insspb merged commit 947a7f0 into cookiecutter:master May 29, 2020
@rgreinho rgreinho deleted the ignore-hooks-switch branch May 29, 2020 20:21
@simobasso simobasso mentioned this pull request May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This issue/PR relates to a feature request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants