Skip to content
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

Setup hooks in package.json #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lucasconstantino
Copy link

This pull-request aims to make it easier - and less bloating to the dependency system - to define hooks to be installed via package.json config. I've introduced a property named guppy-hooks, which should be fulfilled with an array of hooks to install.

I've also removed guppy-pre-commit dependency, so to use this new method of install.

install.js Outdated

/**
* Get root dependent application path.
*/
Copy link
Owner

Choose a reason for hiding this comment

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

Please use single line comment //

@therealklanni
Copy link
Owner

This is a great idea, I love it. However, it looks like the tests are failing, can you look into it? Also, would you mind updating the README describing how to use guppy with these changes?

Also, we should probably add some functionality to guppy-cli for adding a hook(s) to the "guppy-hooks" config. If you feel up to tackling that as well, that would be very helpful.

Thanks.

@therealklanni
Copy link
Owner

If you rebase your branch on the latest from master, that should fix your build.

install.js Outdated
var pack = require(rootApplicationPath() + '/package.json');

// Install each confgured hook.
pack['guppy-hooks'] && async.each(pack['guppy-hooks'], function (hook, next) {
Copy link
Owner

Choose a reason for hiding this comment

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

I would prefer it if you use an if here instead. That would make it more clear what's happening on this line and easier to maintain.

Copy link
Author

Choose a reason for hiding this comment

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

Consider it done. Do you have any applicable code-style which I should follow for further contributions?

@lucasconstantino
Copy link
Author

I'm glad you enjoyed the idea. I'll try and rebase from master to fix the build.

Question: are the guppy-hook packages still applicable after this new method of install? Should I replace the README documentation on that part, or should I just add an alternative method of install for the hooks?

@lucasconstantino
Copy link
Author

@therealklanni I've modified code as requested. I've also created a pull-request to my (pull-requesting) branch so to make it easier for us to discuss about the README changes, but without blocking this pull-request from merging. I've made quite a huge rewriting to the README on that branch. Please take the changes mostly as suggestions.

@therealklanni
Copy link
Owner

@lucasconstantino yes guppy-hook packages are still relevant, but they have more specific use-cases now.

I'm going to pull this branch and do some testing locally as soon as I get a chance before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants