From 3f08e957d46efc624ea50fd5ef9cbae58d4d85f1 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sun, 16 May 2021 02:59:04 +0300 Subject: [PATCH] Meta: Add a check for periods on the end of titles to commit linter --- .github/workflows/cmake.yml | 8 ++++++++ Meta/lint-commit.sh | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2e21a997e22..9335dd6bb91 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -265,6 +265,14 @@ jobs: pattern: '^\S.*?: .+' error: 'Missing category in commit title (if this is a fix up of a previous commit, it should be squashed)' + - name: Check title + if: ${{ success() || failure() }} + uses: tim-actions/commit-message-checker-with-regex@v0.3.1 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} + pattern: '^.+[^.\n](\n.*)*$' + error: 'Commit title ends in a period' + notify_irc: needs: [build_and_test_serenity, build_and_test_lagom, lint_commits] runs-on: ubuntu-20.04 diff --git a/Meta/lint-commit.sh b/Meta/lint-commit.sh index d9360e98cb8..38b8e21131b 100755 --- a/Meta/lint-commit.sh +++ b/Meta/lint-commit.sh @@ -28,6 +28,10 @@ while read -r line; do error "Missing category in commit title (if this is a fix up of a previous commit, it should be squashed)" fi + if [[ $line_number -eq 1 ]] && [[ "$line" =~ \.$ ]]; then + error "Commit title ends in a period" + fi + if [[ $line_length -gt 72 ]]; then error "Commit message lines are too long (maximum allowed is 72 characters)" fi