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 31f4a1571..f5b0f0473 100644 Binary files a/yarn.lock and b/yarn.lock differ