Skip to content

Commit

Permalink
workflow: improve git hooks setup
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 6, 2018
1 parent 5191f13 commit a6a9d6d
Show file tree
Hide file tree
Showing 6 changed files with 568 additions and 22 deletions.
8 changes: 8 additions & 0 deletions .github/COMMIT_CONVENTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/convention.md).
#### TL;DR:

Messages must be matched by the following regex:

``` js
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|ci|chore|types)(\(.+\))?: .{1,50}/
```

#### Examples

Appears under "Features" header, `compiler` subheader:
Expand Down
10 changes: 2 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,12 @@ You will need [Node.js](http://nodejs.org) **version 6+** and [Java Runtime Envi
After cloning the repo, run:

``` bash
$ npm install
& npm run setup
$ npm install # or yarn
```

The `setup` script links two git hooks:

- `pre-commit`: runs ESLint on staged files.
- `commit-msg`: validates commit message format (see below).

### Committing Changes

Commit messages should follow the [commit message convention](./COMMIT_CONVENTION.md) so that changelogs can be automatically generated. If git hooks have been properly linked, commit messages will be automatically validated upon commit. It is recommended to use `npm run commit` instead of `git commit`, which provides an interactive CLI for generating proper commit messages.
Commit messages should follow the [commit message convention](./COMMIT_CONVENTION.md) so that changelogs can be automatically generated. Commit messages will be automatically validated upon commit. If you are not familiar with the commit message convention, you can use `npm run commit` instead of `git commit`, which provides an interactive CLI for generating proper commit messages.

### Commonly used NPM scripts

Expand Down
Loading

0 comments on commit a6a9d6d

Please sign in to comment.