From 7c41fbe1aa275ec9af87e0ce6deb97f941cd1a4e Mon Sep 17 00:00:00 2001 From: Rima Sirich Date: Wed, 4 Nov 2020 15:07:54 +0200 Subject: [PATCH 1/7] [OSS] Add Commitizen --- package.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5b9129a..6b0f01d 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,27 @@ "jest": "^25.3.0", "rimraf": "^3.0.2", "typescript": "^3.8.3", - "coveralls": "3.1.0" + "coveralls": "3.1.0", + "cz-conventional-changelog": "3.3.0", + "@commitlint/cli": "11.0.0", + "@commitlint/config-conventional": "11.0.0", + "husky": "4.3.0" }, "dependencies": { "ws": "^7.2.3" + }, + "husky": { + "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" + }, + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] } } From 916db641dc6b1dfa475310a8cac58ce4151564ca Mon Sep 17 00:00:00 2001 From: Rima Sirich Date: Wed, 4 Nov 2020 15:11:10 +0200 Subject: [PATCH 2/7] Update config.yml --- .circleci/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a871a30..03c126a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,6 +38,14 @@ jobs: # a collection of steps environment: COVERALLS_SERVICE_NAME: circle-ci COVERALLS_GIT_BRANCH: ${CIRCLE_BRANCH} + - run: + name: Define environment variable with lastest commit's message + command: | + echo 'export COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")' >> $BASH_ENV + source $BASH_ENV + - run: + name: Lint commit message + command: echo "$COMMIT_MESSAGE" | npx commitlint - save_cache: paths: - node_modules From 3ea597073042259683d95b2590b153e8f59f5a68 Mon Sep 17 00:00:00 2001 From: Rima Sirich Date: Wed, 4 Nov 2020 15:14:34 +0200 Subject: [PATCH 3/7] Update CONTRIBUTING.md --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 79e59b7..e0e203c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,5 +17,10 @@ An issue that is about a real bug is closed as soon as the fix is committed. ## Contribute Code You are welcome to contribute code. PRs will be examined and if it fits the quality requirements and the roadmap of the product they will be merged. +## Commit Messages +This project uses [conventional commits standard](https://www.conventionalcommits.org/en/v1.0.0-beta.2/#specification) with the [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional). +Recommanded: Use `git cz` to build conventional commit messages. +- requires [commitizen](https://github.com/commitizen/cz-cli#installing-the-command-line-tool) to be installed. + ## Developer Certificate of Origin (DCO) Due to legal reasons, contributors will be asked to accept a DCO before they submit the first pull request to this projects, this happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/). From dd5989871cc433aafe2f49b6bc57ccd3ad06d423 Mon Sep 17 00:00:00 2001 From: Rima Sirich Date: Wed, 4 Nov 2020 15:16:09 +0200 Subject: [PATCH 4/7] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 701e314..e2ad55b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![CircleCI](https://circleci.com/gh/SAP/vscode-webview-rpc-lib.svg?style=svg)](https://circleci.com/gh/SAP/vscode-webview-rpc-lib) [![Coverage Status](https://coveralls.io/repos/github/SAP/vscode-webview-rpc-lib/badge.svg?branch=master)](https://coveralls.io/github/SAP/vscode-webview-rpc-lib?branch=master) +[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) ![GitHub license](https://img.shields.io/badge/license-Apache_2.0-blue.svg) [![REUSE status](https://api.reuse.software/badge/github.com/SAP/vscode-webview-rpc-lib)](https://api.reuse.software/info/github.com/SAP/vscode-webview-rpc-lib) [![dependentbot](https://api.dependabot.com/badges/status?host=github&repo=SAP/vscode-webview-rpc-lib)](https://dependabot.com/) From c7571fc99c8707d393630ba17d7d52fd54fa37ad Mon Sep 17 00:00:00 2001 From: Rima Sirich Date: Wed, 4 Nov 2020 15:19:06 +0200 Subject: [PATCH 5/7] Update package.json --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6b0f01d..d988bd2 100644 --- a/package.json +++ b/package.json @@ -44,11 +44,12 @@ "husky": { "hooks": { "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" + } }, "config": { "commitizen": { "path": "cz-conventional-changelog" - } + } }, "commitlint": { "extends": [ From 08ec4eee8a3b5546100aeae0d668fdacebf9bc22 Mon Sep 17 00:00:00 2001 From: Rima Sirich Date: Wed, 4 Nov 2020 15:21:56 +0200 Subject: [PATCH 6/7] Fix package.json structure From c81916ee7ad16600e76b7178d2e2922d4f2a784f Mon Sep 17 00:00:00 2001 From: Rima Sirich Date: Wed, 4 Nov 2020 15:26:29 +0200 Subject: [PATCH 7/7] ci: add commitizen support