diff --git a/.commitlintrc.yaml b/.commitlintrc.yaml new file mode 100644 index 00000000..9cb74a70 --- /dev/null +++ b/.commitlintrc.yaml @@ -0,0 +1,2 @@ +extends: + - "@commitlint/config-conventional" diff --git a/.cz.json b/.cz.json new file mode 100644 index 00000000..03a5bc9c --- /dev/null +++ b/.cz.json @@ -0,0 +1,4 @@ +{ + "maxHeaderWidth": 72, + "path": "cz-conventional-changelog" +} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b494af85..7a008dd1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,9 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v2 with: go-version: 1.15 - uses: actions/setup-python@v2 - uses: pre-commit/action@v2.0.0 + - uses: wagoid/commitlint-github-action@v2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8bb970f..bf54a6ce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,3 +20,9 @@ repos: - id: go-fmt - id: go-mod-tidy - id: go-build + - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook + rev: v5.0.0 + hooks: + - id: commitlint + stages: [commit-msg] + additional_dependencies: ["@commitlint/config-conventional"] diff --git a/README.md b/README.md index 158f9ea4..ab7ddc02 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,20 @@ the hooks by running the following command in the root of the repository: pre-commit install ``` +This repository following `Conventional Commits` for message formatting. +See: https://www.conventionalcommits.org/en/v1.0.0/ + +``` +[optional scope]: + +[optional body] + +[optional footer(s)] +``` + +You can use commitizen to help generate commit messages. +See: http://commitizen.github.io/cz-cli/ + ### Running Project Built Locally #### Terraform v0.12