Skip to content

Commit c569128

Browse files
committed
Merge pull request #5084 from JLLeitschuh/build/commitHooks
chore(commits): Adds Commit Hooks to build
2 parents d87c8f3 + 2125a27 commit c569128

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ We have very precise rules over how our git commit messages can be formatted. T
163163
readable messages** that are easy to follow when looking through the **project history**. But also,
164164
we use the git commit messages to **generate the UIGrid change log**.
165165

166+
Alternatively you can install [commitizen](https://github.com/commitizen/cz-cli) **OR**
167+
use the wizard. To use the wizard, run `npm run commit` in your terminal after staging your changes in git.
168+
166169
### Commit Message Format
170+
**If you do not follow this style guide your commit message will fail to be created.**
167171
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
168172
format that includes a **type**, a **scope** and a **subject**:
169173

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![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)
44
[![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)
5+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
56
[![npm](https://img.shields.io/npm/dm/angular-ui-grid.svg)](https://www.npmjs.com/package/angular-ui-grid)
67
[![npm](https://img.shields.io/npm/dt/angular-ui-grid.svg)](https://www.npmjs.com/package/angular-ui-grid)
78

grunt/aliases.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
module.exports = function (grunt, options) {
33
var baseTasks = {
4-
'install': ['shell:bower-install', 'shell:protractor-install'],
4+
'install': ['shell:bower-install', 'shell:protractor-install', 'shell:hooks-install'],
55

66
// register before and after test tasks so we don't have to change cli
77
// options on the CI server

grunt/shell.js

+3
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ module.exports = {
2222
},
2323
'bower-install': {
2424
command: 'node ./node_modules/bower/bin/bower install'
25+
},
26+
'hooks-install': {
27+
command: 'npm run init'
2528
}
2629
};

package.json

+17-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"test": "test"
77
},
88
"scripts": {
9-
"test": "grunt"
9+
"init": "validate-commit-msg",
10+
"test": "grunt",
11+
"commit": "git-cz"
1012
},
1113
"repository": {
1214
"type": "git",
@@ -33,6 +35,8 @@
3335
"bower": "^1.3.8",
3436
"canonical-path": "0.0.2",
3537
"coveralls": "^2.11.1",
38+
"cz-conventional-changelog": "^1.1.5",
39+
"ghooks": "^1.0.3",
3640
"grunt": "~0.4",
3741
"grunt-angular-templates": "~0.5",
3842
"grunt-bump": "0.0.15",
@@ -72,6 +76,17 @@
7276
"selenium-webdriver": "~2.46.0",
7377
"semver": "~2.2.1",
7478
"shelljs": "~0.2.6",
75-
"time-grunt": "~1.1.0"
79+
"time-grunt": "~1.1.0",
80+
"validate-commit-message": "^3.0.1"
81+
},
82+
"config": {
83+
"commitizen": {
84+
"path": "./node_modules/cz-conventional-changelog"
85+
},
86+
"ghooks": {
87+
"commit-msg": "validate-commit-msg",
88+
"post-merge": "npm install",
89+
"post-rewrite": "npm install"
90+
}
7691
}
7792
}

0 commit comments

Comments
 (0)