GeezerVison is showing github.com — new tool: git hooks (pre-push, pre-commit) · Issue #160 · nodejs/node-core-utils
new tool: git hooks (pre-push, pre-commit) #160Description
- Should be a symlink in
.git/hooks/pre-push
- Use the remote and branch config that we have, stop users from pushing invalid commits, especially merge commits.
Activitypriyank-p commented on Jan 27, 2018 I worked on creating pre-push hook before, we can surely implement it. Alternatively we can also have pre-commit that runs linter only if the user wants. alopezsanchez commented on Feb 10, 2018 Questions:
- This hook will be only for node-core-utils project, it will be a tool for collaborators of all Node.js projects, or a tool for any contributor?
- Language of the script? Bash, Node...?
I can work of it if you don't have any inconveniences. joyeecheung commented on Feb 11, 2018
This hook will be only for node-core-utils project, it will be a tool for collaborators of all Node.js projects, or a tool for any contributor?
For node core, I think. It's just a script that people can symlink to, we can ask the users if they want to symlink that during the npm post-install hook. People can also symlink to other repos if they want.
Language of the script? Bash, Node...?
Well I guess it'll need to read the .ncu/config at some point, which is JSON (also might need to read the global ~/.ncurc), so it'll be easier to write that in Node priyank-p commented on Feb 11, 2018
Language of the script? Bash, Node...?
Yep, agreed that it should be in node. But the symlinked script must be in bash, since windows also supports bash in git hooks.
And furthermore in the .git/hooks folder you need to make sure that you remove the .sample file for the hook since sometimes this causes the hook to not run.
Lastly, the hook should output info about using --no-verify flag to skip this hook. changed the title [-]new tool: pre-push git hook[/-] [+]new tool: git hooks (pre-push, pre-commit)[/+] on Mar 11, 2018priyank-p commented on Mar 11, 2018 Should this be its own ncu-git-hooks or be part of git node git node hooks? (This will be used to install/uninstall hooks)
What should it run make -j4 test and make lint for pre-commit and core-validate-commit for pre-push?
(I plan to work on this, After some issues, labeled bugs are fixed). github-actions commented on Aug 17, 2020 This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|