Permalink
Browse files

Merge pull request #5084 from JLLeitschuh/build/commitHooks

chore(commits): Adds Commit Hooks to build
  • Loading branch information...
2 parents d87c8f3 + 2125a27 commit c56912848f5dac77bc9324c248d7b72546903e10 @swalters swalters committed Feb 9, 2016
Showing with 26 additions and 3 deletions.
  1. +4 −0 CONTRIBUTING.md
  2. +1 −0 README.md
  3. +1 −1 grunt/aliases.js
  4. +3 −0 grunt/shell.js
  5. +17 −2 package.json
View
@@ -163,7 +163,11 @@ We have very precise rules over how our git commit messages can be formatted. T
readable messages** that are easy to follow when looking through the **project history**. But also,
we use the git commit messages to **generate the UIGrid change log**.
+Alternatively you can install [commitizen](https://github.com/commitizen/cz-cli) **OR**
+use the wizard. To use the wizard, run `npm run commit` in your terminal after staging your changes in git.
+
### Commit Message Format
+**If you do not follow this style guide your commit message will fail to be created.**
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:
View
@@ -2,6 +2,7 @@
[![Build Status](https://api.travis-ci.org/angular-ui/ui-grid.png?branch=3.0)](https://travis-ci.org/angular-ui/ui-grid) [![Coverage Status](https://coveralls.io/repos/angular-ui/ui-grid/badge.png?branch=master)](https://coveralls.io/r/angular-ui/ui-grid?branch=master)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular-ui/ui-grid?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
+[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm](https://img.shields.io/npm/dm/angular-ui-grid.svg)](https://www.npmjs.com/package/angular-ui-grid)
[![npm](https://img.shields.io/npm/dt/angular-ui-grid.svg)](https://www.npmjs.com/package/angular-ui-grid)
View
@@ -1,7 +1,7 @@
module.exports = function (grunt, options) {
var baseTasks = {
- 'install': ['shell:bower-install', 'shell:protractor-install'],
+ 'install': ['shell:bower-install', 'shell:protractor-install', 'shell:hooks-install'],
// register before and after test tasks so we don't have to change cli
// options on the CI server
View
@@ -22,5 +22,8 @@ module.exports = {
},
'bower-install': {
command: 'node ./node_modules/bower/bin/bower install'
+ },
+ 'hooks-install': {
+ command: 'npm run init'
}
};
View
@@ -6,7 +6,9 @@
"test": "test"
},
"scripts": {
- "test": "grunt"
+ "init": "validate-commit-msg",
+ "test": "grunt",
+ "commit": "git-cz"
},
"repository": {
"type": "git",
@@ -33,6 +35,8 @@
"bower": "^1.3.8",
"canonical-path": "0.0.2",
"coveralls": "^2.11.1",
+ "cz-conventional-changelog": "^1.1.5",
+ "ghooks": "^1.0.3",
"grunt": "~0.4",
"grunt-angular-templates": "~0.5",
"grunt-bump": "0.0.15",
@@ -72,6 +76,17 @@
"selenium-webdriver": "~2.46.0",
"semver": "~2.2.1",
"shelljs": "~0.2.6",
- "time-grunt": "~1.1.0"
+ "time-grunt": "~1.1.0",
+ "validate-commit-message": "^3.0.1"
+ },
+ "config": {
+ "commitizen": {
+ "path": "./node_modules/cz-conventional-changelog"
+ },
+ "ghooks": {
+ "commit-msg": "validate-commit-msg",
+ "post-merge": "npm install",
+ "post-rewrite": "npm install"
+ }
}
}

0 comments on commit c569128

Please sign in to comment.