From f09e361eefcbb7c7aeaae0255b9fbb5aa6e5b2db Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Tue, 13 Jul 2021 21:54:36 +0300 Subject: [PATCH] CI: Disallow spaces just before the separating colon in commit titles --- .github/workflows/lintcommits.yml | 2 +- Meta/lint-commit.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lintcommits.yml b/.github/workflows/lintcommits.yml index 2ab95db63b..17585e3e8c 100644 --- a/.github/workflows/lintcommits.yml +++ b/.github/workflows/lintcommits.yml @@ -34,7 +34,7 @@ jobs: uses: tim-actions/commit-message-checker-with-regex@v0.3.1 with: commits: ${{ steps.get-pr-commits.outputs.commits }} - pattern: '^\S.*?: .+' + pattern: '^\S.*?\S: .+' error: 'Missing category in commit title (if this is a fix up of a previous commit, it should be squashed)' - name: Check first word of title for capitalization diff --git a/Meta/lint-commit.sh b/Meta/lint-commit.sh index 38b8e21131..bb5073627d 100755 --- a/Meta/lint-commit.sh +++ b/Meta/lint-commit.sh @@ -23,7 +23,7 @@ while read -r line; do ((line_number += 1)) line_length=${#line} - category_pattern="^\S.*?: .+" + category_pattern="^\S.*?\S: .+" if [[ $line_number -eq 1 ]] && (echo "$line" | grep -P -v -q "$category_pattern"); then error "Missing category in commit title (if this is a fix up of a previous commit, it should be squashed)" fi