浏览代码

Merge topic 'codespell-commit-message'

42445b2c04 ci: run commit messages through codespell

Acked-by: Kitware Robot <[email protected]>
Acked-by: Alex <[email protected]>
Merge-request: !8007
Brad King 2 年之前
父节点
当前提交
dcb1c9c080
共有 2 个文件被更改,包括 17 次插入1 次删除
  1. 16 0
      .gitlab/ci/codespell.sh
  2. 1 1
      .gitlab/os-linux.yml

+ 16 - 0
.gitlab/ci/codespell.sh

@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+result=0
+echo "Running codespell on source code..."
+codespell || result=1
+
+if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
+  for COMMIT in $(git rev-list "^$CI_MERGE_REQUEST_DIFF_BASE_SHA" "$CI_COMMIT_SHA"); do
+    echo "Running codespell on commit message of $COMMIT..."
+    git show --format=%B -s "$COMMIT" | codespell - || result=1
+  done
+fi
+
+exit $result

+ 1 - 1
.gitlab/os-linux.yml

@@ -480,7 +480,7 @@
     stage: build
     extends: .fedora37
     script:
-        - codespell
+        - .gitlab/ci/codespell.sh
     interruptible: true
 
 .cmake_build_linux: