npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

git-guppy-pre-commit-hook

v0.1.0

Published

The (pre-post) commit hooks for the Git Guppy module for your gulp workflows.

Downloads

11

Readme

git-guppy NPM version

Git pre-commit hook for Git Guppy, a Simple git-hook integration for your gulp workflows.

guppy streamlines and extends your git-hooks by integrating them with your gulp workflow. Git-hooks can now be managed through npm, allowing them to automatically be installed and updated. And because they integrate with gulp, it's easy to modify the workflow and even combine hooks with your other gulp tasks.

guppy leverages these powerful existing systems as its backbone, allowing guppy (and therefore your git-hooks) to remain as simple and lightweight as possible through interfaces you're already familiar with.

Pre-commit hook

Read more about this hook at http://git-scm.com/docs/githooks#_pre_commit.

  • By-passing it: using git commit --no-verify when installed and configured.

Install

Install with npm:

$ npm install --save git-guppy-pre-commit-hook
npm http GET https://registry.npmjs.org/named-regexp
npm http 304 https://registry.npmjs.org/named-regexp
npm http GET https://registry.npmjs.org/lazypipe
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/shelljs
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/shelljs
npm http 304 https://registry.npmjs.org/lazypipe
npm http GET https://registry.npmjs.org/stream-combiner
npm http 304 https://registry.npmjs.org/stream-combiner
npm http GET https://registry.npmjs.org/duplexer
npm http GET https://registry.npmjs.org/through
npm http 304 https://registry.npmjs.org/duplexer
npm http 304 https://registry.npmjs.org/through

> [email protected] postinstall /tmp/sp-quality/node_modules/git-guppy-pre-commit-hook/node_modules/git-guppy
> scripts/install.js

/tmp/sp-quality
Thanks for installing git-guppy! Install any of the hooks available now!
npm install --save git-guppy-pre-commit git-guppy-pre-commit git-guppy-post-commit ...
Go to https://github.com/therealklanni/git-guppy for a complete list!

> [email protected] postinstall /tmp/sp-quality/node_modules/git-guppy-pre-commit-hook
> ../git-guppy/scripts/install.js pre-commit

/tmp/sp-quality
pre-commit installed successfully
[email protected] node_modules/git-guppy-pre-commit-hook
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected])

After the installation is complete, the hook is installed at APP/.git/hook/pre-commit.

Usage

Git integration

Automatic!

The actual script that git will run to trigger guppy's hook will automatically be installed to your APP/.git/hooks/ directory. These are just a wrapper for invoking the gulp tasks that guppy registers.

You can install guppy-hooks via npm

Gulp integration

Usually, pre-commit hooks can be used to trigger lint, code check, among other things. The following example creates a task called "check", which uses lint and jscs to verify the code prior to a commit. If the verification fails, the commit process halts as expected. If it passes, profit! and commit!

  var gulp = require("gulp");

  gulp.task("check", function() {
    // Check all the source and the test cases together
    return gulp.src(appSourcePaths.concat(testSourcePaths))
      .pipe(jshint(SP_QUALITY_MODULE_CONFIG_DIR + "/.jshintrc"))
      .pipe(jshint.reporter(stylish))
      .pipe(jscs(SP_QUALITY_MODULE_CONFIG_DIR + "/.jscsrc"))
      .on("error", function() {
        process.exit(-1);
      })
      .on("end", function() {
        process.exit();
      });
  });

  // define guppy and its dependency hook to pre-commit.
  var guppy = require("guppy);
  guppy.init(gulp)
  guppy.tasks["pre-commit"].dep.push("check")

An attempt to commit will result in failure if the code does not pass the check.

mdesales@ubuntu [11/16/201416:28:31] /tmp/sp-quality (master *+) $ git commit
[16:28:34] Using gulpfile /tmp/sp-quality/Gulpfile.js
[16:28:34] Starting 'check'...
[16:28:35] Finished 'check' after 69 ms
[16:28:35] Starting 'pre-commit'...

/tmp/sp-quality/src/index.js
  line 34  col 33  Missing semicolon.
  line 52  col 19  Missing semicolon.
  line 53  col 46  Missing semicolon.

✖ 3 problems

However, you will be able to commit the code if the check passes!

mdesales@ubuntu [11/16/201416:26:57] /tmp/sp-quality (master *+) $ git commit
[16:27:02] Using gulpfile /tmp/sp-quality/Gulpfile.js
[16:27:02] Starting 'check'...
[16:27:02] Finished 'check' after 71 ms
[16:27:02] Starting 'pre-commit'...

If you are certain to by-pass the errors, you can use git's switch --no-verify. That way, the hook will NOT even be triggered!

Git Guppy Core

For full detail about the core of the project, please go to https://github.com/therealklanni/git-guppy.

Authors

Kevin Lanni

** Modular Hooks Architecture **

License

Copyright (c) 2014 Marcello de Sales, contributors. Released under the MIT license


This file was generated by gulp-verb on August 10, 2014.