Skip to content

Commit

Permalink
feat: Add commit validation and commits template
Browse files Browse the repository at this point in the history
In order to have a similar structure in the commit
messages of the contributions, adding a commit
validation hook, that a subset of the structure of
angular.js validation messages.
  • Loading branch information
DanielaValero committed Dec 16, 2016
1 parent a76cfba commit eda7553
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .fitcommitjsrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"validators": {
"lineLength": {
"enabled": true,
"maxLineLength": 100,
"subjectMaxLength": 100
},
"emptyLines": {
"enabled": false
},
"tags": {
"enabled": true,
"tags": "feat, fix, docs, style, refactor, perf, test, chore, revert",
"lineOfTheTag": 1
},
"subjectTense": {
"enabled": true
},
"wip": {
"enabled": true,
"branch": "master"
}
}
}
27 changes: 26 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ that include your webpack.config.js and relevant files, this way you help others
*Note: Node 6 or greater would be better for "best results".*
* Fork the **webpack-cli** repo at [https://github.com/webpack/webpack-cli](https://github.com/webpack/webpack-cli).
* `git clone <your-clone-url> && cd webpack-cli`
* `git checkout develop`
* Install the commit validator: `npm run install-commit-validator`

### Setup with npm
* Install the dependencies: `npm install`
Expand Down Expand Up @@ -86,6 +86,31 @@ In case you've got a small change in most of the cases your pull request would b
* Follow the existing coding style
* Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)

## Commit message format

Our commit messages format follows the [angular.js commits format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format).

We don't use the scope. The template of a commit would look like this:

### Commit Message Format
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type** and a **subject**:

```
<type>: <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory.

Any line of the commit message cannot be longer 100 characters. This allows the message to be easier
to read on GitHub as well as in several git tools.

For more information about what each part of the template mean, head up to the documentation in the
[angular repo](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format)

## Contributor License Agreement

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
},
"main": "./bin/cli.js",
"scripts": {
"lint": "eslint ./lib"
"lint": "eslint ./lib",
"install-commit-validator": "fit-commit-js install"
},
"dependencies": {
"enhanced-resolve": "^3.0.2",
Expand Down

0 comments on commit eda7553

Please sign in to comment.