From aa5e295704a2b9f5a5ceb952327ed38ec455deb5 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Mon, 29 Jan 2024 16:59:40 +0100 Subject: [PATCH] ci: Extend `commitlint` configuration with conventional commits There was an issue that the exclamation mark wasn't parsed properly. For example, the commit message "feat!: Test" was declined, but is valid. --- .commitlintrc.yml | 2 ++ .github/workflows/commits.yml | 2 +- .pre-commit-config.yaml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.commitlintrc.yml b/.commitlintrc.yml index dab71d5a0..ef0396003 100644 --- a/.commitlintrc.yml +++ b/.commitlintrc.yml @@ -15,3 +15,5 @@ rules: always, [build, chore, ci, docs, feat, fix, merge, perf, refactor, revert, test], ] +extends: + - '@commitlint/config-conventional' diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml index 06e7af1f2..a56c36acc 100644 --- a/.github/workflows/commits.yml +++ b/.github/workflows/commits.yml @@ -15,7 +15,7 @@ jobs: with: fetch-depth: 0 - name: Install commitlint - run: npm install -g @commitlint/cli + run: npm install -g @commitlint/cli @commitlint/config-conventional - name: Validate commit messages id: conventional-commits env: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3ca1975a..a755f0336 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -158,6 +158,8 @@ repos: hooks: - id: commitlint stages: [commit-msg] + additional_dependencies: + - '@commitlint/config-conventional' - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 hooks: