Skip to content

Saving Hooks in User's .git repo

Matthew Chase Whittemore edited this page Aug 14, 2013 · 2 revisions

Options

  1. We can create a file called hooks.json and install these files into node_modules
  2. We can create a file called hooks.json and install these files into hook_modules
  3. We can add a parameter to package.json called hooks and install these into *_modules
  4. We can create a file or parameter and add a devDependency to hooks which installs hook-mods into *_modules.
  5. We can create a file or parameter and add a devDependency to force-hooks which installs hook-mods into *_modules.

Thoughts

  • hooks.json seems like a bad idea. Why have a json file when there going to have a package.json anyway?
    • what about when they don't have a package.json file? Can't python uses use this?
  • package.json is kinda cluttered, and if someone is going to use hooks with a language other than node, what does package.json mean to them?
  • node_modules: clean for node, dirty else where.
  • hook_modules: at least its name makes sense.
  • hooks - devDependency: should force hooks to be installed
  • force hooks - devDependency: should force hooks, but requires maintaining multiple packages....

Hooks Object

{
  "pre-commit":{
    "git-stored-module": "https://github.com/mcwhittemore/valid-mocha-tests.hook/tarball/master",
    "local-module": "../local-modules/local",
    "npm-module": "0.0.0"
  },
  "post-commit": {}
}

Clone this wiki locally