observing / pre-commit

Automatically installs a git pre-commit script in your git repository which runs your `npm test` on pre-commit
MIT License
1.88k stars 150 forks source link

Can specify fileType trigger the hook. #51

Closed ibigbug closed 8 years ago

ibigbug commented 9 years ago

Example:

  "pre-commit": {
    "run": ["hint"],
    "fileType": "js|json"
  }

Only commit includes the custom file types can trigger the hook.

It may be very useful in a big project written in multiple languages. :)

3rd-Eden commented 9 years ago

It might make more sense to allow specific hooks be ran for extensions instead of applying this to all extensions so you can have a JSHint run only for JS changes and a CSSHint for just css changes.

ibigbug commented 9 years ago

Yes I agree with you. And how do you think the config will look like ? Maybe:

  "pre-commit": {
    "run": ["jshint|js,css", "csslint|css", "flake8|py"]
  }

Is that ok?