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 17fa093 commit d0cbfc0
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 8 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"
}
}
}
31 changes: 28 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Most of the time, when webpack does not work correctly, it might be a configurat

If you are still having difficulty after looking over your configuration carefully, please post
a question to [StackOverflow with the webpack-cli tag](http://stackoverflow.com/tags/webpack-cli). Questions
that include your webpack.config.js and relevant files, this way you help others to help you.
that include your `webpack.config.js` and relevant files, this way you help others to help you.

**If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.**

Expand All @@ -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 All @@ -96,6 +121,6 @@ Run `git config user.email` to see your Git email, and verify it with [your GitH

## Documentation

webpack is insanely feature rich and documentation is a time sink. We
webpack is feature rich and documentation is a time sink. We
greatly appreciate any time spent fixing typos or clarifying sections in the
documentation.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
},
"main": "./bin/cli.js",
"scripts": {
"lint": "eslint ./lib"
"lint": "eslint ./lib",
"install-commit-validator": "fit-commit-js install"
},
"dependencies": {
"enhanced-resolve": "^3.0.2",
"fit-commit-js": "^0.3.1",
"interpret": "^1.0.1",
"supports-color": "^3.1.2",
"webpack": "^2.2.0-rc.0",
Expand Down
42 changes: 38 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ date-now@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"

debug@^2.1.1:
debug@^2.1.1, debug@^2.2.0:
version "2.4.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.4.4.tgz#c04d17a654e9202464803f096153f70a6f31f4be"
dependencies:
Expand Down Expand Up @@ -837,6 +837,17 @@ find-up@^1.0.0:
path-exists "^2.0.0"
pinkie-promise "^2.0.0"

fit-commit-js@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/fit-commit-js/-/fit-commit-js-0.3.1.tgz#55c08fa17100b5b8fd347c373459f4a1754e4caf"
dependencies:
debug "^2.2.0"
git-rev-sync "^1.4.0"
is-my-json-valid "^2.13.1"
js-yaml "^3.4.6"
npmlog "^4.0.0"
ramda "^0.22.1"

flat-cache@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.1.tgz#6c837d6225a7de5659323740b36d5361f71691ff"
Expand Down Expand Up @@ -930,6 +941,13 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"

git-rev-sync@^1.4.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/git-rev-sync/-/git-rev-sync-1.8.0.tgz#15c5708b905877af1d75dd9f147106f715415066"
dependencies:
graceful-fs "4.1.6"
shelljs "0.7.4"

glob-base@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
Expand Down Expand Up @@ -969,6 +987,10 @@ globby@^5.0.0:
pify "^2.0.0"
pinkie-promise "^2.0.0"

graceful-fs@4.1.6:
version "4.1.6"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.6.tgz#514c38772b31bee2e08bedc21a0aeb3abf54c19e"

graceful-fs@^4.1.2:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
Expand Down Expand Up @@ -1150,7 +1172,7 @@ is-glob@^2.0.0, is-glob@^2.0.1:
dependencies:
is-extglob "^1.0.0"

is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4:
is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4, is-my-json-valid@^2.13.1:
version "2.15.0"
resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b"
dependencies:
Expand Down Expand Up @@ -1231,7 +1253,7 @@ js-tokens@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5"

js-yaml@^3.5.1:
js-yaml@^3.4.6, js-yaml@^3.5.1:
version "3.7.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80"
dependencies:
Expand Down Expand Up @@ -1488,7 +1510,7 @@ normalize-path@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a"

npmlog@^4.0.1:
npmlog@^4.0.0, npmlog@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f"
dependencies:
Expand Down Expand Up @@ -1690,6 +1712,10 @@ querystring@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"

ramda@^0.22.1:
version "0.22.1"
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.22.1.tgz#031da0c3df417c5b33c96234757eb37033f36a0e"

randomatic@^1.1.3:
version "1.1.6"
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb"
Expand Down Expand Up @@ -1901,6 +1927,14 @@ sha.js@^2.3.6:
dependencies:
inherits "^2.0.1"

shelljs@0.7.4:
version "0.7.4"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.4.tgz#b8f04b3a74ddfafea22acf98e0be45ded53d59c8"
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"

shelljs@^0.7.5:
version "0.7.5"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.5.tgz#2eef7a50a21e1ccf37da00df767ec69e30ad0675"
Expand Down

0 comments on commit d0cbfc0

Please sign in to comment.