-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Allow pre-commit script to exist outside of modulesync Gem #127
Comments
see also #148 |
Could someone describe a real-life example where its useful to use a pre commit hook in Thanks |
One use case is coding style checkers. For example, you can run Then there are 2 ways of dealing with that. First of all, it could be part of the "modulesync x.y.z" commit. However, I personally think a separate "autofix" commit makes more sense and makes reviewing easier. That would give a need for a post-commit hook. Another could be to run a rake task, like validate. For example, I can imagine you want to verify you generated valid Ruby code in a template. |
Regarding our discussion about lightweight of the If pre commit hook stays interesting, what about rely on ATM, it seems almost no one use this feature as there is only one available script, "hardcoded" is repo. My first though is to drop this feature... just waiting to be convinced it make sense to (really) integrate it in |
Thinking about this, I purpose a solution that looks better to me: What about allowing user to specify hooks in configuration files? Details: I think we could implement a way to install hooks, globally or per-module defined, and rely on Example: ---
puppet-hello:
hooks:
pre_commit: '/usr/bin/true'
pre_push: 'bundle update' |
The pre-commit script shouldn't need to be inside of modulesync itself (instead of forcing it to be in contrib).
At the simplest, if given an absolute path it should run that.
The primary use case here is that we have modulesync creating shell scripts and need to be able to chmod them prior to commit.
The text was updated successfully, but these errors were encountered: