Skip to content

Commit

Permalink
feat(template): add commitlint to enforce commit message format
Browse files Browse the repository at this point in the history
  • Loading branch information
bericp1 committed Mar 28, 2019
1 parent a36faf2 commit 60a9cb1
Show file tree
Hide file tree
Showing 4 changed files with 310 additions and 10 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ git push -u origin master

- [ ] Write a script to automate README and package.json customizations
- [ ] More documentation
- [ ] `commitlint`

----------------------------------------

Expand All @@ -88,7 +87,7 @@ yarn

to install all of the necessary dependencies and tools.

## IMPORTANT: Commit Messages
## Commit Messages

This package uses [`semantic-release`](https://github.com/semantic-release/semantic-release) to
automatically version and publish to NPM. Version numbers are automatically generated based on the
Expand All @@ -104,6 +103,8 @@ yarn run commit

To use `commitizen` to generate your commit message via friendly prompts.

Commit message format is enforced using [`commitlint`](https://conventional-changelog.github.io/commitlint).

## Next Steps

This project is based on the `carimus-node-ts-package-template`. Check out the
Expand Down
4 changes: 4 additions & 0 deletions docs/COMMITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ format.
It's described briefly by `semantic-release` [here](https://github.com/semantic-release/semantic-release#commit-message-format)
and in more detail by the Angular docs [here](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).

## Linting

Commit message format is enforced using [`commitlint`](https://conventional-changelog.github.io/commitlint).

## Automated

Simply run
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"license": "MIT",
"private": false,
"devDependencies": {
"@commitlint/cli": "^7.5.2",
"@commitlint/config-conventional": "^7.5.0",
"@types/jest": "^24.0.11",
"@typescript-eslint/eslint-plugin": "^1.5.0",
"@typescript-eslint/parser": "^1.5.0",
Expand All @@ -47,6 +49,7 @@
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
Expand All @@ -65,5 +68,10 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
}
}
Loading

0 comments on commit 60a9cb1

Please sign in to comment.