Skip to content

Commit

Permalink
🐙(git hook): add commitlint with gitmoji
Browse files Browse the repository at this point in the history
New commitlint configuration to add convention and gitmoji to prepare for auto-generation of
changelog
  • Loading branch information
JeremyDolle committed Jan 15, 2022
1 parent c214b74 commit 71be075
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commit
6 changes: 3 additions & 3 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
prompt: {
questions: {
type: {
description: "Select the type of change that you're committing",
description: "Select the TYPE of change that you're committing",
enum: {
'✨': {
description: 'A new feature',
Expand Down Expand Up @@ -69,11 +69,11 @@ module.exports = {
},
scope: {
description:
'What is the scope of this change (e.g. component or file name)',
'What is the SCOPE of this change (e.g. component or file name)',
},
subject: {
description:
'Write a short, imperative tense description of the change',
'Write a short, imperative tense DESCRIPTION of the change',
},
body: {
description: 'Provide a longer description of the change',
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"main": "post-init.script.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"commit": "cz"
"commit": "cz",
"prepare": "husky install"
},
"keywords": [
"react",
Expand All @@ -36,7 +37,8 @@
"@commitlint/cz-commitlint": "^16.0.0",
"@commitlint/prompt-cli": "^16.0.0",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "^3.3.0"
"cz-conventional-changelog": "^3.3.0",
"husky": "^7.0.4"
},
"config": {
"commitizen": {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,11 @@ human-signals@^2.1.0:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==

husky@^7.0.4:
version "7.0.4"
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535"
integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==

iconv-lite@^0.4.24:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
Expand Down

0 comments on commit 71be075

Please sign in to comment.