From 9939f1432329d428240ddafff5674a2405a7f2bc Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Sat, 20 Jan 2018 09:45:44 +0100 Subject: [PATCH] chore: use commitlint and git commitmsg hook with husky --- .travis.yml | 2 +- CONTRIBUTING.md | 1 + package.json | 12 +++++++++++- yarn.lock | Bin 313843 -> 320709 bytes 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e72fad17..bbf6acc51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,6 @@ node_js: - 'lts/*' script: - npm install - - echo commitlint-travis + - commitlint-travis - npm run pre:ci - npm run test diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 61c5005a0..73883296a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -185,6 +185,7 @@ fix: xxxxxxxxxx Commits types as `docs:`,`style:`,`refactor:`,`perf:`,`test:` and `chore:` are valid but has no effect on versioning, but, it would be great if you use them. +Use `npm run commitmsg` to check your commit message. ### 5. Rebase and Push Changes diff --git a/package.json b/package.json index 602c6cdac..ed657f55f 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,9 @@ "unix-crypt-td-js": "^1.0.0" }, "devDependencies": { + "@commitlint/cli": "^6.0.2", + "@commitlint/config-conventional": "^6.0.2", + "@commitlint/travis-cli": "^6.0.2", "@verdaccio/types": "0.2.0", "axios": "0.17.1", "babel-cli": "6.26.0", @@ -93,6 +96,7 @@ "friendly-errors-webpack-plugin": "1.6.1", "github-markdown-css": "2.10.0", "html-webpack-plugin": "2.30.1", + "husky": "^0.14.3", "identity-obj-proxy": "3.0.0", "in-publish": "2.0.0", "jest": "22.1.1", @@ -142,6 +146,7 @@ "test:unit": "cross-env NODE_ENV=test BABEL_ENV=test jest '(/test/unit.*\\.spec|/test/webui/.*\\.spec)\\.js' --maxWorkers 2", "test:func": "cross-env NODE_ENV=test BABEL_ENV=test jest '(/test/functional.*\\.func)\\.js' --maxWorkers 2", "pre:ci": "npm run lint && npm run build:webui", + "commitmsg": "commitlint -e $GIT_PARAMS", "coverage:publish": "codecov", "lint": "npm run flow && eslint .", "lint:css": "stylelint 'src/**/*.scss' --syntax scss", @@ -161,5 +166,10 @@ "publishConfig": { "registry": "https://registry.npmjs.org/" }, - "license": "MIT" + "license": "MIT", + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + } } diff --git a/yarn.lock b/yarn.lock index 31f4a15715dae9a5b6edc37305afe352e80bf2c7..f5b0f04738b7de291dc768c0225d3bc96713a6db 100644 GIT binary patch delta 4394 zcmaJ^ZH!!18P2`4?LsRQXuC@>(&;vp4|k^L-1BkIA*l>lqR@(<0b>m4`P@!AyR)5{ z7TQFcikg@Z(qy#91YPLtlNDTTz3W4e$|M;;Y38wz=y?1AJ?w!TX zpP75kne%=<@AE$Q&HmP3{%Y&fJFc8D?Zw4ruhm@Y?KQ1t<6&M$^<*xb-xcrsV57Xb zx0W5L-6kIE+`%wc1v7 z57if4XTeqHXnpO1R{LPSv)nXr53SSDJ&UgWNOg|X(`;eWgpW(Uxll9hrDJZX*K9AT zRw+9t%K@!BoMo%MZncm-;kd1Z9UG$CoKlawQkoWw|`UO2<4)pWgM9S5Fl7#He8 zWmh^bx7~3iW2tmlSe81d4?#vzt-bXqfi=%8GL|?RR=!fXzFaEzs53`zJ##M|*C`b}x5X=F(*k^xDg{mOJKJ>uy<8 z9jK_&t-W2fWL+mafQESKpLud7BH^bYeoxr>(W$E|fUmH5KH43gdLr8R$#;a;7 z465#U3IL$W5rKpvN@B`WuLN9$j8`9S^bh^5C<3p#ygoIH!ocQty4D6nX)nSpo`=g*2p`DvT6U zHbsm%W-vp-Vahr-vx76 z!nkmRX`48nASGnNFgBFaBuyotP}zhc6fRE1vtf}%yDKDX2_9_=Z`>Bm?kQISh@!|7 zC3ikmbZ6oqI5x3Ta*+T|5Msm=B{-uJDW{ACW_Hj*oLlXrlG#AZK*B~K$p+YEhEGla zZ5Xo|&{Vd`zV~yUD+O4}cfOs4m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